From 97a1194c572024515b4bec859b3419f80e8448f0 Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg Date: Tue, 17 Oct 2023 08:40:15 +0200 Subject: [PATCH 1/6] adding easyblocks: palm.py --- easybuild/easyblocks/p/palm.py | 90 ++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 easybuild/easyblocks/p/palm.py diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py new file mode 100644 index 0000000000..213001b1f2 --- /dev/null +++ b/easybuild/easyblocks/p/palm.py @@ -0,0 +1,90 @@ +## +# Copyright 2018-2019 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +EasyBuild support for building and installing PALM, implemented as an easyblock + +@author: Viktor Rehnberg (Chalmers University of Technology) +""" +import os +import tempfile + +import easybuild.tools.environment as env +from easybuild.framework.easyblock import EasyBlock +from easybuild.tools.config import build_option +from easybuild.tools.filetools import find_glob_pattern +from easybuild.tools.run import run_cmd + + +class EB_PALM(EasyBlock): + """Support for building/installing PALM.""" + + def __init__(self, *args, **kwargs): + """Initialise PALM easyblock.""" + super().__init__(*args, **kwargs) + + def configure_step(self): + """No configuration procedure for PALM.""" + pass + + def build_step(self): + """No build procedure for PALM.""" + pass + + def install_step(self): + """Custom install procedure for PALM.""" + + install_script_pattern = "install" + if self.dry_run: + install_script = install_script_pattern + else: + install_script = find_glob_pattern(install_script_pattern) + + cmd = ' '.join([ + self.cfg['preinstallopts'], + "bash", + install_script, + "-p %s" % self.installdir, + self.cfg['installopts'], + ]) + run_cmd(cmd, log_all=True, simple=True) + + def sanity_check_step(self): + """Custom sanity check for PALM.""" + custom_paths = { + 'files': [os.path.join(self.installdir, 'bin', 'palmrun')], + 'dirs': [], + } + super().sanity_check_step(custom_paths=custom_paths) + + def make_module_extra(self): + """Extra statements specific to PALM to include in generated module file.""" + txt = super().make_module_extra() + + bin_dirs = [ + os.path.join(self.installdir, 'bin'), + ] + txt += self.module_generator.prepend_paths('PATH', bin_dirs) + + return txt From f7ab7bae79f8f1747a1d5122295e5da8fdb3d1e2 Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg Date: Tue, 17 Oct 2023 08:42:16 +0200 Subject: [PATCH 2/6] Remove unused imports --- easybuild/easyblocks/p/palm.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index 213001b1f2..677aefaa94 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -28,11 +28,8 @@ @author: Viktor Rehnberg (Chalmers University of Technology) """ import os -import tempfile -import easybuild.tools.environment as env from easybuild.framework.easyblock import EasyBlock -from easybuild.tools.config import build_option from easybuild.tools.filetools import find_glob_pattern from easybuild.tools.run import run_cmd From 7fc1e6749518f6ffee78a29de62899c98d9e41c3 Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg <35767167+VRehnberg@users.noreply.github.com> Date: Mon, 23 Oct 2023 09:53:18 +0200 Subject: [PATCH 3/6] Simplify make_module_extra Remove self.installdir from bin_dir paths on akesa's suggestion https://github.com/easybuilders/easybuild-easyblocks/pull/3020#discussion_r1368207994 --- easybuild/easyblocks/p/palm.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index 677aefaa94..f83e9bd2a8 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -79,9 +79,6 @@ def make_module_extra(self): """Extra statements specific to PALM to include in generated module file.""" txt = super().make_module_extra() - bin_dirs = [ - os.path.join(self.installdir, 'bin'), - ] - txt += self.module_generator.prepend_paths('PATH', bin_dirs) + txt += self.module_generator.prepend_paths('PATH', ['bin']) return txt From 6a71006f4c7970db2a8154b775e16b84d8075735 Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg <35767167+VRehnberg@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:06:29 +0100 Subject: [PATCH 4/6] Remove make_module_extra as requested --- easybuild/easyblocks/p/palm.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index f83e9bd2a8..f0777a4dbe 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -75,10 +75,4 @@ def sanity_check_step(self): } super().sanity_check_step(custom_paths=custom_paths) - def make_module_extra(self): - """Extra statements specific to PALM to include in generated module file.""" - txt = super().make_module_extra() - - txt += self.module_generator.prepend_paths('PATH', ['bin']) - return txt From 6e367e9adb77c4aa5c460ff500fb4c746a91ba82 Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg <35767167+VRehnberg@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:07:39 +0100 Subject: [PATCH 5/6] Remove line missed in last commit --- easybuild/easyblocks/p/palm.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index f0777a4dbe..de1af55341 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -74,5 +74,3 @@ def sanity_check_step(self): 'dirs': [], } super().sanity_check_step(custom_paths=custom_paths) - - return txt From f037c2a889c6fae4b1d64e6542b0b90d5525e3ed Mon Sep 17 00:00:00 2001 From: Viktor Rehnberg <35767167+VRehnberg@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:52:17 +0100 Subject: [PATCH 6/6] Set copy right to 2023 --- easybuild/easyblocks/p/palm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index de1af55341..6674be5c7a 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2019 Ghent University +# Copyright 2023 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),