|
| 1 | +## |
| 2 | +# Copyright 2023 Ghent University |
| 3 | +# |
| 4 | +# This file is part of EasyBuild, |
| 5 | +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), |
| 6 | +# with support of Ghent University (http://ugent.be/hpc), |
| 7 | +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), |
| 8 | +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) |
| 9 | +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). |
| 10 | +# |
| 11 | +# https://github.com/easybuilders/easybuild |
| 12 | +# |
| 13 | +# EasyBuild is free software: you can redistribute it and/or modify |
| 14 | +# it under the terms of the GNU General Public License as published by |
| 15 | +# the Free Software Foundation v2. |
| 16 | +# |
| 17 | +# EasyBuild is distributed in the hope that it will be useful, |
| 18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | +# GNU General Public License for more details. |
| 21 | +# |
| 22 | +# You should have received a copy of the GNU General Public License |
| 23 | +# along with EasyBuild. If not, see <http://www.gnu.org/licenses/>. |
| 24 | +## |
| 25 | +""" |
| 26 | +EasyBuild support for building and installing PALM, implemented as an easyblock |
| 27 | +
|
| 28 | +@author: Viktor Rehnberg (Chalmers University of Technology) |
| 29 | +""" |
| 30 | +import os |
| 31 | + |
| 32 | +from easybuild.framework.easyblock import EasyBlock |
| 33 | +from easybuild.tools.filetools import find_glob_pattern |
| 34 | +from easybuild.tools.run import run_cmd |
| 35 | + |
| 36 | + |
| 37 | +class EB_PALM(EasyBlock): |
| 38 | + """Support for building/installing PALM.""" |
| 39 | + |
| 40 | + def __init__(self, *args, **kwargs): |
| 41 | + """Initialise PALM easyblock.""" |
| 42 | + super().__init__(*args, **kwargs) |
| 43 | + |
| 44 | + def configure_step(self): |
| 45 | + """No configuration procedure for PALM.""" |
| 46 | + pass |
| 47 | + |
| 48 | + def build_step(self): |
| 49 | + """No build procedure for PALM.""" |
| 50 | + pass |
| 51 | + |
| 52 | + def install_step(self): |
| 53 | + """Custom install procedure for PALM.""" |
| 54 | + |
| 55 | + install_script_pattern = "install" |
| 56 | + if self.dry_run: |
| 57 | + install_script = install_script_pattern |
| 58 | + else: |
| 59 | + install_script = find_glob_pattern(install_script_pattern) |
| 60 | + |
| 61 | + cmd = ' '.join([ |
| 62 | + self.cfg['preinstallopts'], |
| 63 | + "bash", |
| 64 | + install_script, |
| 65 | + "-p %s" % self.installdir, |
| 66 | + self.cfg['installopts'], |
| 67 | + ]) |
| 68 | + run_cmd(cmd, log_all=True, simple=True) |
| 69 | + |
| 70 | + def sanity_check_step(self): |
| 71 | + """Custom sanity check for PALM.""" |
| 72 | + custom_paths = { |
| 73 | + 'files': [os.path.join(self.installdir, 'bin', 'palmrun')], |
| 74 | + 'dirs': [], |
| 75 | + } |
| 76 | + super().sanity_check_step(custom_paths=custom_paths) |
0 commit comments