├── .github └── workflows │ ├── linting.yml │ └── unit_tests.yml ├── .gitignore ├── .hound.yml ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── README.rst ├── RELEASE_NOTES ├── easybuild ├── __init__.py └── easyblocks │ ├── 0 │ └── __init__.py │ ├── __init__.py │ ├── a │ ├── __init__.py │ ├── abaqus.py │ ├── adf.py │ ├── advisor.py │ ├── aedt.py │ ├── amber.py │ ├── anaconda.py │ ├── ansys.py │ ├── ant.py │ ├── aocc.py │ ├── aomp.py │ └── armadillo.py │ ├── b │ ├── __init__.py │ ├── bazel.py │ ├── berkeleygw.py │ ├── binutils.py │ ├── blat.py │ ├── boost.py │ ├── bowtie.py │ ├── bowtie2.py │ ├── bwa.py │ └── bzip2.py │ ├── c │ ├── __init__.py │ ├── cblas.py │ ├── cgal.py │ ├── chimera.py │ ├── clang.py │ ├── clang_aomp.py │ ├── cmake.py │ ├── code_server.py │ ├── comsol.py │ ├── cp2k.py │ ├── cplex.py │ ├── crispr_dav.py │ ├── cryptography.py │ ├── cuda.py │ ├── cudacompat.py │ ├── cudnn.py │ └── cufflinks.py │ ├── d │ ├── __init__.py │ ├── db.py │ ├── dm_reverb.py │ └── dualsphysics.py │ ├── e │ ├── __init__.py │ ├── easybuildmeta.py │ ├── eigen.py │ ├── elpa.py │ ├── elsi.py │ ├── esmf.py │ └── extrae.py │ ├── f │ ├── __init__.py │ ├── faststructure.py │ ├── fdtd_solutions.py │ ├── ferret.py │ ├── fftw.py │ ├── fftwmpi.py │ ├── flex.py │ ├── flexiblas.py │ ├── flook.py │ ├── fluent.py │ ├── freesurfer.py │ ├── freetype.py │ └── fsl.py │ ├── g │ ├── __init__.py │ ├── g2clib.py │ ├── g2lib.py │ ├── gamess_us.py │ ├── gate.py │ ├── gcc.py │ ├── gctf.py │ ├── geant4.py │ ├── ghc.py │ ├── go.py │ ├── gromacs.py │ └── gurobi.py │ ├── generic │ ├── __init__.py │ ├── binariestarball.py │ ├── binary.py │ ├── buildenv.py │ ├── bundle.py │ ├── cargo.py │ ├── cargopythonbundle.py │ ├── cargopythonpackage.py │ ├── cmakemake.py │ ├── cmakemakecp.py │ ├── cmakeninja.py │ ├── cmakepythonpackage.py │ ├── cmdcp.py │ ├── conda.py │ ├── configuremake.py │ ├── configuremakepythonpackage.py │ ├── craytoolchain.py │ ├── dataset.py │ ├── fortranpythonpackage.py │ ├── gopackage.py │ ├── intelbase.py │ ├── jar.py │ ├── juliabundle.py │ ├── juliapackage.py │ ├── makecp.py │ ├── mesonninja.py │ ├── modulerc.py │ ├── ocamlpackage.py │ ├── octavepackage.py │ ├── packedbinary.py │ ├── perlbundle.py │ ├── perlmodule.py │ ├── pythonbundle.py │ ├── pythonpackage.py │ ├── rpackage.py │ ├── rpm.py │ ├── rubygem.py │ ├── scons.py │ ├── systemcompiler.py │ ├── systemcompilergcc.py │ ├── systemmpi.py │ ├── tarball.py │ ├── toolchain.py │ ├── versionindependentpythonpackage.py │ ├── vscpythonpackage.py │ └── waf.py │ ├── h │ ├── __init__.py │ ├── hadoop.py │ ├── hdf5.py │ ├── hpcc.py │ ├── hpcg.py │ ├── hpl.py │ └── hypre.py │ ├── i │ ├── __init__.py │ ├── icc.py │ ├── iccifort.py │ ├── ifort.py │ ├── imkl.py │ ├── imkl_fftw.py │ ├── impi.py │ ├── inspector.py │ ├── intel_compilers.py │ └── itac.py │ ├── j │ ├── __init__.py │ ├── java.py │ └── jaxlib.py │ ├── k │ └── __init__.py │ ├── l │ ├── __init__.py │ ├── lammps.py │ ├── lapack.py │ ├── libdrm.py │ ├── libint.py │ ├── libqglviewer.py │ ├── libxml2.py │ ├── llvm.py │ └── lua.py │ ├── m │ ├── __init__.py │ ├── mamba.py │ ├── maple.py │ ├── mathematica.py │ ├── matlab.py │ ├── mcr.py │ ├── mesa.py │ ├── metagenome_atlas.py │ ├── metalwalls.py │ ├── metis.py │ ├── molpro.py │ ├── motioncor2.py │ ├── mpich.py │ ├── mrbayes.py │ ├── mrtrix.py │ ├── mummer.py │ ├── mumps.py │ └── mxnet.py │ ├── n │ ├── __init__.py │ ├── namd.py │ ├── nccl.py │ ├── ncl.py │ ├── netcdf.py │ ├── netcdf4_python.py │ ├── netcdf_fortran.py │ ├── neuron.py │ ├── nim.py │ ├── nose.py │ ├── numexpr.py │ ├── numpy.py │ ├── nvhpc.py │ └── nwchem.py │ ├── o │ ├── __init__.py │ ├── ocaml.py │ ├── octave.py │ ├── openbabel.py │ ├── openblas.py │ ├── opencv.py │ ├── openfoam.py │ ├── openmpi.py │ ├── openssl.py │ ├── openssl_wrapper.py │ ├── optislang.py │ └── orca.py │ ├── p │ ├── __init__.py │ ├── palm.py │ ├── paraver.py │ ├── parmetis.py │ ├── pdt.py │ ├── perl.py │ ├── petsc.py │ ├── psi.py │ ├── psmpi.py │ ├── pybind11.py │ ├── python.py │ ├── pytorch.py │ └── pyzmq.py │ ├── q │ ├── __init__.py │ ├── qscintilla.py │ ├── qt.py │ └── quantumespresso.py │ ├── r │ ├── __init__.py │ ├── r.py │ ├── repeatmasker.py │ ├── repeatmodeler.py │ ├── reticulate.py │ ├── rmpi.py │ ├── root.py │ ├── rosetta.py │ ├── rserve.py │ ├── ruby.py │ └── rust.py │ ├── s │ ├── __init__.py │ ├── samtools.py │ ├── scalapack.py │ ├── scipion.py │ ├── scipy.py │ ├── score_p.py │ ├── scotch.py │ ├── sepp.py │ ├── siesta.py │ ├── slepc.py │ ├── star_ccm.py │ ├── stata.py │ ├── suitesparse.py │ ├── superlu.py │ ├── swig.py │ └── sympy.py │ ├── t │ ├── __init__.py │ ├── tbb.py │ ├── tensorflow.py │ ├── tensorflow_compression.py │ ├── tensorrt.py │ ├── termreadlinegnu.py │ ├── tinker.py │ ├── tkinter.py │ ├── torchvision.py │ ├── tornado.py │ ├── trilinos.py │ └── trinity.py │ ├── u │ ├── __init__.py │ └── ucx_plugins.py │ ├── v │ ├── __init__.py │ ├── velvet.py │ ├── vep.py │ ├── vmd.py │ ├── vscode.py │ └── vtune.py │ ├── w │ ├── __init__.py │ ├── wien2k.py │ ├── wps.py │ ├── wrf.py │ └── wxpython.py │ ├── x │ ├── __init__.py │ ├── xalt.py │ ├── xcrysden.py │ ├── xmipp.py │ └── xml.py │ ├── y │ └── __init__.py │ └── z │ └── __init__.py ├── setup.cfg ├── setup.py └── test ├── __init__.py └── easyblocks ├── __init__.py ├── easyblock_specific.py ├── general.py ├── init_easyblocks.py ├── module.py └── suite.py /.github/workflows/linting.yml: -------------------------------------------------------------------------------- 1 | name: Static Analysis 2 | on: [push, pull_request] 3 | 4 | permissions: 5 | contents: read # to fetch code (actions/checkout) 6 | 7 | concurrency: 8 | group: ${{format('{0}:{1}:{2}', github.repository, github.ref, github.workflow)}} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | python-linting: 13 | runs-on: ubuntu-24.04 14 | steps: 15 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2 16 | 17 | - name: set up Python 18 | uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 19 | with: 20 | python-version: 3.8 21 | 22 | - name: install Python packages 23 | run: | 24 | pip install --upgrade pip 25 | pip install --upgrade flake8 26 | 27 | - name: Run flake8 to verify PEP8-compliance of Python code 28 | run: flake8 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .pydevproject 3 | .project 4 | LICENSE_HEADER 5 | *.pyc 6 | *.pyo 7 | *.nja 8 | build/ 9 | dist/ 10 | *egg-info/ 11 | *.swp 12 | .mypy_cache/ 13 | -------------------------------------------------------------------------------- /.hound.yml: -------------------------------------------------------------------------------- 1 | # configuration for houndci, see https://houndci.com/configuration#python 2 | flake8: 3 | enabled: true 4 | config_file: setup.cfg 5 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include easybuild *.py 2 | include CONTRIBUTING.md 3 | include LICENSE 4 | include README.rst 5 | include RELEASE_NOTES 6 | include setup.py 7 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://github.com/easybuilders/easybuild/raw/develop/logo/png/easybuild_logo_2022_horizontal_dark_bg_transparent.png 2 | :align: center 3 | :height: 400px 4 | 5 | .. image:: https://github.com/easybuilders/easybuild-easyblocks/actions/workflows/unit_tests.yml/badge.svg?branch=develop 6 | 7 | `EasyBuild `_ is a software build 8 | and installation framework that allows you to manage (scientific) software 9 | on High Performance Computing (HPC) systems in an efficient way. 10 | 11 | The **easybuild-easyblocks** package provides a collection of *easyblocks* for 12 | EasyBuild. Easyblocks are Python modules that implement the install procedure for a 13 | (group of) software package(s). Together with the EasyBuild framework, 14 | they allow to easily build and install supported software packages. 15 | 16 | The EasyBuild documentation is available at http://docs.easybuild.io/. 17 | 18 | The easybuild-easyblocks source code is hosted on GitHub, along 19 | with an issue tracker for bug reports and feature requests, see 20 | https://github.com/easybuilders/easybuild-easyblocks. 21 | 22 | Related Python packages: 23 | 24 | * **easybuild-framework** 25 | 26 | * the EasyBuild framework, which includes the ``easybuild.framework`` and ``easybuild.tools`` Python 27 | packages that provide general support for building and installing software 28 | * GitHub repository: https://github.com/easybuilders/easybuild-framework 29 | * PyPi: https://pypi.python.org/pypi/easybuild-framework 30 | 31 | * **easybuild-easyconfigs** 32 | 33 | * a collection of example easyconfig files that specify which software to build, 34 | and using which build options; these easyconfigs will be well tested 35 | with the latest compatible versions of the easybuild-framework and easybuild-easyblocks packages 36 | * GitHub repository: https://github.com/easybuilders/easybuild-easyconfigs 37 | * PyPi: https://pypi.python.org/pypi/easybuild-easyconfigs 38 | -------------------------------------------------------------------------------- /easybuild/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /easybuild/easyblocks/0/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/0/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | easybuild.easyblocks package declaration 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | import os 35 | from pkgutil import extend_path 36 | 37 | # note: release candidates should be versioned as a pre-release, e.g. "1.1rc1" 38 | # 1.1-rc1 would indicate a post-release, i.e., and update of 1.1, so beware 39 | # 40 | # important note: dev versions should follow the 'X.Y.Z.dev0' format 41 | # see https://www.python.org/dev/peps/pep-0440/#developmental-releases 42 | # recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like 43 | # UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0' 44 | # This causes problems further up the dependency chain... 45 | VERSION = '5.1.1.dev0' 46 | UNKNOWN = 'UNKNOWN' 47 | 48 | 49 | def get_git_revision(): 50 | """ 51 | Returns the git revision (e.g. aab4afc016b742c6d4b157427e192942d0e131fe), 52 | or UNKNOWN is getting the git revision fails 53 | 54 | relies on GitPython (see http://gitorious.org/git-python) 55 | """ 56 | try: 57 | from git import Git, GitCommandError 58 | except ImportError: 59 | return UNKNOWN 60 | try: 61 | path = os.path.dirname(__file__) 62 | gitrepo = Git(path) 63 | res = gitrepo.rev_list('HEAD').splitlines()[0] 64 | # 'encode' may be required to make sure a regular string is returned rather than a unicode string 65 | # (only needed in Python 2; in Python 3, regular strings are already unicode) 66 | if not isinstance(res, str): 67 | res = res.encode('ascii') 68 | except GitCommandError: 69 | res = UNKNOWN 70 | 71 | return res 72 | 73 | 74 | git_rev = get_git_revision() 75 | if git_rev == UNKNOWN: 76 | VERBOSE_VERSION = VERSION 77 | else: 78 | VERBOSE_VERSION = "%s-r%s" % (VERSION, git_rev) 79 | 80 | # extend path so python finds our easyblocks in the subdirectories where they are located 81 | subdirs = [chr(x) for x in range(ord('a'), ord('z') + 1)] + ['0'] 82 | for subdir in subdirs: 83 | __path__ = extend_path(__path__, '%s.%s' % (__name__, subdir)) 84 | 85 | del subdir, subdirs, git_rev 86 | if 'x' in dir(): 87 | del x 88 | 89 | # let python know this is not the only place to look for easyblocks, so we can have multiple 90 | # easybuild/easyblocks paths in the Python search path, next to the official easyblocks distribution 91 | __path__ = extend_path(__path__, __name__) 92 | -------------------------------------------------------------------------------- /easybuild/easyblocks/a/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/a/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/a/advisor.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing the Intel Advisor XE, implemented as an easyblock 27 | 28 | @author: Lumir Jasiok (IT4Innovations) 29 | @author: Damian Alvarez (Forschungszentrum Juelich GmbH) 30 | @author: Josef Dvoracek (Institute of Physics, Czech Academy of Sciences) 31 | """ 32 | 33 | import os 34 | from easybuild.tools import LooseVersion 35 | 36 | from easybuild.easyblocks.generic.intelbase import IntelBase 37 | from easybuild.tools.build_log import EasyBuildError 38 | 39 | 40 | class EB_Advisor(IntelBase): 41 | """ 42 | Support for installing Intel Advisor XE 43 | - minimum version suported: 2020.x 44 | """ 45 | 46 | def __init__(self, *args, **kwargs): 47 | """Constructor, initialize class variables.""" 48 | super().__init__(*args, **kwargs) 49 | 50 | if LooseVersion(self.version) < LooseVersion('2020'): 51 | raise EasyBuildError( 52 | f"Version {self.version} of {self.name} is unsupported. Mininum supported version is 2020.0." 53 | ) 54 | 55 | if LooseVersion(self.version) < LooseVersion('2021'): 56 | self.subdir = 'advisor' 57 | else: 58 | self.subdir = os.path.join('advisor', 'latest') 59 | 60 | # prepare module load environment 61 | self.prepare_intel_tools_env() 62 | 63 | def prepare_step(self, *args, **kwargs): 64 | """Since 2019u3 there is no license required.""" 65 | kwargs['requires_runtime_license'] = False 66 | super().prepare_step(*args, **kwargs) 67 | 68 | def sanity_check_step(self): 69 | """Custom sanity check paths for Advisor""" 70 | binaries = ['advixe-cl', 'advixe-feedback', 'advixe-gui', 'advixe-runss', 'advixe-runtrc', 'advixe-runtc'] 71 | custom_paths = self.get_custom_paths_tools(binaries) 72 | super().sanity_check_step(custom_paths=custom_paths) 73 | -------------------------------------------------------------------------------- /easybuild/easyblocks/a/ant.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for ant, implemented as an easyblock 27 | 28 | @authors: Stijn De Weirdt (UGent), Dries Verdegem (UGent), Kenneth Hoste (UGent), Pieter De Baets (UGent), 29 | Jens Timmerman (UGent) 30 | """ 31 | import os 32 | import shutil 33 | 34 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 35 | from easybuild.tools.build_log import EasyBuildError 36 | from easybuild.tools.modules import get_software_root, get_software_version 37 | from easybuild.tools.run import run_shell_cmd 38 | 39 | 40 | class EB_ant(PackedBinary): 41 | """Support for building and installing ant.""" 42 | 43 | def install_step(self): 44 | """Custom install procedure for ant.""" 45 | 46 | junit_root = get_software_root('JUnit') 47 | if not junit_root: 48 | raise EasyBuildError("JUnit module not loaded!") 49 | 50 | junit_ver = get_software_version('JUnit') 51 | 52 | # copy JUnit jar to where it's expected 53 | try: 54 | shutil.copy(os.path.join(junit_root, 'junit-%s.jar' % junit_ver), 55 | os.path.join(os.getcwd(), "lib", "optional")) 56 | except OSError as err: 57 | raise EasyBuildError("Failed to copy JUnit jar: %s", err) 58 | 59 | cmd = "sh build.sh -Ddist.dir=%s dist" % self.installdir 60 | 61 | run_shell_cmd(cmd) 62 | -------------------------------------------------------------------------------- /easybuild/easyblocks/a/armadillo.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for Armadillo, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import os 31 | from easybuild.tools import LooseVersion 32 | from easybuild.easyblocks.generic.cmakemake import CMakeMake 33 | from easybuild.tools.build_log import EasyBuildError 34 | from easybuild.tools.modules import get_software_root 35 | from easybuild.tools.systemtools import get_shared_lib_ext 36 | 37 | 38 | class EB_Armadillo(CMakeMake): 39 | """Support for building Armadillo.""" 40 | 41 | @staticmethod 42 | def extra_options(): 43 | """Extra easyconfig parameters for Armadillo.""" 44 | extra_vars = CMakeMake.extra_options() 45 | extra_vars['separate_build_dir'][0] = True 46 | return extra_vars 47 | 48 | def configure_step(self): 49 | """Set some extra environment variables before configuring.""" 50 | 51 | boost = get_software_root('Boost') 52 | if not boost: 53 | raise EasyBuildError("Dependency module Boost not loaded?") 54 | 55 | self.cfg.update('configopts', "-DBoost_DIR=%s" % boost) 56 | self.cfg.update('configopts', "-DBOOST_INCLUDEDIR=%s/include" % boost) 57 | self.cfg.update('configopts', "-DBoost_DEBUG=ON -DBOOST_ROOT=%s" % boost) 58 | 59 | self.cfg.update('configopts', '-DBLAS_LIBRARY:PATH="%s"' % os.getenv('LIBBLAS')) 60 | self.cfg.update('configopts', '-DLAPACK_LIBRARY:PATH="%s"' % os.getenv('LIBLAPACK')) 61 | 62 | super().configure_step() 63 | 64 | def sanity_check_step(self): 65 | """Custom sanity check for Armadillo.""" 66 | if LooseVersion(self.version) < LooseVersion('7.950.1'): 67 | libdir = 'lib' 68 | else: 69 | libdir = 'lib64' 70 | 71 | custom_paths = { 72 | 'files': ['include/armadillo', os.path.join(libdir, 'libarmadillo.%s' % get_shared_lib_ext())], 73 | 'dirs': ['include/armadillo_bits'], 74 | } 75 | super().sanity_check_step(custom_paths=custom_paths) 76 | -------------------------------------------------------------------------------- /easybuild/easyblocks/b/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/b/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/b/blat.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 the Cyprus Institute 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 . 24 | ## 25 | """ 26 | EasyBuild support for BLAT 27 | 28 | @author: Andreas Panteli (The Cyprus Institute) 29 | @author: Thekla Loizou (The Cyprus Institute) 30 | @author: George Tsouloupas (The Cyprus Institute) 31 | """ 32 | import os 33 | 34 | from easybuild.easyblocks.generic.makecp import MakeCp 35 | from easybuild.tools.filetools import mkdir 36 | 37 | 38 | class EB_BLAT(MakeCp): 39 | """Support for building and installing BLAT.""" 40 | 41 | def configure_step(self): 42 | """Configure build: just create a 'bin' directory.""" 43 | mkdir("bin") 44 | 45 | def build_step(self, verbose=False): 46 | """Build BLAT using make and the appropriate options (e.g. BINDIR=).""" 47 | self.cfg.update('prebuildopts', "MACHTYPE=x86_64") 48 | bindir = os.path.join(os.getcwd(), "bin") 49 | self.cfg.update('buildopts', "BINDIR=%s" % bindir) 50 | 51 | return super().build_step(verbose=verbose) 52 | -------------------------------------------------------------------------------- /easybuild/easyblocks/b/bowtie2.py: -------------------------------------------------------------------------------- 1 | ## 2 | # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild 3 | # 4 | # Copyright:: Copyright 2012-2025 Uni.Lu/LCSB, NTUA 5 | # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste 6 | # License:: MIT/GPL 7 | # $Id$ 8 | # 9 | # This work implements a part of the HPCBIOS project and is a component of the policy: 10 | # http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html 11 | ## 12 | """ 13 | EasyBuild support for building and installing Bowtie2, implemented as an easyblock 14 | 15 | @author: Cedric Laczny (Uni.Lu) 16 | @author: Fotis Georgatos (Uni.Lu) 17 | @author: Kenneth Hoste (Ghent University) 18 | """ 19 | from easybuild.tools import LooseVersion 20 | import os 21 | 22 | from easybuild.easyblocks.generic.makecp import MakeCp 23 | from easybuild.framework.easyconfig import CUSTOM 24 | 25 | 26 | class EB_Bowtie2(MakeCp): 27 | """ 28 | Support for building bowtie2 (ifast and sensitive read alignment) 29 | - create Make.UNKNOWN 30 | - build with make and install 31 | """ 32 | @staticmethod 33 | def extra_options(extra_vars=None): 34 | """Change default values of options""" 35 | extra = MakeCp.extra_options() 36 | # files_to_copy is not mandatory here 37 | extra['files_to_copy'][2] = CUSTOM 38 | return extra 39 | 40 | def __init__(self, *args, **kwargs): 41 | """Bowtie2 easyblock constructor, define class variables.""" 42 | super().__init__(*args, **kwargs) 43 | 44 | self.bowtie2_files = ['bowtie2', 'bowtie2-build', 'bowtie2-inspect', 'MANUAL', 'MANUAL.markdown', 'NEWS'] 45 | if LooseVersion(self.version) >= LooseVersion('2.2.0'): 46 | self.bowtie2_files.extend(['bowtie2-align-l', 'bowtie2-align-s', 'bowtie2-build-l', 'bowtie2-build-s', 47 | 'bowtie2-inspect-l', 'bowtie2-inspect-s']) 48 | else: 49 | self.bowtie2_files.extend(['bowtie2-align']) 50 | 51 | if LooseVersion(self.version) >= LooseVersion('2.0.5'): 52 | self.bowtie2_files.append('LICENSE') 53 | 54 | def configure_step(self): 55 | """No custom configuration step for Bowtie2""" 56 | pass 57 | 58 | def build_step(self): 59 | """Build Bowtie2, make sure right compilation flags are used""" 60 | 61 | cc = os.getenv('CC') 62 | if cc: 63 | self.cfg.update('buildopts', 'CC="%s"' % cc) 64 | 65 | cxx = os.getenv('CXX') 66 | if cxx: 67 | self.cfg.update('buildopts', 'CPP="%s" CXX="%s"' % (cxx, cxx)) 68 | 69 | cxxflags = os.getenv('CXXFLAGS') 70 | if cxxflags: 71 | self.cfg.update('buildopts', 'RELEASE_FLAGS="%s"' % cxxflags) 72 | 73 | super().build_step() 74 | 75 | def install_step(self): 76 | """ 77 | Install by copying files to install dir 78 | """ 79 | self.cfg['files_to_copy'] = [(self.bowtie2_files, 'bin'), 'doc', 'example', 'scripts'] 80 | super().install_step() 81 | 82 | def sanity_check_step(self): 83 | """Custom sanity check for Bowtie2.""" 84 | custom_paths = { 85 | 'files': [os.path.join('bin', f) for f in self.bowtie2_files], 86 | 'dirs': ['doc', 'example', 'scripts'] 87 | } 88 | super().sanity_check_step(custom_paths=custom_paths) 89 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/c/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/c/cgal.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for CGAL, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | @author: Jens Timmerman (Ghent University) 30 | @author: Damian Alvarez (Forschungszentrum Juelich GmbH) 31 | """ 32 | import os 33 | 34 | from easybuild.tools import LooseVersion 35 | 36 | from easybuild.easyblocks.generic.cmakemake import CMakeMake 37 | from easybuild.tools.build_log import EasyBuildError 38 | from easybuild.tools.modules import get_software_root 39 | from easybuild.tools.systemtools import get_shared_lib_ext 40 | 41 | 42 | class EB_CGAL(CMakeMake): 43 | """Support for building CGAL.""" 44 | 45 | @staticmethod 46 | def extra_options(): 47 | extra_vars = CMakeMake.extra_options() 48 | extra_vars['separate_build_dir'][0] = True 49 | return extra_vars 50 | 51 | def configure_step(self): 52 | """Set some extra environment variables before configuring.""" 53 | 54 | deps = ['Boost', 'GMP', 'MPFR'] 55 | for dep in deps: 56 | if not get_software_root(dep): 57 | raise EasyBuildError('Dependency module %s not loaded?', dep) 58 | 59 | for lib in ['GMP', 'MPFR']: 60 | os.environ['%s_INC_DIR' % lib] = os.path.join(get_software_root(lib), 'include') 61 | os.environ['%s_LIB_DIR' % lib] = os.path.join(get_software_root(lib), 'lib') 62 | 63 | os.environ['BOOST_ROOT'] = get_software_root('Boost') 64 | 65 | super().configure_step() 66 | 67 | def sanity_check_step(self): 68 | """Custom sanity check for CGAL.""" 69 | 70 | shlib_ext = get_shared_lib_ext() 71 | libs = [os.path.join('lib64', 'libCGAL%s.%s' % (suffix, shlib_ext)) for suffix in ['', '_Core']] 72 | dirs = [os.path.join('include', 'CGAL')] 73 | if LooseVersion(self.version) >= LooseVersion('4.12'): 74 | dirs.append(os.path.join('lib64', 'cmake', 'CGAL')) 75 | else: 76 | dirs.append(os.path.join('lib64', 'CGAL')) 77 | custom_paths = { 78 | 'files': [os.path.join('bin', 'cgal_%s') % x for x in ['create_cmake_script', 'make_macosx_app']] + libs, 79 | 'dirs': dirs, 80 | } 81 | super().sanity_check_step(custom_paths=custom_paths) 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/chimera.py: -------------------------------------------------------------------------------- 1 | # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild 2 | # Author: Pablo Escobar Lopez 3 | # Swiss Institute of Bioinformatics 4 | # Biozentrum - University of Basel 5 | """ 6 | EasyBuild support for installing Chimera, implemented as an easyblock 7 | """ 8 | 9 | import os 10 | 11 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 12 | from easybuild.tools.build_log import EasyBuildError 13 | from easybuild.tools.filetools import mkdir, symlink 14 | from easybuild.tools.run import run_shell_cmd 15 | 16 | 17 | class EB_Chimera(PackedBinary): 18 | """Support for installing Chimera.""" 19 | 20 | def extract_step(self, verbose=False): 21 | """Custom extraction of sources for Chimera: unpack installation file 22 | to obtain chimera.bin installer.""" 23 | 24 | cmd = "unzip -d %s %s" % (self.builddir, self.src[0]['path']) 25 | run_shell_cmd(cmd) 26 | 27 | def install_step(self): 28 | """Install using chimera.bin.""" 29 | 30 | try: 31 | os.chdir(self.cfg['start_dir']) 32 | except OSError as err: 33 | raise EasyBuildError("Failed to change to %s: %s", self.cfg['start_dir'], err) 34 | 35 | # Chimera comes bundled with its dependencies, and follows a 36 | # UNIX file system layout with 'bin', 'include', 'lib', etc. To 37 | # avoid conflicts with other modules, the Chimera module must 38 | # not add the 'bin', 'include', 'lib', etc. directories to PATH, 39 | # CPATH, LD_LIBRARY_PATH, etc. We achieve this by installing 40 | # Chimera in a subdirectory (called 'chimera') instead of the 41 | # root directory. 42 | cmd = "./chimera.bin -q -d %s" % os.path.join(self.installdir, 43 | 'chimera') 44 | run_shell_cmd(cmd) 45 | 46 | # Create a symlink to the Chimera startup script; this symlink 47 | # will end up in PATH. The startup script sets up the 48 | # environment, so that Chimera finds its dependencies. 49 | mkdir(os.path.join(self.installdir, 'bin')) 50 | symlink(os.path.join(self.installdir, 'chimera', 'bin', 'chimera'), 51 | os.path.join(self.installdir, 'bin', 'chimera')) 52 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/code_server.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2012-2025 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 . 24 | ## 25 | """ 26 | EasyBlock for installing code-server, implemented as an easyblock 27 | @author: Alan O'Cais (Juelich Supercomputing Centre) 28 | """ 29 | 30 | from easybuild.framework.easyblock import EasyBlock 31 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 32 | from easybuild.tools.build_log import EasyBuildError 33 | from easybuild.tools.systemtools import AARCH64, X86_64, get_cpu_architecture 34 | 35 | 36 | class EB_code_minus_server(PackedBinary, EasyBlock): 37 | """ 38 | Support for installing code-server. 39 | """ 40 | 41 | def __init__(self, *args, **kwargs): 42 | """ Init the easyblock adding a new mapped_arch template var """ 43 | myarch = get_cpu_architecture() 44 | if myarch == X86_64: 45 | self.mapped_arch = 'amd64' 46 | elif myarch == AARCH64: 47 | self.mapped_arch = 'arm64' 48 | else: 49 | raise EasyBuildError("Architecture %s is not supported for code-server on EasyBuild", myarch) 50 | 51 | super().__init__(*args, **kwargs) 52 | 53 | self.cfg.template_values['mapped_arch'] = self.mapped_arch 54 | self.cfg.generate_template_values() 55 | 56 | def install_step(self): 57 | """Custom install step for code-server.""" 58 | install_cmd = self.cfg.get('install_cmd', None) 59 | if install_cmd is None: 60 | cmd = 'cp -a code-server-%s-linux-%s/* %s' % (self.version, self.mapped_arch, self.installdir) 61 | # set the install command to a default 62 | self.log.info("For %s, using default installation command '%s'..." % (self.name, cmd)) 63 | self.cfg['install_cmd'] = cmd 64 | super().install_step() 65 | 66 | def sanity_check_step(self): 67 | """Custom sanity check for code-server.""" 68 | custom_paths = { 69 | 'files': ['bin/code-server'], 70 | 'dirs': ['bin', 'lib', 'node_modules'], 71 | } 72 | 73 | custom_commands = ["code-server --help"] 74 | 75 | res = super().sanity_check_step( 76 | custom_paths=custom_paths, 77 | custom_commands=custom_commands 78 | ) 79 | 80 | return res 81 | 82 | def make_module_extra(self): 83 | """Add the default directories to the PATH.""" 84 | return EasyBlock.make_module_extra(self) 85 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/cryptography.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2017-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing cryptography, implemented as an easyblock 27 | 28 | @author: Alexander Grund 29 | """ 30 | from easybuild.tools import LooseVersion 31 | 32 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 33 | from easybuild.tools.run import run_shell_cmd 34 | 35 | 36 | class EB_cryptography(PythonPackage): 37 | """Support for building/installing cryptography.""" 38 | 39 | def __init__(self, *args, **kwargs): 40 | """Initialize cryptography easyblock.""" 41 | super().__init__(*args, **kwargs) 42 | 43 | # cryptography compiles a library using pthreads but does not link against it 44 | # which causes 'undefined symbol: pthread_atfork' 45 | # see https://github.com/easybuilders/easybuild-easyconfigs/issues/9446 46 | # and upstream: https://github.com/pyca/cryptography/issues/5084 47 | self.cfg['prebuildopts'] += 'CFLAGS="$CFLAGS -pthread"' 48 | self.cfg['preinstallopts'] += 'CFLAGS="$CFLAGS -pthread"' 49 | self.log.info("Adding -pthread to prebuildopts & preinstallopts of cryptography.\n" + 50 | "Final values: prebuildopts=%s and preinstallopts=%s", 51 | self.cfg['prebuildopts'], 52 | self.cfg['preinstallopts']) 53 | 54 | def sanity_check_step(self, *args, **kwargs): 55 | """Custom sanity check""" 56 | success, fail_msg = super().sanity_check_step(*args, **kwargs) 57 | if success: 58 | # Check module added in v0.7 leading to issue #9446 (see above) 59 | if LooseVersion(self.version) >= LooseVersion("0.7"): 60 | run_shell_cmd("python -c 'from cryptography.hazmat.bindings.openssl import binding'") 61 | return success, fail_msg 62 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/cudnn.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2012-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for cuDNN, implemented as an easyblock 27 | 28 | @author: Simon Branford (University of Birmingham) 29 | @author: Robert Mijakovic (LuxProvide) 30 | """ 31 | from easybuild.tools import LooseVersion 32 | 33 | from easybuild.easyblocks.generic.tarball import Tarball 34 | from easybuild.tools.build_log import EasyBuildError 35 | from easybuild.tools.systemtools import AARCH64, POWER, X86_64, get_cpu_architecture 36 | 37 | 38 | class EB_cuDNN(Tarball): 39 | """Support for building cuDNN.""" 40 | 41 | def __init__(self, *args, **kwargs): 42 | """ Init the cuDNN easyblock adding a new cudnnarch template var """ 43 | 44 | # Need to call super's init first, so we can use self.version 45 | super().__init__(*args, **kwargs) 46 | 47 | # Generate cudnnarch template value for this system 48 | cudnnarch = False 49 | myarch = get_cpu_architecture() 50 | 51 | if LooseVersion(self.version) < LooseVersion('8.3.3'): 52 | if myarch == AARCH64: 53 | cudnnarch = 'aarch64sbsa' 54 | elif myarch == POWER: 55 | cudnnarch = 'ppc64le' 56 | elif myarch == X86_64: 57 | cudnnarch = 'x64' 58 | else: 59 | if myarch == AARCH64: 60 | cudnnarch = 'sbsa' 61 | elif myarch == POWER: 62 | cudnnarch = 'ppc64le' 63 | elif myarch == X86_64: 64 | cudnnarch = 'x86_64' 65 | 66 | if not cudnnarch: 67 | raise EasyBuildError("The cuDNN easyblock does not currently support architecture %s", myarch) 68 | self.cfg['keepsymlinks'] = True 69 | self.cfg.template_values['cudnnarch'] = cudnnarch 70 | self.cfg.generate_template_values() 71 | 72 | def fetch_step(self, *args, **kwargs): 73 | """Check for EULA acceptance prior to getting sources.""" 74 | # EULA for cuDNN must be accepted via --accept-eula-for EasyBuild configuration option, 75 | # or via 'accept_eula = True' in easyconfig file 76 | self.check_accepted_eula( 77 | name='cuDNN', 78 | more_info='https://docs.nvidia.com/deeplearning/cudnn/latest/reference/eula.html' 79 | ) 80 | return super().fetch_step(*args, **kwargs) 81 | -------------------------------------------------------------------------------- /easybuild/easyblocks/c/cufflinks.py: -------------------------------------------------------------------------------- 1 | ## 2 | # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild 3 | # 4 | # Copyright:: Copyright 2012-2025 Uni.Lu/LCSB, NTUA 5 | # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste 6 | # License:: MIT/GPL 7 | # $Id$ 8 | # 9 | # This work implements a part of the HPCBIOS project and is a component of the policy: 10 | # http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html 11 | ## 12 | """ 13 | EasyBuild support for building and installing Cufflinks, implemented as an easyblock 14 | 15 | @author: Cedric Laczny (Uni.Lu) 16 | @author: Fotis Georgatos (Uni.Lu) 17 | @author: Kenneth Hoste (Ghent University) 18 | """ 19 | import fileinput 20 | import glob 21 | import re 22 | import os 23 | import sys 24 | 25 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 26 | from easybuild.tools.build_log import EasyBuildError 27 | from easybuild.tools.modules import get_software_root 28 | 29 | 30 | class EB_Cufflinks(ConfigureMake): 31 | """ 32 | Support for building and installing Cufflinks 33 | """ 34 | 35 | def configure_step(self): 36 | """ 37 | Check for dependencies 38 | """ 39 | for dep in ['Boost', 'Eigen', 'SAMtools']: 40 | if not get_software_root(dep): 41 | raise EasyBuildError("Dependency module %s not loaded?", dep) 42 | 43 | super().configure_step() 44 | 45 | def patch_step(self): 46 | """ 47 | First we need to rename a few things, s.a. http://wiki.ci.uchicago.edu/Beagle/BuildingSoftware -> "Cufflinks" 48 | """ 49 | build_dir = os.getcwd() 50 | source_files = build_dir + '/src/*.cpp' 51 | header_files = build_dir + '/src/*.h' 52 | files = glob.glob(source_files) 53 | files = files + (glob.glob(header_files)) 54 | for fname in files: 55 | for line in fileinput.input(fname, inplace=1, backup='.orig'): 56 | line = re.sub(r'foreach', 'for_each', line, count=0) 57 | sys.stdout.write(line) 58 | 59 | for line in fileinput.input(os.path.join(build_dir, 'src', 'common.h'), inplace=1, backup='.orig'): 60 | line = re.sub(r'#include \', '#include ', line, count=0) 61 | sys.stdout.write(line) 62 | 63 | super().patch_step() 64 | -------------------------------------------------------------------------------- /easybuild/easyblocks/d/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/d/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/d/db.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2013-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for DB, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import os 31 | 32 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 33 | from easybuild.tools.build_log import EasyBuildError 34 | 35 | 36 | class EB_DB(ConfigureMake): 37 | """Support for building and installing DB.""" 38 | 39 | def configure_step(self): 40 | """Configure build: change to build dir and call configure script.""" 41 | try: 42 | os.chdir('build_unix') 43 | except OSError as err: 44 | raise EasyBuildError("Failed to move to build dir: %s", err) 45 | super().configure_step(cmd_prefix='../dist/') 46 | -------------------------------------------------------------------------------- /easybuild/easyblocks/e/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/e/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/f/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/f/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/f/faststructure.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ## 3 | # Copyright 2009-2025 Ghent University 4 | # 5 | # This file is part of EasyBuild, 6 | # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), 7 | # with support of Ghent University (http://ugent.be/hpc), 8 | # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), 9 | # Flemish Research Foundation (FWO) (http://www.fwo.be/en) 10 | # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). 11 | # 12 | # https://github.com/easybuilders/easybuild 13 | # 14 | # EasyBuild is free software: you can redistribute it and/or modify 15 | # it under the terms of the GNU General Public License as published by 16 | # the Free Software Foundation v2. 17 | # 18 | # EasyBuild is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with EasyBuild. If not, see . 25 | ## 26 | """ 27 | EasyBuild support for building and installing fastStructure, implemented as an easyblock 28 | 29 | @author: Bob Dröge (University of Groningen) 30 | """ 31 | import os 32 | import stat 33 | 34 | from easybuild.easyblocks.generic.cmdcp import CmdCp 35 | from easybuild.framework.easyconfig import CUSTOM 36 | from easybuild.tools.filetools import adjust_permissions, change_dir, read_file, write_file 37 | from easybuild.tools.run import run_shell_cmd 38 | 39 | 40 | class EB_fastStructure(CmdCp): 41 | """Support for building and installing fastStructure.""" 42 | 43 | @staticmethod 44 | def extra_options(extra_vars=None): 45 | """Change default values of options""" 46 | extra = CmdCp.extra_options() 47 | # files_to_copy is not mandatory here 48 | extra['files_to_copy'][2] = CUSTOM 49 | return extra 50 | 51 | def __init__(self, *args, **kwargs): 52 | """Initialisation of custom class variables for fastStructure.""" 53 | super().__init__(*args, **kwargs) 54 | 55 | self.cfg['files_to_copy'] = ['*'] 56 | self.pyfiles = ['distruct.py', 'chooseK.py', 'structure.py'] 57 | # custom path-like environment variables for RepeatMaskerConfig 58 | self.module_load_environment.PATH = [''] 59 | 60 | def build_step(self): 61 | """Build fastStructure using setup.py.""" 62 | cwd = change_dir('vars') 63 | run_shell_cmd("python setup.py build_ext --inplace") 64 | change_dir(cwd) 65 | run_shell_cmd("python setup.py build_ext --inplace") 66 | 67 | def post_processing_step(self): 68 | """Add a shebang to the .py files and make them executable.""" 69 | for pyfile in self.pyfiles: 70 | pf_path = os.path.join(self.installdir, pyfile) 71 | pf_contents = read_file(pf_path) 72 | write_file(pf_path, "#!/usr/bin/env python\n" + pf_contents) 73 | adjust_permissions(pf_path, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) 74 | 75 | super().post_processing_step() 76 | 77 | def sanity_check_step(self): 78 | """Custom sanity check for fastStructure.""" 79 | custom_paths = { 80 | 'files': self.pyfiles, 81 | 'dirs': ['vars'], 82 | } 83 | super().sanity_check_step(custom_paths=custom_paths) 84 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/fdtd_solutions.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2013-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing FDTD Solutions, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import glob 31 | import os 32 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 33 | from easybuild.tools.build_log import EasyBuildError 34 | from easybuild.tools.filetools import copy_dir 35 | from easybuild.tools.run import run_shell_cmd 36 | 37 | 38 | class EB_FDTD_underscore_Solutions(PackedBinary): 39 | """Support for building/installing FDTD Solutions.""" 40 | 41 | def extract_step(self): 42 | """ 43 | After unpacking the main tar file, we need to unpack the rpm 44 | inside it. 45 | """ 46 | super().extract_step() 47 | 48 | rpms = glob.glob(os.path.join(self.src[0]['finalpath'], 'rpm_install_files', 'FDTD-%s*.rpm' % self.version)) 49 | if len(rpms) != 1: 50 | raise EasyBuildError("Incorrect number of RPMs found, was expecting exactly one: %s", rpms) 51 | cmd = "rpm2cpio %s | cpio -idm " % rpms[0] 52 | run_shell_cmd(cmd) 53 | 54 | def make_installdir(self): 55 | """Override installdir creation""" 56 | self.log.warning("Not pre-creating installation directory %s" % self.installdir) 57 | self.cfg['dontcreateinstalldir'] = True 58 | super().make_installdir() 59 | 60 | def build_step(self): 61 | """No build step for FDTD Solutions.""" 62 | pass 63 | 64 | def install_step(self): 65 | """Install FDTD Solutions using copy tree.""" 66 | fdtd_dir = os.path.join(self.cfg['start_dir'], 'opt', 'lumerical', 'fdtd') 67 | copy_dir(fdtd_dir, self.installdir, symlinks=self.cfg['keepsymlinks']) 68 | 69 | def sanity_check_step(self): 70 | """Custom sanity check for FDTD Solutions.""" 71 | custom_paths = { 72 | 'files': ['bin/fdtd-solutions'], 73 | 'dirs': ['lib'], 74 | } 75 | super().sanity_check_step(custom_paths=custom_paths) 76 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/fftwmpi.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing only the MPI interfaces for FFTW, 27 | implemented as an easyblock 28 | 29 | @author: Bart Oldeman (McGill University, Calcul Quebec, Digital Research Alliance of Canada) 30 | """ 31 | import os 32 | import glob 33 | 34 | from easybuild.easyblocks.fftw import EB_FFTW 35 | from easybuild.tools.build_log import EasyBuildError 36 | from easybuild.tools.modules import get_software_root 37 | from easybuild.tools.filetools import remove 38 | 39 | 40 | class EB_FFTW_period_MPI(EB_FFTW): 41 | """Support for building/installing FFTW.MPI""" 42 | 43 | @staticmethod 44 | def extra_options(): 45 | """Modify defaults for custom easyconfig parameters for FFTW.""" 46 | 47 | extra_vars = EB_FFTW.extra_options() 48 | # change defaults for unneeded or impossible options for MPI libraries 49 | extra_vars['with_openmp'][0] = False 50 | extra_vars['with_threads'][0] = False 51 | extra_vars['with_quad_prec'][0] = False 52 | return extra_vars 53 | 54 | def prepare_step(self, *args, **kwargs): 55 | """Custom prepare step: make sure FFTW is available as dependency.""" 56 | super().prepare_step(*args, **kwargs) 57 | 58 | fftw_root = get_software_root('FFTW') 59 | if not fftw_root: 60 | raise EasyBuildError("Required FFTW dependency is missing!") 61 | 62 | def post_processing_step(self): 63 | """Custom post install step for FFTW.MPI""" 64 | 65 | # remove everything except include files that are already in non-MPI FFTW dependency. 66 | remove(glob.glob(os.path.join(self.installdir, 'lib*', 'libfftw.*')) + 67 | glob.glob(os.path.join(self.installdir, 'lib*', 'libfftw[lf].*')) + 68 | glob.glob(os.path.join(self.installdir, 'lib*/pkgconfig')) + 69 | glob.glob(os.path.join(self.installdir, 'lib*/cmake')) + 70 | [os.path.join(self.installdir, p) for p in ['bin', 'share']]) 71 | super().post_processing_step() 72 | 73 | def sanity_check_step(self): 74 | """Custom sanity check for FFTW.MPI: check if all libraries/headers for MPI interfaces are there.""" 75 | super().sanity_check_step(mpionly=True) 76 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/flex.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing flex, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | from easybuild.tools import LooseVersion 31 | import os 32 | 33 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 34 | from easybuild.tools.build_log import EasyBuildError 35 | 36 | 37 | class EB_flex(ConfigureMake): 38 | """Support for building and installing flex.""" 39 | 40 | def install_step(self): 41 | """Building was performed in install dir, no explicit install step required.""" 42 | super().install_step() 43 | 44 | # create symlinks for lex and lex++, if they're not there 45 | try: 46 | for binary in ["lex", "lex++"]: 47 | binpath = os.path.join(self.installdir, "bin", binary) 48 | if not os.path.exists(binpath): 49 | os.symlink(os.path.join(self.installdir, "bin", "flex"), binpath) 50 | 51 | except OSError as err: 52 | raise EasyBuildError("Failed to symlink binaries: %s", err) 53 | 54 | def sanity_check_step(self): 55 | """Custom sanity check for flex""" 56 | custom_paths = { 57 | 'files': [os.path.join('bin', x) for x in ['flex', 'lex', 'lex++']] + ['include/FlexLexer.h'] + 58 | [('lib/libfl.a', 'lib64/libfl.a')], 59 | 'dirs': [] 60 | } 61 | if LooseVersion(self.version) < LooseVersion('2.6.3'): 62 | custom_paths['files'].append(('lib/libfl_pic.a', 'lib64/libfl_pic.a')) 63 | 64 | super().sanity_check_step(custom_paths=custom_paths) 65 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/flook.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2023-2025 Utrecht 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing flook, implemented as an easyblock 27 | 28 | @author: Arnold Kole (Utrecht University) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 32 | 33 | 34 | class EB_flook(ConfigureMake): 35 | """Support for building/installing flook.""" 36 | 37 | def __init__(self, *args, **kwargs): 38 | # call out to original constructor first, so 'self' (i.e. the class instance) is initialised 39 | super().__init__(*args, **kwargs) 40 | 41 | # Determine vendor 42 | vendor = None 43 | if self.toolchain.COMPILER_FAMILY == 'Clang': 44 | vendor = 'clang' 45 | elif self.toolchain.COMPILER_FAMILY == 'GCC': 46 | vendor = 'gnu' 47 | elif self.toolchain.COMPILER_FAMILY == 'Intel': 48 | vendor = 'intel' 49 | elif self.toolchain.COMPILER_FAMILY == 'PGI': 50 | vendor = 'pgi' 51 | 52 | # Set some default options 53 | if vendor is not None: 54 | local_comp_flags = 'VENDOR="%s" FFLAGS="$FFLAGS" CFLAGS="$CFLAGS"' % vendor 55 | else: 56 | local_comp_flags = 'FFLAGS="$FFLAGS" CFLAGS="$CFLAGS"' 57 | self.cfg.update('buildopts', 'liball %s' % local_comp_flags) 58 | self.cfg.parallel = 1 59 | 60 | def configure_step(self): 61 | # flook has no configure step 62 | pass 63 | 64 | def install_step(self): 65 | self.cfg.update('install_cmd', 'PREFIX=%s' % self.installdir) 66 | super().install_step() 67 | 68 | def sanity_check_step(self): 69 | custom_paths = { 70 | 'files': ['include/flook.mod', 'lib/libflook.a', 'lib/libflookall.a', 'lib/pkgconfig/flook.pc'], 71 | 'dirs': [], 72 | } 73 | 74 | # call out to parent to do the actual sanity checking, pass through custom paths 75 | super().sanity_check_step(custom_paths=custom_paths) 76 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/fluent.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing FLUENT, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import os 31 | import stat 32 | from easybuild.tools import LooseVersion 33 | 34 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 35 | from easybuild.framework.easyconfig import CUSTOM 36 | from easybuild.tools.filetools import adjust_permissions 37 | from easybuild.tools.run import run_shell_cmd 38 | 39 | 40 | class EB_FLUENT(PackedBinary): 41 | """Support for installing FLUENT.""" 42 | 43 | @staticmethod 44 | def extra_options(): 45 | extra_vars = PackedBinary.extra_options() 46 | extra_vars['subdir_version'] = [None, "Version to use to determine installation subdirectory", CUSTOM] 47 | return extra_vars 48 | 49 | def __init__(self, *args, **kwargs): 50 | """Custom constructor for FLUENT easyblock, initialize/define class parameters.""" 51 | super().__init__(*args, **kwargs) 52 | 53 | subdir_version = self.cfg['subdir_version'] 54 | if subdir_version is None: 55 | subdir_version = ''.join(self.version.split('.')[:2]) 56 | 57 | self.fluent_verdir = 'v%s' % subdir_version 58 | 59 | self.module_load_environment.PATH = [ 60 | os.path.join(self.fluent_verdir, 'fluent', 'bin'), 61 | os.path.join(self.fluent_verdir, 'Framework', 'bin', 'Linux64'), 62 | ] 63 | self.module_load_environment.LD_LIBRARY_PATH = [os.path.join(self.fluent_verdir, 'fluent', 'lib')] 64 | 65 | def install_step(self): 66 | """Custom install procedure for FLUENT.""" 67 | extra_args = '' 68 | # only include -noroot flag for older versions 69 | if LooseVersion(self.version) < LooseVersion('15.0'): 70 | extra_args += '-noroot' 71 | 72 | cmd = "./INSTALL %s -debug -silent -install_dir %s %s" % (extra_args, self.installdir, self.cfg['installopts']) 73 | run_shell_cmd(cmd) 74 | 75 | adjust_permissions(self.installdir, stat.S_IWOTH, add=False) 76 | 77 | def sanity_check_step(self): 78 | """Custom sanity check for FLUENT.""" 79 | bindir = os.path.join(self.fluent_verdir, 'fluent', 'bin') 80 | custom_paths = { 81 | 'files': [os.path.join(bindir, 'fluent%s' % x) for x in ['', '_arch', '_sysinfo']], 82 | 'dirs': [os.path.join(self.fluent_verdir, x) for x in ['aisol', 'CFD-Post']] 83 | } 84 | super().sanity_check_step(custom_paths=custom_paths) 85 | -------------------------------------------------------------------------------- /easybuild/easyblocks/f/freetype.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing freetype, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 32 | from easybuild.tools.modules import MODULE_LOAD_ENV_HEADERS 33 | from easybuild.tools.systemtools import get_shared_lib_ext 34 | 35 | 36 | class EB_freetype(ConfigureMake): 37 | """Support for building/installing freetype.""" 38 | 39 | def __init__(self, *args, **kwargs): 40 | """Initialisation of custom class variables for freetype.""" 41 | super().__init__(*args, **kwargs) 42 | 43 | self.maj_ver = self.version.split('.')[0] 44 | 45 | self.module_load_environment.set_alias_vars(MODULE_LOAD_ENV_HEADERS, [f'include/freetype{self.maj_ver}']) 46 | 47 | def sanity_check_step(self): 48 | """Custom sanity check for freetype.""" 49 | custom_paths = { 50 | 'files': ['bin/freetype-config', 'lib/libfreetype.a', 'lib/libfreetype.%s' % get_shared_lib_ext(), 51 | 'lib/pkgconfig/freetype%s.pc' % self.maj_ver], 52 | 'dirs': ['include/freetype%s' % self.maj_ver], 53 | } 54 | super().sanity_check_step(custom_paths=custom_paths) 55 | -------------------------------------------------------------------------------- /easybuild/easyblocks/g/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/g/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/g/g2lib.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing g2lib, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | 35 | import os 36 | import shutil 37 | 38 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 39 | from easybuild.tools.build_log import EasyBuildError 40 | from easybuild.tools.modules import get_software_root 41 | 42 | 43 | class EB_g2lib(ConfigureMake): 44 | """Support for building g2clib GRIB2 library.""" 45 | 46 | def configure_step(self): 47 | """No configuration needed""" 48 | pass 49 | 50 | def build_step(self): 51 | """Build by supplying required make options, and running build_step.""" 52 | 53 | jasper = get_software_root('JASPER') 54 | if not jasper: 55 | raise EasyBuildError("JasPer module not loaded?") 56 | 57 | buildopts = 'CC="%s" FC="%s" INCDIR="-I%s/include"' % (os.getenv('CC'), os.getenv('F90'), jasper) 58 | self.cfg.update('buildopts', buildopts) 59 | 60 | super().build_step() 61 | 62 | def install_step(self): 63 | """Install by copying generated library to install directory.""" 64 | 65 | try: 66 | targetdir = os.path.join(self.installdir, "lib") 67 | os.mkdir(targetdir) 68 | fn = "libg2.a" 69 | shutil.copyfile(os.path.join(self.cfg['start_dir'], fn), os.path.join(targetdir, fn)) 70 | except OSError as err: 71 | raise EasyBuildError("Failed to copy files to install dir: %s", err) 72 | 73 | def sanity_check_step(self): 74 | """Custom sanity check for g2lib.""" 75 | 76 | custom_paths = { 77 | 'files': ["lib/libg2.a"], 78 | 'dirs': [] 79 | } 80 | 81 | super().sanity_check_step(custom_paths=custom_paths) 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/g/ghc.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for binary GHC packages, see http://haskell.org/ghc 27 | 28 | @author: Andy Georges (Ghent University) 29 | """ 30 | from easybuild.tools import LooseVersion 31 | 32 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 33 | 34 | 35 | class EB_GHC(ConfigureMake): 36 | """ 37 | Support for building and installing applications with configure/make/make install 38 | """ 39 | 40 | def build_step(self, verbose=False): 41 | """ 42 | Support for a binary 6.12.x installation. Starting there, 43 | later GHC versions are build from source and thus require 44 | the build step. 45 | """ 46 | if LooseVersion(self.version) < LooseVersion("7.0"): 47 | pass 48 | else: 49 | super().build_step(verbose=verbose) 50 | -------------------------------------------------------------------------------- /easybuild/easyblocks/g/go.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2014-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Go, implemented as an easyblock 27 | 28 | @author: Adam DeConinck (NVIDIA) 29 | @author: Kenneth Hoste (HPC-UGent) 30 | """ 31 | import os 32 | import shutil 33 | 34 | from easybuild.tools import LooseVersion 35 | 36 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 37 | from easybuild.tools.build_log import EasyBuildError 38 | from easybuild.tools.filetools import remove_dir 39 | from easybuild.tools.run import run_shell_cmd 40 | from easybuild.tools.modules import get_software_root 41 | 42 | 43 | class EB_Go(ConfigureMake): 44 | """ 45 | Build Go compiler 46 | """ 47 | 48 | def configure_step(self): 49 | """No dedicated configure step.""" 50 | pass 51 | 52 | def build_step(self): 53 | """No dedicated build step, building & installing is done in one go.""" 54 | pass 55 | 56 | def install_step(self): 57 | """ 58 | Execute the all.bash script to build and install the Go compiler, 59 | specifying the final installation prefix by setting $GOROOT_FINAL. 60 | """ 61 | srcdir = os.path.join(self.cfg['start_dir'], 'src') 62 | 63 | # $GOROOT_FINAL only specifies the location of the final installation, which gets baked into the binaries 64 | # the installation itself is *not* done by the all.bash script, that needs to be done manually 65 | # $GOROOT_BOOTSTRAP needs to specify a Go installation directory to build the go toolchain for versions 66 | # 1.5 and later. 67 | if LooseVersion(self.version) >= LooseVersion('1.5'): 68 | go_root = get_software_root('Go') 69 | if go_root: 70 | cmd = "GOROOT_BOOTSTRAP=%s GOROOT_FINAL=%s ./all.bash" % (go_root, self.installdir) 71 | else: 72 | raise EasyBuildError("Go is required as a build dependency for installing Go since version 1.5") 73 | else: 74 | cmd = "GOROOT_FINAL=%s ./all.bash" % self.installdir 75 | 76 | run_shell_cmd(cmd, work_dir=srcdir) 77 | 78 | try: 79 | remove_dir(self.installdir) 80 | shutil.copytree(self.cfg['start_dir'], self.installdir, symlinks=self.cfg['keepsymlinks']) 81 | except OSError as err: 82 | raise EasyBuildError("Failed to copy installation to %s: %s", self.installdir, err) 83 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | __path__ = __import__('pkgutil').extend_path(__path__, __name__) 26 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/binariestarball.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2013-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing a tarball of binaries, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import os 31 | import shutil 32 | import stat 33 | 34 | from easybuild.easyblocks.generic.tarball import Tarball 35 | from easybuild.tools.build_log import EasyBuildError 36 | from easybuild.tools.filetools import adjust_permissions 37 | 38 | 39 | class BinariesTarball(Tarball): 40 | """ 41 | Support for installing a tarball of binaries 42 | """ 43 | 44 | def install_step(self): 45 | """Install by copying unzipped binaries to 'bin' subdir of installation dir, and fixing permissions.""" 46 | 47 | bindir = os.path.join(self.installdir, 'bin') 48 | try: 49 | os.makedirs(bindir) 50 | for item in os.listdir(self.cfg['start_dir']): 51 | if os.path.isfile(item): 52 | shutil.copy2(os.path.join(self.cfg['start_dir'], item), bindir) 53 | # make sure binary has executable permissions 54 | adjust_permissions(os.path.join(bindir, item), stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH, add=True) 55 | self.log.debug("Copied %s to %s and fixed permissions" % (item, bindir)) 56 | else: 57 | self.log.warning("Skipping non-file %s in %s, not copying it." % (item, self.cfg['start_dir'])) 58 | except OSError as err: 59 | raise EasyBuildError("Copying binaries in %s to install dir 'bin' failed: %s", self.cfg['start_dir'], err) 60 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cargopythonbundle.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2018-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing a bundle of Python packages, where some are built with Rust 27 | 28 | @author: Mikael Oehman (Chalmers University of Technology) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.cargo import Cargo 32 | from easybuild.easyblocks.generic.pythonbundle import PythonBundle 33 | 34 | 35 | class CargoPythonBundle(PythonBundle, Cargo): # PythonBundle must come first to take precedence 36 | """ 37 | Builds just like PythonBundle with setup for Rust and crates from Cargo easyblock 38 | 39 | The cargo init step will set up the environment variables for rustc and vendor sources 40 | but all the build steps are triggered like normal. 41 | """ 42 | 43 | @staticmethod 44 | def extra_options(extra_vars=None): 45 | """Define extra easyconfig parameters specific to Cargo""" 46 | extra_vars = PythonBundle.extra_options(extra_vars) 47 | extra_vars = Cargo.extra_options(extra_vars) # not all extra options here will used here 48 | 49 | return extra_vars 50 | 51 | def __init__(self, *args, **kwargs): 52 | """Constructor for CargoPythonBundle easyblock.""" 53 | self.check_for_sources = False # make Bundle allow sources (as crates are treated as sources) 54 | super().__init__(*args, **kwargs) 55 | 56 | # Cargo inherits from ExtensionEasyBlock, thus EB treats the software itself as an extension 57 | # Setting modulename to False to ensure that sanity checks are performed on the extensions only 58 | self.options = {'modulename': False} 59 | 60 | def extract_step(self): 61 | """Specifically use the overloaded variant from Cargo as is populates vendored sources with checksums.""" 62 | return Cargo.extract_step(self) 63 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cargopythonpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing Cargo packages (Rust lang package system) 27 | 28 | @author: Mikael Oehman (Chalmers University of Technology) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.cargo import Cargo 32 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 33 | 34 | 35 | class CargoPythonPackage(PythonPackage, Cargo): # PythonPackage must come first to take precedence 36 | """Build a Python package with setup from Cargo but build/install step from PythonPackage 37 | 38 | The cargo init step will set up the environment variables for rustc and vendor sources 39 | but all the build steps are triggered via normal PythonPackage steps like normal. 40 | """ 41 | 42 | @staticmethod 43 | def extra_options(extra_vars=None): 44 | """Define extra easyconfig parameters specific to Cargo""" 45 | extra_vars = PythonPackage.extra_options(extra_vars) 46 | extra_vars = Cargo.extra_options(extra_vars) # not all extra options here will used here 47 | 48 | return extra_vars 49 | 50 | def extract_step(self): 51 | """Specifically use the overloaded variant from Cargo as is populates vendored sources with checksums.""" 52 | return Cargo.extract_step(self) 53 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cmakemakecp.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for software configured with CMake but without 'make install' step, implemented as an easyblock 27 | 28 | @author: Samuel Moors, Vrije Universiteit Brussel (VUB) 29 | """ 30 | from easybuild.easyblocks.generic.cmakemake import CMakeMake 31 | from easybuild.easyblocks.generic.makecp import MakeCp 32 | import os 33 | 34 | 35 | class CMakeMakeCp(CMakeMake, MakeCp): 36 | """Software configured with CMake but without 'make install' step 37 | 38 | We use the default CMakeMake implementation, and use install_step from MakeCp. 39 | """ 40 | 41 | @staticmethod 42 | def extra_options(extra_vars=None): 43 | extra_vars = MakeCp.extra_options(extra_vars) 44 | return CMakeMake.extra_options(extra_vars=extra_vars) 45 | 46 | def configure_step(self, srcdir=None, builddir=None): 47 | """Configure build using CMake""" 48 | return CMakeMake.configure_step(self, srcdir=srcdir, builddir=builddir) 49 | 50 | def install_step(self): 51 | """Install by copying specified files and directories.""" 52 | if self.cfg.get('separate_build_dir', False): 53 | if self.separate_build_dir: 54 | self.cfg['start_dir'] = self.separate_build_dir 55 | else: 56 | self.cfg['start_dir'] = os.path.join(self.builddir, 'easybuild_obj') 57 | 58 | return MakeCp.install_step(self) 59 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cmakeninja.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2019-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for software that uses 27 | CMake configure step and Ninja build install. 28 | 29 | @author: Kenneth Hoste (Ghent University) 30 | @author: Pavel Grochal (INUITS) 31 | """ 32 | from easybuild.easyblocks.generic.cmakemake import CMakeMake 33 | from easybuild.easyblocks.generic.mesonninja import MesonNinja 34 | 35 | 36 | class CMakeNinja(CMakeMake, MesonNinja): 37 | """Support for configuring with CMake, building and installing with MesonNinja.""" 38 | 39 | @staticmethod 40 | def extra_options(extra_vars=None): 41 | """Define extra easyconfig parameters specific to CMakeNinja.""" 42 | extra_vars = CMakeMake.extra_options(extra_vars) 43 | extra_vars['generator'][0] = 'Ninja' 44 | extra_vars.update({ 45 | key: value for key, value in MesonNinja.extra_options().items() 46 | if key.startswith('build_') or key.startswith('install_') 47 | }) 48 | return extra_vars 49 | 50 | def configure_step(self, *args, **kwargs): 51 | """Configure using CMake.""" 52 | CMakeMake.configure_step(self, *args, **kwargs) 53 | 54 | def build_step(self, *args, **kwargs): 55 | """Build using MesonNinja.""" 56 | MesonNinja.build_step(self, *args, **kwargs) 57 | 58 | def install_step(self, *args, **kwargs): 59 | """Install using MesonNinja.""" 60 | MesonNinja.install_step(self, *args, **kwargs) 61 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cmakepythonpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for Python packages that are configured with CMake, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | from easybuild.easyblocks.generic.cmakemake import CMakeMake 35 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 36 | 37 | 38 | class CMakePythonPackage(CMakeMake, PythonPackage): 39 | """Build a Python package and module with cmake. 40 | 41 | Some packages use cmake to first build and install C Python packages 42 | and then put the Python package in lib/pythonX.Y/site-packages. 43 | 44 | We use the default CMake implementation, and use make_module_extra from PythonPackage 45 | to generate a module file which sets the PYTHONPATH. 46 | """ 47 | @staticmethod 48 | def extra_options(extra_vars=None): 49 | """Easyconfig parameters specific to Python packages thar are configured/built/installed via CMake""" 50 | extra_vars = PythonPackage.extra_options(extra_vars=extra_vars) 51 | extra_vars = CMakeMake.extra_options(extra_vars=extra_vars) 52 | # Disable runtest again (set to True by PythonPackage which is not understood by CMakeMake.test_step) 53 | extra_vars['runtest'][0] = None 54 | return extra_vars 55 | 56 | def configure_step(self, *args, **kwargs): 57 | """Main configuration using cmake""" 58 | 59 | PythonPackage.configure_step(self, *args, **kwargs) 60 | return CMakeMake.configure_step(self, *args, **kwargs) 61 | 62 | def sanity_check_step(self, *args, **kwargs): 63 | """ 64 | Custom sanity check for Python packages 65 | """ 66 | return PythonPackage.sanity_check_step(self, *args, **kwargs) 67 | 68 | def make_module_extra(self): 69 | """Add extra Python package module parameters""" 70 | return PythonPackage.make_module_extra(self) 71 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/cmdcp.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2014-2025 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 . 24 | ## 25 | """ 26 | @author: Jens Timmerman (Ghent University) 27 | @author: Kenneth Hoste (Ghent Univeristy) 28 | """ 29 | import os 30 | import re 31 | 32 | from easybuild.easyblocks.generic.makecp import MakeCp 33 | from easybuild.framework.easyconfig import CUSTOM 34 | from easybuild.tools.build_log import EasyBuildError 35 | from easybuild.tools.run import run_shell_cmd 36 | 37 | 38 | class CmdCp(MakeCp): 39 | """ 40 | Software with no configure, no make, and no make install step. 41 | Just run the specified command for all sources, and copy specified files to the install dir 42 | """ 43 | @staticmethod 44 | def extra_options(extra_vars=None): 45 | """ 46 | Define list of files or directories to be copied after make 47 | """ 48 | extra_vars = MakeCp.extra_options(extra_vars=extra_vars) 49 | extra_vars['cmds_map'] = [ 50 | [('.*', "$CC $CFLAGS %(source)s -o %(target)s")], 51 | "List of regex/template command (with 'source'/'target' fields) tuples", 52 | CUSTOM, 53 | ] 54 | return extra_vars 55 | 56 | def build_step(self): 57 | """Build by running the command with the inputfiles""" 58 | try: 59 | os.chdir(self.cfg['start_dir']) 60 | except OSError as err: 61 | raise EasyBuildError("Failed to move (back) to %s: %s", self.cfg['start_dir'], err) 62 | 63 | for src in self.src: 64 | src = src['path'] 65 | target, _ = os.path.splitext(os.path.basename(src)) 66 | 67 | # determine command to use 68 | # find (first) regex match, then complete matching command template 69 | cmd = None 70 | for pattern, regex_cmd in self.cfg['cmds_map']: 71 | try: 72 | regex = re.compile(pattern) 73 | except re.error as err: 74 | raise EasyBuildError("Failed to compile regular expression '%s': %s", pattern, err) 75 | 76 | if regex.match(os.path.basename(src)): 77 | cmd = regex_cmd % {'source': src, 'target': target} 78 | break 79 | if cmd is None: 80 | raise EasyBuildError("No match for %s in %s, don't know which command to use.", 81 | src, self.cfg['cmds_map']) 82 | 83 | run_shell_cmd(cmd) 84 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/configuremakepythonpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for Python packages that are configured with 'python configure/make/make install', 27 | implemented as an easyblock 28 | 29 | @author: Bart Verleye (Centre for eResearch, Auckland) 30 | @author: Kenneth Hoste (Ghent University) 31 | """ 32 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 33 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 34 | from easybuild.tools.run import run_shell_cmd 35 | 36 | 37 | class ConfigureMakePythonPackage(ConfigureMake, PythonPackage): 38 | """ 39 | Build a Python package and module with ``python configure``/``make``/``make install``. 40 | 41 | Implemented by using: 42 | 43 | - a custom implementation of configure_step 44 | - using the build_step and install_step from ConfigureMake 45 | - using the sanity_check_step and make_module_extra from PythonPackage 46 | """ 47 | @staticmethod 48 | def extra_options(): 49 | """Extra easyconfig parameters for Python packages being installed with python configure/make/make install.""" 50 | extra = PythonPackage.extra_options() 51 | return ConfigureMake.extra_options(extra_vars=extra) 52 | 53 | def __init__(self, *args, **kwargs): 54 | """Initialize with PythonPackage.""" 55 | PythonPackage.__init__(self, *args, **kwargs) 56 | 57 | def configure_step(self, *args, **kwargs): 58 | """Configure build using ``python configure``.""" 59 | PythonPackage.configure_step(self, *args, **kwargs) 60 | cmd = ' '.join([self.cfg['preconfigopts'], self.python_cmd, self.cfg['configopts']]) 61 | run_shell_cmd(cmd) 62 | 63 | def build_step(self, *args, **kwargs): 64 | """Build Python package with ``make``.""" 65 | return ConfigureMake.build_step(self, *args, **kwargs) 66 | 67 | def test_step(self, *args, **kwargs): 68 | """Test Python package.""" 69 | PythonPackage.test_step(self, *args, **kwargs) 70 | 71 | def install_step(self, *args, **kargs): 72 | """Install with ``make install``.""" 73 | return ConfigureMake.install_step(self, *args, **kargs) 74 | 75 | def sanity_check_step(self, *args, **kwargs): 76 | """ 77 | Custom sanity check for Python packages 78 | """ 79 | return PythonPackage.sanity_check_step(self, *args, **kwargs) 80 | 81 | def make_module_extra(self): 82 | """Add extra Python package module parameters""" 83 | return PythonPackage.make_module_extra(self) 84 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/craytoolchain.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing Cray toolchains, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | @author: Guilherme Peretti Pezzi (CSCS) 30 | @author: Petar Forai (IMP/IMBA) 31 | """ 32 | 33 | from easybuild.easyblocks.generic.bundle import Bundle 34 | from easybuild.tools.build_log import EasyBuildError 35 | 36 | 37 | KNOWN_PRGENVS = ['PrgEnv-cray', 'PrgEnv-gnu', 'PrgEnv-intel', 'PrgEnv-pgi'] 38 | 39 | 40 | class CrayToolchain(Bundle): 41 | """ 42 | Compiler toolchain: generate module file only, nothing to build/install 43 | """ 44 | 45 | def prepare_step(self, *args, **kwargs): 46 | """Prepare build environment (skip loaded of dependencies).""" 47 | 48 | kwargs['load_tc_deps_modules'] = False 49 | 50 | super().prepare_step(*args, **kwargs) 51 | 52 | def make_module_dep(self): 53 | """ 54 | Generate load/swap statements for dependencies in the module file 55 | """ 56 | prgenv_mod = None 57 | 58 | # collect 'swap' statement for dependencies (except PrgEnv) 59 | swap_deps = [] 60 | for dep in self.toolchain.dependencies: 61 | mod_name = dep['full_mod_name'] 62 | # determine versionless module name, e.g. 'fftw/3.3.4.1' => 'fftw' 63 | dep_name = '/'.join(mod_name.split('/')[:-1]) 64 | 65 | if mod_name.startswith('PrgEnv'): 66 | prgenv_mod = mod_name 67 | else: 68 | swap_deps.append(self.module_generator.swap_module(dep_name, mod_name).lstrip()) 69 | 70 | self.log.debug("Swap statements for dependencies of %s: %s", self.full_mod_name, swap_deps) 71 | 72 | if prgenv_mod is None: 73 | raise EasyBuildError("Could not find a PrgEnv-* module listed as dependency: %s", 74 | self.toolchain.dependencies) 75 | 76 | # unload statements for other PrgEnv modules 77 | prgenv_unloads = [''] 78 | for prgenv in [prgenv for prgenv in KNOWN_PRGENVS if not prgenv_mod.startswith(prgenv)]: 79 | is_loaded_guard = self.module_generator.is_loaded(prgenv) 80 | unload_stmt = self.module_generator.unload_module(prgenv).strip() 81 | prgenv_unloads.append(self.module_generator.conditional_statement(is_loaded_guard, unload_stmt)) 82 | 83 | # load statement for selected PrgEnv module (only when not loaded yet) 84 | prgenv_load = self.module_generator.load_module(prgenv_mod, recursive_unload=False) 85 | 86 | txt = '\n'.join(prgenv_unloads + [prgenv_load] + swap_deps) 87 | return txt 88 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/fortranpythonpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Python packages using Fortran, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | import os 35 | 36 | import easybuild.tools.toolchain as toolchain 37 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 38 | from easybuild.tools.build_log import EasyBuildError 39 | from easybuild.tools.run import run_shell_cmd 40 | 41 | 42 | class FortranPythonPackage(PythonPackage): 43 | """Extends PythonPackage to add a Fortran compiler to the make call""" 44 | 45 | def build_step(self): 46 | """Customize the build step by adding compiler-specific flags to the build command.""" 47 | 48 | comp_fam = self.toolchain.comp_family() 49 | 50 | if comp_fam == toolchain.INTELCOMP: # @UndefinedVariable 51 | self.cfg.update('buildopts', "--compiler=intel --fcompiler=intelem") 52 | cmd = "%s %s setup.py build %s" % (self.cfg['prebuildopts'], self.python_cmd, self.cfg['buildopts']) 53 | 54 | elif comp_fam in [toolchain.GCC, toolchain.CLANGGCC]: # @UndefinedVariable 55 | ldflags = os.getenv('LDFLAGS') 56 | if ldflags: 57 | # LDFLAGS should not be set when building numpy/scipy, because it overwrites whatever numpy/scipy sets 58 | # see http://projects.scipy.org/numpy/ticket/182 59 | # don't unset it with os.environ.pop('LDFLAGS'), doesn't work in Python 2.4, 60 | # see http://bugs.python.org/issue1287 61 | cmdprefix = "unset LDFLAGS && " 62 | self.log.debug("LDFLAGS was %s, will be cleared before %s build with '%s'" % (self.name, 63 | ldflags, 64 | cmdprefix)) 65 | self.cfg.update('prebuildopts', cmdprefix) 66 | 67 | self.cfg.update('buildopts', "--fcompiler=gnu95") 68 | 69 | else: 70 | raise EasyBuildError("Unknown family of compilers being used: %s", comp_fam) 71 | 72 | cmd = "%s %s setup.py build %s" % (self.cfg['prebuildopts'], self.python_cmd, self.cfg['buildopts']) 73 | run_shell_cmd(cmd) 74 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/jar.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for JAR files, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | from easybuild.easyblocks.generic.binary import Binary 35 | 36 | 37 | class JAR(Binary): 38 | """Support for installing JAR files.""" 39 | def __init__(self, *args, **kwargs): 40 | """Initialize.""" 41 | super().__init__(*args, **kwargs) 42 | self.log.deprecated("The JAR easyblock is deprecated. Use the Binary easyblock instead.", '6.0') 43 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/ocamlpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for OCaml packages, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | from easybuild.framework.extensioneasyblock import ExtensionEasyBlock 31 | from easybuild.tools.build_log import EasyBuildError 32 | from easybuild.tools.run import run_shell_cmd 33 | 34 | 35 | class OCamlPackage(ExtensionEasyBlock): 36 | """Builds and installs OCaml packages using OPAM package manager.""" 37 | 38 | def configure_step(self): 39 | """Raise error when configure step is run: installing OCaml packages stand-alone is not supported (yet)""" 40 | raise EasyBuildError("Installing OCaml packages stand-alone is not supported (yet)") 41 | 42 | def install_extension(self): 43 | """Perform OCaml package installation (as extension).""" 44 | # install using 'opam install' 45 | run_shell_cmd("eval `opam config env` && opam install -yv %s.%s" % (self.name, self.version)) 46 | 47 | # 'opam pin add' fixes the version of the package 48 | # see https://opam.ocaml.org/doc/Usage.html#opampin 49 | run_shell_cmd("eval `opam config env` && opam pin -yv add %s %s" % (self.name, self.version)) 50 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/octavepackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Octave, implemented as an easyblock 27 | 28 | @author: Lekshmi Deepu (Juelich Supercomputing Centre) 29 | @author: Kenneth Hoste (Ghent University) 30 | """ 31 | import os 32 | import tempfile 33 | 34 | from easybuild.framework.extensioneasyblock import ExtensionEasyBlock 35 | from easybuild.tools.build_log import EasyBuildError 36 | from easybuild.tools.filetools import change_dir 37 | from easybuild.tools.run import run_shell_cmd 38 | 39 | 40 | class OctavePackage(ExtensionEasyBlock): 41 | """Builds and installs Octave extension toolboxes.""" 42 | 43 | def configure_step(self): 44 | """Raise error when configure step is run: installing Octave toolboxes stand-alone is not supported (yet)""" 45 | raise EasyBuildError("Installing Octave toolboxes stand-alone is not supported (yet)") 46 | 47 | def install_extension(self): 48 | """Perform Octave package installation (as extension).""" 49 | 50 | # if patches are specified, we need to unpack the source tarball, apply the patch, 51 | # and create a temporary tarball to use for installation 52 | if self.patches: 53 | # call out to ExtensionEasyBlock to unpack & apply patches 54 | super().install_extension(unpack_src=True) 55 | 56 | # create temporary tarball from unpacked & patched source 57 | src = os.path.join(tempfile.gettempdir(), '%s-%s-patched.tar.gz' % (self.name, self.version)) 58 | cwd = change_dir(os.path.dirname(self.ext_dir)) 59 | run_shell_cmd("tar cfvz %s %s" % (src, os.path.basename(self.ext_dir))) 60 | change_dir(cwd) 61 | else: 62 | src = self.src 63 | 64 | # need to specify two install locations, to avoid that $HOME/octave is abused; 65 | # one general package installation prefix, one for architecture-dependent files 66 | pkg_prefix = os.path.join(self.installdir, 'share', 'octave', 'packages') 67 | pkg_arch_dep_prefix = pkg_prefix + '-arch-dep' 68 | octave_cmd = "pkg prefix %s %s; " % (pkg_prefix, pkg_arch_dep_prefix) 69 | 70 | octave_cmd += "pkg install -global %s" % src 71 | 72 | run_shell_cmd("octave --eval '%s'" % octave_cmd) 73 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/packedbinary.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBlock for binary applications that need unpacking, e.g., binary applications shipped as a .tar.gz file 27 | 28 | @author: Jens Timmerman (Ghent University) 29 | """ 30 | import os 31 | import shutil 32 | 33 | from easybuild.framework.easyblock import EasyBlock 34 | from easybuild.easyblocks.generic.binary import Binary 35 | from easybuild.tools.build_log import EasyBuildError 36 | 37 | 38 | class PackedBinary(Binary, EasyBlock): 39 | """Support for installing packed binary software. 40 | Just unpack the sources in the install dir 41 | """ 42 | 43 | def extract_step(self): 44 | """Unpack the source""" 45 | EasyBlock.extract_step(self) 46 | 47 | def install_step(self): 48 | """Copy all unpacked source directories to install directory, one-by-one.""" 49 | try: 50 | os.chdir(self.builddir) 51 | for src in os.listdir(self.builddir): 52 | srcpath = os.path.join(self.builddir, src) 53 | if os.path.isdir(srcpath): 54 | # copy files to install dir via Binary 55 | self.cfg['start_dir'] = src 56 | Binary.install_step(self) 57 | elif os.path.isfile(srcpath): 58 | shutil.copy2(srcpath, self.installdir) 59 | else: 60 | raise EasyBuildError("Path %s is not a file nor a directory?", srcpath) 61 | except OSError as err: 62 | raise EasyBuildError("Failed to copy unpacked sources to install directory: %s", err) 63 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/perlbundle.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2018-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing a bundle of Perl modules, implemented as a generic easyblock 27 | 28 | @author: Mikael Oehman (Chalmers University of Technology) 29 | """ 30 | import os 31 | 32 | from easybuild.easyblocks.generic.bundle import Bundle 33 | from easybuild.easyblocks.generic.perlmodule import PerlModule 34 | from easybuild.easyblocks.perl import get_major_perl_version, get_site_suffix 35 | from easybuild.tools.config import build_option 36 | from easybuild.tools.environment import setvar 37 | 38 | 39 | class PerlBundle(Bundle): 40 | """ 41 | Bundle of perl modules 42 | """ 43 | 44 | @staticmethod 45 | def extra_options(): 46 | """Easyconfig parameters specific to bundles of Perl modules.""" 47 | # combine custom easyconfig parameters of Bundle & PerlModule 48 | extra_vars = PerlModule.extra_options() 49 | return Bundle.extra_options(extra_vars) 50 | 51 | def __init__(self, *args, **kwargs): 52 | """Initialize PerlBundle easyblock.""" 53 | super().__init__(*args, **kwargs) 54 | 55 | self.cfg['exts_defaultclass'] = 'PerlModule' 56 | self.cfg['exts_filter'] = ("perl -e 'require %(ext_name)s'", '') 57 | 58 | def extensions_step(self, *args, **kwargs): 59 | """Install extensions""" 60 | 61 | setvar('INSTALLDIRS', 'site') 62 | # define $OPENSSL_PREFIX to ensure that e.g. Net-SSLeay extension picks up OpenSSL 63 | # from specified sysroot rather than from host OS 64 | sysroot = build_option('sysroot') 65 | if sysroot: 66 | setvar('OPENSSL_PREFIX', sysroot) 67 | 68 | super().extensions_step(*args, **kwargs) 69 | 70 | def test_step(self): 71 | """No global test step for bundle of Perl modules.""" 72 | # required since runtest is set to True by default 73 | pass 74 | 75 | def sanity_check_step(self, *args, **kwargs): 76 | """Custom sanity check for bundle of Perl modules.""" 77 | 78 | if not self.cfg['sanity_check_paths']: 79 | majver = get_major_perl_version() 80 | self.cfg['sanity_check_paths'] = { 81 | 'files': [], 82 | 'dirs': [os.path.join('lib', 'perl%s' % majver)], 83 | } 84 | 85 | super().sanity_check_step(*args, **kwargs) 86 | 87 | def make_module_extra(self): 88 | """Extra module entries for Perl bundles.""" 89 | majver = get_major_perl_version() 90 | sitelibsuffix = get_site_suffix('sitelib') 91 | 92 | txt = super().make_module_extra() 93 | txt += self.module_generator.prepend_paths("PERL%sLIB" % majver, [sitelibsuffix]) 94 | return txt 95 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/scons.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing SCons, implemented as an easyblock 27 | 28 | @author: Balazs Hajgato (Free University Brussels (VUB)) 29 | """ 30 | from easybuild.framework.easyblock import EasyBlock 31 | from easybuild.framework.easyconfig import CUSTOM 32 | from easybuild.tools.run import run_shell_cmd 33 | 34 | 35 | class SCons(EasyBlock): 36 | """Support for building/installing with SCons.""" 37 | 38 | @staticmethod 39 | def extra_options(): 40 | extra_vars = { 41 | 'prefix_arg': ['PREFIX=', "Syntax for specifying installation prefix", CUSTOM], 42 | } 43 | return EasyBlock.extra_options(extra_vars) 44 | 45 | def configure_step(self): 46 | """ 47 | No configure step for SCons 48 | """ 49 | if self.cfg['prefix_arg']: 50 | self.prefix = self.cfg['prefix_arg'] + self.installdir 51 | else: 52 | self.prefix = '' 53 | 54 | def build_step(self, verbose=False): 55 | """ 56 | Build with SCons 57 | """ 58 | 59 | par = f'-j {self.cfg.parallel}' if self.cfg.parallel > 1 else '' 60 | 61 | cmd = "%(prebuildopts)s scons %(par)s %(buildopts)s %(prefix)s" % { 62 | 'buildopts': self.cfg['buildopts'], 63 | 'prebuildopts': self.cfg['prebuildopts'], 64 | 'prefix': self.prefix, 65 | 'par': par, 66 | } 67 | res = run_shell_cmd(cmd) 68 | 69 | return res.output 70 | 71 | def test_step(self): 72 | """ 73 | Test with SCons 74 | """ 75 | if self.cfg['runtest']: 76 | cmd = "%s scons %s %s" % (self.cfg['pretestopts'], self.cfg['runtest'], self.cfg['testopts']) 77 | run_shell_cmd(cmd) 78 | 79 | def install_step(self): 80 | """ 81 | Install with SCons 82 | """ 83 | cmd = "%(preinstallopts)s scons %(prefix)s install %(installopts)s" % { 84 | 'installopts': self.cfg['installopts'], 85 | 'preinstallopts': self.cfg['preinstallopts'], 86 | 'prefix': self.prefix, 87 | } 88 | res = run_shell_cmd(cmd) 89 | 90 | return res.output 91 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/systemcompilergcc.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2024 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 . 24 | ## 25 | """ 26 | EasyBuild support for using (already installed/existing) system compiler based 27 | on GCC instead of a full install via EasyBuild. 28 | 29 | @author Bernd Mohr (Juelich Supercomputing Centre) 30 | @author Kenneth Hoste (Ghent University) 31 | @author Alan O'Cais (Juelich Supercomputing Centre) 32 | @author Alex Domingo (Vrije Universiteit Brussel) 33 | """ 34 | from easybuild.easyblocks.gcc import EB_GCC 35 | from easybuild.easyblocks.generic.systemcompiler import SystemCompiler 36 | 37 | 38 | # order matters, SystemCompiler goes first to avoid recursion whenever EB_GCC calls super() 39 | class SystemCompilerGCC(SystemCompiler, EB_GCC): 40 | """ 41 | Support for generating a module file for a system compiler based on GCC with specified name. 42 | 43 | The compiler is expected to be available in $PATH, required libraries are assumed to be readily available. 44 | 45 | Specifying 'system' as a version leads to using the derived compiler version in the generated module; 46 | if an actual version is specified, it is checked against the derived version of the system compiler that was found. 47 | """ 48 | @staticmethod 49 | def extra_options(): 50 | """Add custom easyconfig parameters for SystemCompilerGCC easyblock.""" 51 | extra_vars = EB_GCC.extra_options() 52 | extra_vars.update(SystemCompiler.extra_options()) 53 | return extra_vars 54 | 55 | def __init__(self, *args, **kwargs): 56 | """Extra initialization: keep track of values that may change due to modifications to the version.""" 57 | super().__init__(*args, **kwargs) 58 | 59 | # use GCC compiler class to generate standalone module 60 | if self.cfg['generate_standalone_module']: 61 | self.compiler_class = EB_GCC 62 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/vscpythonpackage.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2013-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing VSC-tools Python packages, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (UGent) 29 | """ 30 | import os 31 | 32 | from easybuild.easyblocks.generic.versionindependentpythonpackage import VersionIndependentPythonPackage 33 | 34 | 35 | # EasyBuild provides its own 'vsc' namespace, that shouldn't be mixed with a 'vsc' namespace available somewhere else 36 | # therefore, we need a dedicated easyblock for VSC-tools packages like vsc-base, vsc-mympirun, etc. 37 | class VSCPythonPackage(VersionIndependentPythonPackage): 38 | """Support for install VSC Python packages.""" 39 | 40 | def __init__(self, *args, **kwargs): 41 | """Custom constructor for VSC Python packages.""" 42 | super().__init__(*args, **kwargs) 43 | 44 | def sanity_check_step(self, *args, **kwargs): 45 | """Custom sanity check for VSC-tools packages.""" 46 | pythonpath = os.environ.get('PYTHONPATH', '') 47 | os.environ['PYTHONPATH'] = '' 48 | kwargs.update({'exts_filter': ('%s -s -S -c "import %%(ext_name)s"' % self.python_cmd, "")}) 49 | super().sanity_check_step(*args, **kwargs) 50 | os.environ['PYTHONPATH'] = pythonpath 51 | -------------------------------------------------------------------------------- /easybuild/easyblocks/generic/waf.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for software that uses the Waf build system. 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | 31 | from easybuild.framework.easyblock import EasyBlock 32 | from easybuild.tools.run import run_shell_cmd 33 | 34 | 35 | class Waf(EasyBlock): 36 | """ 37 | Support for building and installing applications with waf 38 | """ 39 | 40 | def configure_step(self, cmd_prefix=''): 41 | """ 42 | Configure with ./waf configure --prefix= 43 | """ 44 | cmd = ' '.join([ 45 | self.cfg['preconfigopts'], 46 | './waf', 47 | 'configure', 48 | '--prefix=%s' % self.installdir, 49 | self.cfg['configopts'], 50 | ]) 51 | res = run_shell_cmd(cmd) 52 | 53 | return res.output 54 | 55 | def build_step(self, verbose=False, path=None): 56 | """ 57 | Build with ./waf build 58 | """ 59 | cmd = ' '.join([ 60 | self.cfg['prebuildopts'], 61 | './waf', 62 | 'build', 63 | self.cfg['buildopts'], 64 | ]) 65 | res = run_shell_cmd(cmd) 66 | 67 | return res.output 68 | 69 | def install_step(self, verbose=False, path=None): 70 | """ 71 | Install with ./waf install 72 | """ 73 | cmd = ' '.join([ 74 | self.cfg['preinstallopts'], 75 | './waf', 76 | 'install', 77 | self.cfg['installopts'], 78 | ]) 79 | res = run_shell_cmd(cmd) 80 | 81 | return res.output 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/h/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/h/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/h/hpcc.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing HPCC, implemented as an easyblock 27 | 28 | @author: Samuel Moors (Vrije Universiteit Brussel) 29 | """ 30 | 31 | import os 32 | 33 | from easybuild.easyblocks.hpl import EB_HPL 34 | from easybuild.tools.filetools import copy_file, mkdir 35 | 36 | 37 | class EB_HPCC(EB_HPL): 38 | """ 39 | Support for building HPCC (HPC Challenge) 40 | - create Make.UNKNOWN 41 | - build with make and install 42 | """ 43 | 44 | def configure_step(self): 45 | """ 46 | Create Make.UNKNOWN file to build from 47 | """ 48 | # the build script file should be created in the hpl subdir 49 | super().configure_step(subdir='hpl') 50 | 51 | def build_step(self): 52 | """ 53 | Build with make and correct make options 54 | """ 55 | # TOPdir should always be ../../.. regardless of what it was in the HPL build script file 56 | super().build_step(topdir='../../..') 57 | 58 | def install_step(self): 59 | """ 60 | Install by copying files to install dir 61 | """ 62 | srcdir = self.cfg['start_dir'] 63 | destdir = os.path.join(self.installdir, 'bin') 64 | mkdir(destdir) 65 | for filename in ["hpcc", "_hpccinf.txt"]: 66 | srcfile = os.path.join(srcdir, filename) 67 | copy_file(srcfile, destdir) 68 | 69 | def sanity_check_step(self): 70 | """ 71 | Custom sanity check for HPL 72 | """ 73 | 74 | custom_paths = { 75 | 'files': ['bin/hpcc', 'bin/_hpccinf.txt'], 76 | 'dirs': [] 77 | } 78 | 79 | custom_commands = ['hpcc'] 80 | 81 | super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/i/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/i/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/i/iccifort.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2019-2025 Bart Oldeman, McGill University, Compute Canada 3 | # 4 | # This file is triple-licensed under GPLv2 (see below), MIT, and 5 | # BSD three-clause licenses. 6 | # 7 | # This file is part of EasyBuild, 8 | # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), 9 | # with support of Ghent University (http://ugent.be/hpc), 10 | # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), 11 | # Flemish Research Foundation (FWO) (http://www.fwo.be/en) 12 | # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). 13 | # 14 | # https://github.com/easybuilders/easybuild 15 | # 16 | # EasyBuild is free software: you can redistribute it and/or modify 17 | # it under the terms of the GNU General Public License as published by 18 | # the Free Software Foundation v2. 19 | # 20 | # EasyBuild is distributed in the hope that it will be useful, 21 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | # GNU General Public License for more details. 24 | # 25 | # You should have received a copy of the GNU General Public License 26 | # along with EasyBuild. If not, see . 27 | ## 28 | """ 29 | EasyBuild support for installing the Intel compiler suite, implemented as an easyblock 30 | 31 | @author: Bart Oldeman (McGill University, Compute Canada) 32 | """ 33 | 34 | import os 35 | from easybuild.easyblocks.icc import EB_icc 36 | from easybuild.easyblocks.ifort import EB_ifort 37 | from easybuild.tools.modules import MODULE_LOAD_ENV_HEADERS 38 | 39 | 40 | class EB_iccifort(EB_ifort, EB_icc): 41 | """ 42 | Class that can be used to install iccifort 43 | """ 44 | 45 | def __init__(self, *args, **kwargs): 46 | """Constructor, initialize class variables.""" 47 | super().__init__(*args, **kwargs) 48 | 49 | # Exclude 'compiler/include' for CPATH, including it causes problems, e.g. with complex.h and std::complex 50 | # cfr. https://software.intel.com/en-us/forums/intel-c-compiler/topic/338378 51 | for envar in self.module_load_environment.alias(MODULE_LOAD_ENV_HEADERS): 52 | envar.remove(os.path.join(self.comp_libs_subdir, 'compiler/include')) 53 | 54 | # remove entries from LIBRARY_PATH that icc and co already know about at compile time 55 | # only do this for iccifort merged installations so that icc can still find ifort 56 | # libraries and vice versa for split installations 57 | if self.comp_libs_subdir: 58 | excluded_library_paths = [os.path.join(self.comp_libs_subdir, path) for path in ( 59 | 'compiler/lib/intel64', 60 | 'lib', 61 | 'lib/intel64', 62 | )] 63 | for excluded_path in excluded_library_paths: 64 | self.module_load_environment.LIBRARY_PATH.remove(excluded_path) 65 | 66 | def sanity_check_step(self): 67 | """Custom sanity check paths for iccifort.""" 68 | EB_icc.sanity_check_step(self) 69 | EB_ifort.sanity_check_step(self) 70 | 71 | def make_module_extra(self): 72 | txt = super().make_module_extra() 73 | 74 | # also define $EBROOT* and $EBVERSION* for icc/ifort 75 | txt += self.module_generator.set_environment('EBROOTICC', self.installdir) 76 | txt += self.module_generator.set_environment('EBROOTIFORT', self.installdir) 77 | txt += self.module_generator.set_environment('EBVERSIONICC', self.version) 78 | txt += self.module_generator.set_environment('EBVERSIONIFORT', self.version) 79 | 80 | return txt 81 | -------------------------------------------------------------------------------- /easybuild/easyblocks/i/imkl_fftw.py: -------------------------------------------------------------------------------- 1 | # # 2 | # Copyright 2009-2025 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 . 24 | # # 25 | """ 26 | EasyBuild support for installing only the FFTW interfaces for the Intel Math Kernel Library (MKL), 27 | implemented as an easyblock 28 | 29 | @author: Bart Oldeman (McGill University, Calcul Quebec, Compute Canada) 30 | """ 31 | import os 32 | 33 | from easybuild.easyblocks.imkl import EB_imkl 34 | from easybuild.tools.build_log import EasyBuildError 35 | from easybuild.tools.modules import get_software_root 36 | 37 | 38 | class EB_imkl_minus_FFTW(EB_imkl): 39 | """ 40 | Class that can be used to install mkl FFTW interfaces only 41 | """ 42 | 43 | def prepare_step(self, *args, **kwargs): 44 | """Custom prepare step: make sure imkl is available as dependency.""" 45 | super().prepare_step(*args, **kwargs) 46 | 47 | imkl_root = get_software_root('imkl') 48 | if not imkl_root: 49 | raise EasyBuildError("Required imkl dependency is missing!") 50 | 51 | def install_step(self): 52 | """Install Intel MKL FFTW interfaces""" 53 | # correct mkl_basedir, since build of FFTW interfaces needs to be done from imkl install directory 54 | self.mkl_basedir = os.getenv('MKLROOT') 55 | self.build_mkl_fftw_interfaces(os.path.join(self.installdir, 'lib')) 56 | 57 | def make_module_step(self, *args, **kwargs): 58 | """ 59 | Custom paths of imkl are unnecessary as imkl-FFTW only ships libraries under the 'lib' subdir 60 | Use generic make_module_step skipping imkl 61 | """ 62 | return super(EB_imkl, self).make_module_step(*args, **kwargs) 63 | 64 | def make_module_extra(self): 65 | """Custom extra variables to set in module file""" 66 | # bypass extra module variables for imkl 67 | return super(EB_imkl, self).make_module_extra() 68 | 69 | def post_processing_step(self): 70 | """Custom post install step for imkl-FFTW""" 71 | # bypass post_processing_step of imkl easyblock 72 | pass 73 | 74 | def sanity_check_step(self): 75 | """Custom sanity check for imkl-FFTW: check if all libraries for FFTW interfaces are there.""" 76 | custom_paths = { 77 | 'files': [os.path.join(self.installdir, 'lib', x) for x in self.get_mkl_fftw_interface_libs()], 78 | 'dirs': [], 79 | } 80 | # Skip imkl sanity check 81 | super(EB_imkl, self).sanity_check_step(custom_paths=custom_paths) 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/i/inspector.py: -------------------------------------------------------------------------------- 1 | # # 2 | # Copyright 2013-2025 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 . 24 | # # 25 | """ 26 | EasyBuild support for installing Intel Inspector, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | @author: Damian Alvarez (Forschungzentrum Juelich GmbH) 30 | """ 31 | import os 32 | from easybuild.tools import LooseVersion 33 | 34 | from easybuild.easyblocks.generic.intelbase import IntelBase 35 | from easybuild.tools.build_log import EasyBuildError 36 | 37 | 38 | class EB_Inspector(IntelBase): 39 | """ 40 | Support for installing Intel Inspector 41 | - minimum version suported: 2020.x 42 | """ 43 | 44 | def __init__(self, *args, **kwargs): 45 | """Easyblock constructor; define class variables.""" 46 | super().__init__(*args, **kwargs) 47 | 48 | loosever = LooseVersion(self.version) 49 | if loosever < LooseVersion('2020'): 50 | raise EasyBuildError( 51 | f"Version {self.version} of {self.name} is unsupported. Mininum supported version is 2020.0." 52 | ) 53 | 54 | # recent versions of Inspector are installed to a subdirectory 55 | self.subdir = '' 56 | if loosever < LooseVersion('2021'): 57 | self.subdir = 'inspector' 58 | elif loosever >= LooseVersion('2021'): 59 | self.subdir = os.path.join('inspector', 'latest') 60 | 61 | # prepare module load environment 62 | self.prepare_intel_tools_env() 63 | 64 | def make_installdir(self): 65 | """Do not create installation directory, install script handles that already.""" 66 | super().make_installdir(dontcreate=True) 67 | 68 | def sanity_check_step(self): 69 | """Custom sanity check paths for Intel Inspector.""" 70 | binaries = ['inspxe-cl', 'inspxe-feedback', 'inspxe-gui', 'inspxe-runmc', 'inspxe-runtc'] 71 | custom_paths = self.get_custom_paths_tools(binaries) 72 | super().sanity_check_step(custom_paths=custom_paths) 73 | -------------------------------------------------------------------------------- /easybuild/easyblocks/j/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/j/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/k/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/k/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/l/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/l/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/l/libdrm.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2013-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing libdrm, implemented as an easyblock 27 | 28 | @author: Andrew Edmondson (University of Birmingham) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 32 | from easybuild.tools.systemtools import X86_64, get_cpu_architecture, get_shared_lib_ext 33 | 34 | 35 | class EB_libdrm(ConfigureMake): 36 | """ 37 | Support for building libdrm on different architectures 38 | """ 39 | 40 | def sanity_check_step(self): 41 | """Custom sanity check for libdrm""" 42 | shlib_ext = get_shared_lib_ext() 43 | custom_paths = { 44 | 'files': ['include/xf86drm.h', 'include/xf86drmMode.h', 45 | 'lib/libdrm_radeon.%s' % shlib_ext, 'lib/libdrm.%s' % shlib_ext, 'lib/libkms.%s' % shlib_ext], 46 | 'dirs': ['include/libdrm', 'include/libkms', 'lib/pkgconfig'], 47 | } 48 | 49 | arch = get_cpu_architecture() 50 | if arch == X86_64: 51 | custom_paths['files'].append('lib/libdrm_intel.%s' % shlib_ext) 52 | 53 | super().sanity_check_step(custom_paths=custom_paths) 54 | -------------------------------------------------------------------------------- /easybuild/easyblocks/l/libqglviewer.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing libQGLViewer, implemented as an easyblock 27 | 28 | @author: Javier Antonio Ruiz Bosch (Central University "Marta Abreu" of Las Villas, Cuba) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 32 | from easybuild.tools.run import run_shell_cmd 33 | from easybuild.tools.systemtools import get_shared_lib_ext 34 | from easybuild.tools.modules import get_software_root 35 | from easybuild.tools.build_log import EasyBuildError 36 | from easybuild.tools import LooseVersion 37 | 38 | 39 | class EB_libQGLViewer(ConfigureMake): 40 | """Support for building/installing libQGLViewer.""" 41 | 42 | def configure_step(self): 43 | """Custom configuration procedure for libQGLViewer: qmake PREFIX=/install/path ...""" 44 | 45 | cmd = "%(preconfigopts)s qmake PREFIX=%(installdir)s %(configopts)s" % { 46 | 'preconfigopts': self.cfg['preconfigopts'], 47 | 'installdir': self.installdir, 48 | 'configopts': self.cfg['configopts'], 49 | } 50 | run_shell_cmd(cmd) 51 | 52 | def sanity_check_step(self): 53 | """Custom sanity check for libQGLViewer.""" 54 | shlib_ext = get_shared_lib_ext() 55 | """ 56 | From version 2.8.0 onwards qt version also gets added to the lib file names. 57 | """ 58 | if LooseVersion(self.version) < LooseVersion("2.8.0"): 59 | suffix = '' 60 | else: 61 | for dep in ['Qt5', 'Qt6']: 62 | if get_software_root(dep): 63 | suffix = '-' + dep.lower() 64 | break 65 | else: 66 | raise EasyBuildError("Missing Qt5 or Qt6 dependency") 67 | custom_paths = { 68 | 'files': [('lib/libQGLViewer'+suffix+'.prl', 'lib64/libQGLViewer'+suffix+'.prl'), 69 | ('lib/libQGLViewer'+suffix+'.%s' % shlib_ext, 70 | 'lib64/libQGLViewer'+suffix+'.%s' % shlib_ext)], 71 | 'dirs': ['include/QGLViewer'], 72 | } 73 | 74 | super().sanity_check_step(custom_paths=custom_paths) 75 | -------------------------------------------------------------------------------- /easybuild/easyblocks/m/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/m/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/m/mamba.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Mamba, implemented as an easyblock 27 | 28 | @author: Caspar van Leeuwen (SURF) 29 | @author: Kenneth Hoste (HPC-UGent) 30 | """ 31 | 32 | import os 33 | 34 | from easybuild.easyblocks.anaconda import EB_Anaconda 35 | 36 | 37 | class EB_Mamba(EB_Anaconda): 38 | """Support for building/installing Mamba.""" 39 | 40 | def sanity_check_step(self): 41 | """ 42 | Custom sanity check for Mamba 43 | """ 44 | custom_paths = { 45 | 'files': [os.path.join('bin', x) for x in ['2to3', 'conda', 'pydoc', 'python', 'mamba']], 46 | 'dirs': ['etc', 'lib', 'pkgs'], 47 | } 48 | # Directly call EB_Anaconda's super, as this sanity_check_step should _overwrite_ Anaconda's (not call it) 49 | super(EB_Anaconda, self).sanity_check_step(custom_paths=custom_paths) 50 | -------------------------------------------------------------------------------- /easybuild/easyblocks/n/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/n/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/n/nccl.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2021-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building NCCL, implemented as an easyblock 27 | 28 | @author: Simon Branford (University of Birmingham) 29 | @author: Lara Peeters (Gent University) 30 | """ 31 | import os 32 | 33 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 34 | from easybuild.tools.config import build_option 35 | from easybuild.tools.systemtools import get_shared_lib_ext 36 | from easybuild.tools.filetools import copy_file 37 | 38 | 39 | class EB_NCCL(ConfigureMake): 40 | """Support for building NCCL.""" 41 | 42 | def configure_step(self): 43 | """NCCL has no configure step""" 44 | pass 45 | 46 | def build_step(self): 47 | """Build NCCL""" 48 | # NCCL builds for all supported CUDA compute capabilities by default 49 | # If cuda_compute_capabilities is specified then we override this with the selected options 50 | 51 | # list of CUDA compute capabilities to use can be specifed in three ways (where 3 overrules 2 overrules 1): 52 | # (1) in the easyconfig file, via the custom cuda_compute_capabilities; 53 | # (2) via the EasyBuild environment variable EASYBUILD_CUDA_COMPUTE_CAPABILITIES; 54 | # (3) in the EasyBuild configuration, via --cuda-compute-capabilities configuration option; 55 | cuda_cc = build_option('cuda_compute_capabilities') or self.cfg['cuda_compute_capabilities'] 56 | 57 | nvcc_gencode = [] 58 | for cc in cuda_cc: 59 | add = cc.replace('.', '') 60 | nvcc_gencode.append('-gencode=arch=compute_%s,code=sm_%s' % (add, add)) 61 | 62 | if nvcc_gencode: 63 | self.cfg.update('buildopts', 'NVCC_GENCODE="%s"' % ' '.join(nvcc_gencode)) 64 | 65 | # Set PREFIX to correctly generate nccl.pc 66 | self.cfg.update('buildopts', "PREFIX=%s" % self.installdir) 67 | 68 | super().build_step() 69 | 70 | def install_step(self): 71 | """Install NCCL""" 72 | self.cfg.update('installopts', "PREFIX=%s" % self.installdir) 73 | 74 | copy_file(os.path.join(self.cfg['start_dir'], 'LICENSE.txt'), os.path.join(self.installdir, 'LICENSE.txt')) 75 | 76 | super().install_step() 77 | 78 | def sanity_check_step(self): 79 | """Custom sanity check paths for NCCL""" 80 | custom_paths = { 81 | 'files': ['include/nccl.h', 'lib/libnccl.%s' % get_shared_lib_ext(), 'lib/libnccl_static.a', 82 | 'lib/pkgconfig/nccl.pc'], 83 | 'dirs': [], 84 | } 85 | 86 | super().sanity_check_step(custom_paths=custom_paths) 87 | -------------------------------------------------------------------------------- /easybuild/easyblocks/n/netcdf_fortran.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing netCDF-Fortran, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | 35 | import os 36 | 37 | import easybuild.tools.environment as env 38 | import easybuild.tools.toolchain as toolchain 39 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 40 | from easybuild.tools.systemtools import get_shared_lib_ext 41 | 42 | 43 | class EB_netCDF_minus_Fortran(ConfigureMake): 44 | """Support for building/installing the netCDF-Fortran library""" 45 | 46 | def configure_step(self): 47 | """Configure build: set config options and configure""" 48 | 49 | if self.toolchain.options['pic']: 50 | self.cfg.update('configopts', "--with-pic") 51 | 52 | self.cfg.update('configopts', 'FCFLAGS="%s" FC="%s"' % (os.getenv('FFLAGS'), os.getenv('F90'))) 53 | 54 | # add -DgFortran to CPPFLAGS when building with GCC 55 | if self.toolchain.comp_family() == toolchain.GCC: # @UndefinedVariable 56 | env.setvar('CPPFLAGS', "%s -DgFortran" % os.getenv('CPPFLAGS')) 57 | 58 | super().configure_step() 59 | 60 | def sanity_check_step(self): 61 | """ 62 | Custom sanity check for netCDF-Fortran 63 | """ 64 | shlib_ext = get_shared_lib_ext() 65 | custom_paths = { 66 | 'files': ["bin/nf-config"] + ["lib/libnetcdff.%s" % x for x in ['a', shlib_ext]] + 67 | ["include/%s" % x for x in ["netcdf.inc", "netcdf.mod", "typesizes.mod"]], 68 | 'dirs': [], 69 | } 70 | super().sanity_check_step(custom_paths=custom_paths) 71 | -------------------------------------------------------------------------------- /easybuild/easyblocks/n/nim.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2018-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Nim, implemented as an easyblock 27 | 28 | author: Kenneth Hoste (HPC-UGent) 29 | """ 30 | import os 31 | 32 | from easybuild.framework.easyblock import EasyBlock 33 | from easybuild.tools.filetools import copy_file, move_file 34 | from easybuild.tools.run import run_shell_cmd 35 | 36 | 37 | class EB_Nim(EasyBlock): 38 | """Support for building/installing Nim.""" 39 | 40 | def configure_step(self): 41 | """No configuration for Nim.""" 42 | pass 43 | 44 | def build_step(self): 45 | """Custom build procedure for Nim.""" 46 | 47 | # build Nim (bin/nim) 48 | run_shell_cmd("sh build.sh") 49 | 50 | # build koch management tool 51 | run_shell_cmd("bin/nim c -d:release koch") 52 | 53 | # rebuild Nim, with readline bindings 54 | run_shell_cmd("./koch boot -d:release -d:useLinenoise") 55 | 56 | # build nimble/nimgrep/nimsuggest tools 57 | run_shell_cmd("./koch tools") 58 | 59 | def install_step(self): 60 | """Custom install procedure for Nim.""" 61 | 62 | run_shell_cmd("./koch geninstall") 63 | run_shell_cmd("sh install.sh %s" % self.installdir) 64 | 65 | # install.sh copies stuff into /nim, so move it 66 | nim_dir = os.path.join(self.installdir, 'nim') 67 | for entry in os.listdir(nim_dir): 68 | move_file(os.path.join(nim_dir, entry), os.path.join(self.installdir, entry)) 69 | 70 | # also copy nimble/nimgrep/nimsuggest tools 71 | for tool in ['nimble', 'nimgrep', 'nimsuggest']: 72 | copy_file(os.path.join('bin', tool), os.path.join(self.installdir, 'bin', tool)) 73 | 74 | def sanity_check_step(self): 75 | """Custom sanity check for Nim.""" 76 | custom_paths = { 77 | 'files': ['bin/nim', 'bin/nimble', 'bin/nimgrep', 'bin/nimsuggest'], 78 | 'dirs': ['config', 'doc', 'lib'], 79 | } 80 | super().sanity_check_step(custom_paths=custom_paths) 81 | -------------------------------------------------------------------------------- /easybuild/easyblocks/n/nose.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing nose, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | """ 34 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 35 | 36 | 37 | class EB_nose(PythonPackage): 38 | """Support for installing the nose Python package as part of a Python installation.""" 39 | 40 | def __init__(self, *args, **kwargs): 41 | """Set custom class variables (unpack options).""" 42 | super().__init__(*args, **kwargs) 43 | 44 | # use extra unpack options to avoid problems like 45 | # 'tar: Ignoring unknown extended header keyword `SCHILY.nlink' 46 | # and tar exiting with non-zero exit code 47 | self.unpack_options = ' --pax-option="delete=SCHILY.*" --pax-option="delete=LIBARCHIVE.*" ' 48 | -------------------------------------------------------------------------------- /easybuild/easyblocks/o/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/o/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/p/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/p/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/p/palm.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2023-2025 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 . 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_shell_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_shell_cmd(cmd) 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) 77 | -------------------------------------------------------------------------------- /easybuild/easyblocks/p/pyzmq.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for PyZMQ, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage 32 | from easybuild.tools.modules import get_software_root 33 | 34 | 35 | class EB_PyZMQ(PythonPackage): 36 | """Support for installing the PyZMQ Python package.""" 37 | 38 | def configure_step(self): 39 | """Generate the setup.cfg file for the ZeroMQ libs/includes""" 40 | self.sitecfgfn = 'setup.cfg' 41 | root_zmq = get_software_root("ZeroMQ") 42 | if root_zmq: 43 | self.log.info("External ZeroMQ found with root %s" % root_zmq) 44 | self.sitecfg = """[build_ext] 45 | library_dirs = %(zmq)s/lib 46 | include_dirs = %(zmq)s/include 47 | """ % {'zmq': root_zmq} 48 | else: 49 | self.log.info("External ZeroMQ not found, PyZMQ will (try to) use shipped ZeroMQ.") 50 | 51 | super().configure_step() 52 | -------------------------------------------------------------------------------- /easybuild/easyblocks/q/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/q/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/r/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | Special handling of R easyblocks, due to clash with easybuild.easyblocks.r namespace. 27 | 28 | author: Kenneth Hoste (Ghent University) 29 | """ 30 | from easybuild.easyblocks.r.r import * # noqa 31 | -------------------------------------------------------------------------------- /easybuild/easyblocks/r/reticulate.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing reticulate R package, implemented as an easyblock 27 | 28 | @author: Samuel Moors (Vrije Universiteit Brussel) 29 | """ 30 | import os 31 | 32 | from easybuild.easyblocks.generic.rpackage import RPackage 33 | from easybuild.tools.modules import get_software_root 34 | 35 | 36 | class EB_reticulate(RPackage): 37 | """Support for installing the reticulate R package.""" 38 | 39 | def install_extension(self): 40 | """Add extra environment variables to modulefile""" 41 | 42 | txt = super().install_extension() 43 | if not txt: 44 | txt = "" 45 | 46 | pythonroot = get_software_root('Python') 47 | if pythonroot: 48 | # make sure EB-provided Python is used, and that reticulate does not install it's own Python 49 | # see: https://rstudio.github.io/reticulate/reference/use_python.html 50 | # see: https://github.com/rstudio/reticulate/issues/894 51 | txt += self.module_generator.set_environment('RETICULATE_PYTHON', os.path.join(pythonroot, 'bin', 'python')) 52 | else: 53 | self.log.info("Python not included as dependency, so RETICULATE_PYTHON not set") 54 | 55 | self.log.info("adding to modulefile: %s" % txt) 56 | return txt 57 | -------------------------------------------------------------------------------- /easybuild/easyblocks/r/rmpi.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing the Rmpi R library, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Jens Timmerman (Ghent University) 32 | @author: Toon Willems (Ghent University) 33 | @author: Balazs Hajgato (Vrije Universiteit Brussel) 34 | """ 35 | import easybuild.tools.toolchain as toolchain 36 | from easybuild.tools import LooseVersion 37 | from easybuild.easyblocks.generic.rpackage import RPackage 38 | 39 | 40 | class EB_Rmpi(RPackage): 41 | """Build and install Rmpi R library.""" 42 | 43 | def prepare_rmpi_configureargs(self): 44 | """ 45 | Prepare configure arguments for installing Rpmi. 46 | """ 47 | 48 | mpi_types = { 49 | toolchain.MPI_TYPE_OPENMPI: "OPENMPI", 50 | toolchain.MPI_TYPE_MPICH: "MPICH", 51 | # toolchain.MPI_TYPE_LAM: "LAM", # no support for LAM yet 52 | } 53 | # type of MPI 54 | # MPI_TYPE does not distinguish between MPICH and IntelMPI, which is why we also check mpi_family() 55 | mpi_type = self.toolchain.mpi_family() 56 | rmpi_type = mpi_types[self.toolchain.MPI_TYPE] 57 | # Rmpi versions 0.6-4 and up support INTELMPI (using --with-Rmpi-type=INTELMPI) 58 | if ((LooseVersion(self.version) >= LooseVersion('0.6-4')) and (mpi_type == toolchain.INTELMPI)): 59 | rmpi_type = 'INTELMPI' 60 | 61 | self.log.debug("Setting configure args for Rmpi") 62 | self.configureargs = [ 63 | "--with-Rmpi-include=%s" % self.toolchain.get_variable('MPI_INC_DIR'), 64 | "--with-Rmpi-libpath=%s" % self.toolchain.get_variable('MPI_LIB_DIR'), 65 | "--with-mpi=%s" % self.toolchain.get_software_root(self.toolchain.MPI_MODULE_NAME)[0], 66 | "--with-Rmpi-type=%s" % rmpi_type, 67 | ] 68 | 69 | def install_extension(self): 70 | """ 71 | Install Rmpi as extension, after seting various configure arguments. 72 | """ 73 | self.prepare_rmpi_configureargs() 74 | # it might be needed to get the R cmd and run it with mympirun... 75 | super().install_extension() 76 | 77 | def install_extension_async(self, *args, **kwargs): 78 | """ 79 | Asynchronously install Rmpi as extension, after seting various configure arguments. 80 | """ 81 | self.prepare_rmpi_configureargs() 82 | # it might be needed to get the R cmd and run it with mympirun... 83 | return super().install_extension_async(*args, **kwargs) 84 | -------------------------------------------------------------------------------- /easybuild/easyblocks/r/rserve.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing the Bioconductor R library, implemented as an easyblock 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Jens Timmerman (Ghent University) 32 | @author: Toon Willems (Ghent University) 33 | """ 34 | from easybuild.easyblocks.generic.rpackage import RPackage 35 | 36 | 37 | class EB_Rserve(RPackage): 38 | """Build and install Rserve R library.""" 39 | 40 | def install_extension(self): 41 | """Set LIBS environment variable correctly prior to building.""" 42 | self.configurevars = ['LIBS="$LIBS -lpthread"'] 43 | super().install_extension() 44 | 45 | def install_extension_async(self, *args, **kwargs): 46 | """Set LIBS environment variable correctly prior to building.""" 47 | self.configurevars = ['LIBS="$LIBS -lpthread"'] 48 | return super().install_extension_async(*args, **kwargs) 49 | -------------------------------------------------------------------------------- /easybuild/easyblocks/r/ruby.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2015-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for Ruby, implemented as an easyblock 27 | 28 | @author: Robert Schmidt (Ottawa Hospital Research Institute) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 32 | from easybuild.tools.systemtools import get_shared_lib_ext 33 | 34 | 35 | # seems like the quickest test for whether a gem is installed 36 | EXTS_FILTER_GEMS = ("gem list '^%(ext_name)s$' -i", "") 37 | 38 | 39 | class EB_Ruby(ConfigureMake): 40 | """Building and installing Ruby including support for gems""" 41 | 42 | def prepare_for_extensions(self): 43 | """Sets default class and filter for gems""" 44 | self.cfg['exts_defaultclass'] = 'RubyGem' 45 | self.cfg['exts_filter'] = EXTS_FILTER_GEMS 46 | 47 | def configure_step(self): 48 | """Updates configure options for the Ruby base install""" 49 | 50 | self.cfg.update('configopts', "--disable-install-doc --enable-shared") 51 | super().configure_step() 52 | 53 | def sanity_check_step(self): 54 | """Custom sanity check for Ruby gems""" 55 | majver = '.'.join(self.version.split('.')[:2]) 56 | custom_paths = { 57 | 'files': ['bin/erb', 'bin/gem', 'bin/irb', 'bin/rake', 'bin/rdoc', 'bin/ri', 'bin/ruby', 58 | 'lib/libruby.%s' % get_shared_lib_ext()], 59 | 'dirs': ['include/ruby-%s.0' % majver, 'lib/pkgconfig', 'lib/ruby/%s.0' % majver, 'lib/ruby/gems'], 60 | } 61 | return super().sanity_check_step(custom_paths=custom_paths) 62 | -------------------------------------------------------------------------------- /easybuild/easyblocks/s/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/s/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/s/stata.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing Stata, implemented as an easyblock 27 | 28 | author: Kenneth Hoste (HPC-UGent) 29 | """ 30 | import os 31 | import re 32 | 33 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 34 | from easybuild.tools.build_log import EasyBuildError, print_msg 35 | from easybuild.tools.filetools import change_dir 36 | from easybuild.tools.run import run_shell_cmd 37 | 38 | 39 | class EB_Stata(PackedBinary): 40 | """Support for building/installing Stata.""" 41 | 42 | def install_step(self): 43 | """Custom install procedure for Stata.""" 44 | 45 | change_dir(self.installdir) 46 | 47 | cmd = os.path.join(self.cfg['start_dir'], 'install') 48 | qa = [ 49 | (r"Do you wish to continue\?\s*\(y/n or q to quit\)", 'y'), 50 | (r"Are you sure you want to install into .*\?\s*\(y/n or q\)", 'y'), 51 | (r"Okay to proceed\s*\(y/n or q to quit\)", 'y'), 52 | ] 53 | no_qa = [ 54 | "About to proceed with installation:", 55 | "uncompressing files", 56 | "extracting files", 57 | "setting permissions", 58 | ] 59 | run_shell_cmd(cmd, qa_patterns=qa, qa_wait_patterns=no_qa) 60 | 61 | print_msg("Note: you need to manually run ./stinit in %s to initialise the license for Stata!", 62 | self.installdir) 63 | 64 | def sanity_check_step(self): 65 | """Custom sanity check for Stata.""" 66 | custom_paths = { 67 | 'files': ['stata', 'xstata'], 68 | 'dirs': [], 69 | } 70 | super().sanity_check_step(custom_paths=custom_paths) 71 | 72 | # make sure required libpng library is there for Stata 73 | # Stata depends on a very old version of libpng, so we need to provide it 74 | res = run_shell_cmd("ldd %s" % os.path.join(self.installdir, 'stata')) 75 | regex = re.compile('libpng.*not found', re.M) 76 | if regex.search(res.output): 77 | raise EasyBuildError("Required libpng library for 'stata' is not available") 78 | -------------------------------------------------------------------------------- /easybuild/easyblocks/s/swig.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for SWIG, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 31 | from easybuild.tools.modules import get_software_root 32 | 33 | 34 | class EB_SWIG(ConfigureMake): 35 | """Support for building SWIG.""" 36 | 37 | def configure_step(self): 38 | """Set some extra environment variables before configuring.""" 39 | 40 | # disable everything by default 41 | for x in ["r", "clisp", "allegrocl", "lua", "csharp", "chicken", "go", "pike ", 42 | "ocaml", "php", "ruby", "mzscheme", "guile", "gcj", "java", 43 | "octave", "perl5", "python3", "tcl"]: 44 | self.cfg.update('configopts', "--without-%s" % x) 45 | 46 | python = get_software_root('Python') 47 | if python: 48 | self.cfg.update('configopts', "--with-python=%s/bin/python" % python) 49 | else: 50 | self.cfg.update('configopts', '--without-python') 51 | 52 | super().configure_step() 53 | 54 | def sanity_check_step(self): 55 | """Custom sanity check for SWIG.""" 56 | 57 | custom_paths = { 58 | 'files': ['bin/ccache-swig', 'bin/swig'], 59 | 'dirs': [], 60 | } 61 | super().sanity_check_step(custom_paths=custom_paths) 62 | -------------------------------------------------------------------------------- /easybuild/easyblocks/s/sympy.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for sympy, implemented as an easyblock 27 | 28 | @author: Caspar van Leeuwen (SURF) 29 | @author: Kenneth Hoste (HPC-UGent) 30 | """ 31 | 32 | import os 33 | import tempfile 34 | 35 | from easybuild.easyblocks.generic.pythonpackage import PythonPackage, det_pylibdir 36 | 37 | 38 | class EB_sympy(PythonPackage): 39 | """Custom easyblock for installing the sympy Python package.""" 40 | 41 | def test_step(self): 42 | """Custom test step for sympy""" 43 | 44 | self.cfg['runtest'] = "python setup.py test" 45 | 46 | # we need to make sure that the temporary directory being used is not a symlinked path; 47 | # see https://github.com/easybuilders/easybuild-easyconfigs/issues/17593 48 | original_tmpdir = tempfile.gettempdir() 49 | tempfile.tempdir = os.path.realpath(tempfile.gettempdir()) 50 | msg = "Temporary directory set to resolved path %s (was %s), " % (original_tmpdir, tempfile.gettempdir()) 51 | msg += "to avoid failing tests due to the temporary directory being a symlinked path..." 52 | self.log.info(msg) 53 | 54 | super().test_step(self) 55 | 56 | # restore original temporary directory 57 | tempfile.tempdir = original_tmpdir 58 | self.log.debug("Temporary directory restored to %s", tempfile.gettempdir()) 59 | 60 | def sanity_check_step(self, *args, **kwargs): 61 | """Custom sanity check for sympy.""" 62 | 63 | # can't use self.pylibdir here, need to determine path on the fly using currently active 'python' command; 64 | # this is important for sympy installations for multiple Python version (via multi_deps) 65 | custom_paths = { 66 | 'files': [os.path.join('bin', 'isympy')], 67 | 'dirs': [os.path.join(det_pylibdir(), 'sympy')], 68 | } 69 | 70 | custom_commands = ["isympy --help"] 71 | 72 | return super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) 73 | -------------------------------------------------------------------------------- /easybuild/easyblocks/t/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/t/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/t/termreadlinegnu.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing Term::ReadLine::Gnu. 27 | 28 | @author: Alexander Grund (TU Dresden) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.perlmodule import PerlModule 32 | from easybuild.tools.modules import get_software_root 33 | 34 | 35 | class EB_Term_colon__colon_ReadLine_colon__colon_Gnu(PerlModule): 36 | """Support for installing the Term::ReadLine::Gnu Perl module.""" 37 | 38 | def __init__(self, *args, **kwargs): 39 | """Set configopts for dependencies""" 40 | super().__init__(*args, **kwargs) 41 | # Use the custom --prefix option to pass the installation prefixes of all direct dependencies 42 | # to avoid it picking up system libraries. 43 | prefix = ':'.join(get_software_root(dep['name']) for dep in self.cfg.dependencies()) 44 | self.cfg.update('configopts', f"--prefix='{prefix}'") 45 | -------------------------------------------------------------------------------- /easybuild/easyblocks/t/tornado.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for installing Tornado, implemented as an easyblock 27 | 28 | @author: Jens Timmerman (Ghent University) 29 | """ 30 | import os 31 | from easybuild.easyblocks.generic.packedbinary import PackedBinary 32 | 33 | 34 | class EB_Tornado(PackedBinary): 35 | """EasyBlock for Tornado""" 36 | 37 | def sanity_check_step(self): 38 | """Custom sanity check for Tornado.""" 39 | custom_paths = { 40 | 'files': [], 41 | 'dirs': ["Tornado/bin/linux/", "ThirdParty/bin/linux/"], 42 | } 43 | super().sanity_check_step(custom_paths=custom_paths) 44 | 45 | def make_module_extra(self): 46 | """Add correct path to lib to LD_LIBRARY_PATH.""" 47 | 48 | txt = super().make_module_extra() 49 | 50 | txt += self.module_generator.prepend_paths('LD_LIBRARY_PATH', ["Tornado/bin/linux/", "ThirdParty/bin/linux/"]) 51 | txt += self.module_generator.prepend_paths('PATH', ["Tornado/bin/linux/"]) 52 | txt += self.module_generator.set_environment('TORNADO_ROOT_PATH', self.installdir) 53 | txt += self.module_generator.set_environment('TORNADO_DATA_PATH', os.path.join(self.installdir, 'Data', 'WEST')) 54 | 55 | return txt 56 | -------------------------------------------------------------------------------- /easybuild/easyblocks/u/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/u/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/v/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/v/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/v/velvet.py: -------------------------------------------------------------------------------- 1 | ## 2 | # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild 3 | # 4 | # Copyright:: Copyright 2012-2025 Uni.Lu/LCSB, NTUA 5 | # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste 6 | # License:: MIT/GPL 7 | # $Id$ 8 | # 9 | # This work implements a part of the HPCBIOS project and is a component of the policy: 10 | # http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-94.html 11 | ## 12 | """ 13 | EasyBuild support for building and installing Velvet, implemented as an easyblock 14 | 15 | @author: Cedric Laczny (Uni.Lu) 16 | @author: Fotis Georgatos (Uni.Lu) 17 | @author: Kenneth Hoste (Ghent University) 18 | """ 19 | import os 20 | import shutil 21 | 22 | from easybuild.easyblocks.generic.configuremake import ConfigureMake 23 | from easybuild.tools.build_log import EasyBuildError 24 | 25 | 26 | class EB_Velvet(ConfigureMake): 27 | """ 28 | Support for building Velvet 29 | """ 30 | 31 | def configure_step(self): 32 | """No configuration.""" 33 | pass 34 | 35 | def install_step(self): 36 | """ 37 | Install by copying files to install dir 38 | """ 39 | srcdir = self.cfg['start_dir'] 40 | destdir = os.path.join(self.installdir, 'bin') 41 | srcfile = None 42 | # Get executable files: 43 | # for i in $(find . -maxdepth 1 -type f -perm +111 -print | sed -e 's/\.\///g' | awk '{print "\""$0"\""}' \ 44 | # | grep -vE "\.sh|\.html"); do 45 | # echo -ne "$i, " 46 | # done && echo 47 | try: 48 | os.makedirs(destdir) 49 | for filename in ["velveth", "velvetg"]: 50 | srcfile = os.path.join(srcdir, filename) 51 | shutil.copy2(srcfile, destdir) 52 | except OSError as err: 53 | raise EasyBuildError("Copying %s to installation dir %s failed: %s", srcfile, destdir, err) 54 | 55 | def sanity_check_step(self): 56 | """Custom sanity check for Velvet.""" 57 | 58 | custom_paths = { 59 | 'files': ['bin/velvetg', 'bin/velveth'], 60 | 'dirs': [] 61 | } 62 | 63 | super().sanity_check_step(custom_paths=custom_paths) 64 | -------------------------------------------------------------------------------- /easybuild/easyblocks/v/vscode.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2012-2025 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 . 24 | ## 25 | """ 26 | EasyBlock for installing VSCode and code-cli, implemented as an easyblock 27 | @author: Alan O'Cais (Juelich Supercomputing Centre) 28 | @author: Alex Domingo (Vrije Universiteit Brussel) 29 | """ 30 | 31 | from easybuild.easyblocks.generic.tarball import Tarball 32 | from easybuild.tools.build_log import EasyBuildError 33 | from easybuild.tools.systemtools import AARCH64, X86_64, get_cpu_architecture 34 | 35 | 36 | class EB_VSCode(Tarball): 37 | """ 38 | Support for installing VSCode and code-cli. 39 | """ 40 | 41 | def __init__(self, *args, **kwargs): 42 | """ Init the easyblock adding a new mapped_arch template var """ 43 | myarch = get_cpu_architecture() 44 | if myarch == X86_64: 45 | self.mapped_arch = 'x64' 46 | elif myarch == AARCH64: 47 | self.mapped_arch = 'arm64' 48 | else: 49 | raise EasyBuildError(f"Architecture {myarch} is not supported for {self.name} on EasyBuild") 50 | 51 | super().__init__(*args, **kwargs) 52 | 53 | self.cfg.template_values['mapped_arch'] = self.mapped_arch 54 | self.cfg.generate_template_values() 55 | 56 | # installation type: supports VSCode (default) and code-cli 57 | self.install_type = 'vscode' 58 | if self.name == 'code-cli': 59 | self.install_type = 'code-cli' 60 | 61 | # location of VSCode executables: 62 | bin_path = { 63 | 'vscode': 'bin', # {installdir}/bin 64 | 'code-cli': '', # {installdir} 65 | } 66 | try: 67 | self.module_load_environment.PATH = bin_path[self.install_type] 68 | except KeyError as err: 69 | raise EasyBuildError(f"Unknown binary location for {self.name} in VSCode easyblock") from err 70 | 71 | def sanity_check_step(self): 72 | """Custom sanity check for VSCode and code-cli.""" 73 | vscode_paths = { 74 | 'vscode': { 75 | 'files': ['bin/code', 'bin/code-tunnel', 'code'], 76 | 'dirs': ['locales', 'resources'], 77 | }, 78 | 'code-cli': { 79 | 'files': ['code'], 80 | 'dirs': [], 81 | }, 82 | } 83 | try: 84 | custom_paths = vscode_paths[self.install_type] 85 | except KeyError as err: 86 | raise EasyBuildError(f"Unknown sanity checks for {self.name} in VSCode easyblock") from err 87 | 88 | custom_commands = ["code --version"] 89 | 90 | return super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) 91 | -------------------------------------------------------------------------------- /easybuild/easyblocks/v/vtune.py: -------------------------------------------------------------------------------- 1 | # # 2 | # Copyright 2013-2025 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 . 24 | # # 25 | """ 26 | EasyBuild support for installing Intel VTune, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | @author: Damian Alvarez (Forschungzentrum Juelich GmbH) 30 | """ 31 | from easybuild.tools import LooseVersion 32 | import os 33 | 34 | from easybuild.easyblocks.generic.intelbase import IntelBase 35 | from easybuild.tools.build_log import EasyBuildError 36 | 37 | 38 | class EB_VTune(IntelBase): 39 | """ 40 | Support for installing Intel VTune 41 | - minimum version suported: 2020.x 42 | """ 43 | 44 | def __init__(self, *args, **kwargs): 45 | """Easyblock constructor; define class variables.""" 46 | super().__init__(*args, **kwargs) 47 | 48 | # recent versions of VTune are installed to a subdirectory 49 | self.subdir = '' 50 | loosever = LooseVersion(self.version) 51 | if loosever < LooseVersion('2020'): 52 | raise EasyBuildError( 53 | f"Version {self.version} of {self.name} is unsupported. Mininum supported version is 2020.0." 54 | ) 55 | 56 | if loosever >= LooseVersion('2024'): 57 | self.subdir = os.path.join('vtune', '.'.join([str(loosever.version[0]), str(loosever.version[1])])) 58 | elif loosever >= LooseVersion('2021'): 59 | self.subdir = os.path.join('vtune', self.version) 60 | elif loosever >= LooseVersion('2020'): 61 | self.subdir = 'vtune_profiler' 62 | 63 | # prepare module load environment 64 | self.prepare_intel_tools_env() 65 | 66 | def prepare_step(self, *args, **kwargs): 67 | """Since 2019u3 there is no license required.""" 68 | kwargs['requires_runtime_license'] = False 69 | super().prepare_step(*args, **kwargs) 70 | 71 | def make_installdir(self): 72 | """Do not create installation directory, install script handles that already.""" 73 | super().make_installdir(dontcreate=True) 74 | 75 | def sanity_check_step(self): 76 | """Custom sanity check paths for VTune.""" 77 | binaries = ['amplxe-feedback', 'amplxe-runss', 'vtune', 'vtune-gui'] 78 | custom_paths = self.get_custom_paths_tools(binaries) 79 | custom_commands = ['vtune --version'] 80 | 81 | super().sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) 82 | -------------------------------------------------------------------------------- /easybuild/easyblocks/w/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/w/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/x/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/x/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/x/xml.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | ## 25 | """ 26 | EasyBuild support for building and installing xml R, implemented as an easyblock 27 | 28 | @author: Kenneth Hoste (Ghent University) 29 | """ 30 | import os 31 | 32 | import easybuild.tools.environment as env 33 | from easybuild.easyblocks.generic.rpackage import RPackage 34 | from easybuild.tools.build_log import EasyBuildError 35 | from easybuild.tools.config import build_option 36 | from easybuild.tools.modules import get_software_root 37 | 38 | 39 | class EB_XML(RPackage): 40 | """Support for installing the XML R package.""" 41 | 42 | def install_R_package(self, *args, **kwargs): 43 | """Customized install procedure for XML R package, add zlib lib path to LIBS.""" 44 | 45 | libs = os.getenv('LIBS', '') 46 | zlib = get_software_root('zlib') 47 | 48 | if zlib: 49 | env.setvar('LIBS', "%s -L%s" % (libs, os.path.join(zlib, 'lib'))) 50 | elif 'zlib' in build_option('filter_deps'): 51 | self.log.info("zlib included in list of filtered dependencies, so no need to tweak $LIBS") 52 | else: 53 | raise EasyBuildError("zlib module not loaded (required)") 54 | 55 | return super().install_R_package(*args, **kwargs) 56 | -------------------------------------------------------------------------------- /easybuild/easyblocks/y/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/y/__init__.py -------------------------------------------------------------------------------- /easybuild/easyblocks/z/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/easybuild/easyblocks/z/__init__.py -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [bdist_rpm] 2 | requires = easybuild-config 3 | 4 | [easy_install] 5 | 6 | [flake8] 7 | max-line-length = 120 8 | 9 | # Hound CI runs with Python 3 (no way around it), 10 | # so we need to specify some Python 2 builtins to avoid that it complains about them 11 | # cfr. https://stackoverflow.com/questions/47427916/how-to-config-hound-ci-to-support-python2-7 12 | builtins = 13 | basestring, 14 | reduce 15 | 16 | # ignore "Black would make changes" produced by flake8-black 17 | # see also https://github.com/houndci/hound/issues/1769 18 | extend-ignore = BLK100 19 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2012-2025 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 . 24 | ## 25 | 26 | """ 27 | This script can be used to install easybuild-easyblocks, e.g. using: 28 | easy_install --user . 29 | or 30 | python setup.py --prefix=$HOME/easybuild 31 | 32 | @author: Kenneth Hoste (Ghent University) 33 | """ 34 | 35 | import os 36 | import sys 37 | from distutils import log 38 | from distutils.core import setup 39 | 40 | sys.path.append('easybuild') 41 | from easyblocks import VERSION # noqa 42 | 43 | FRAMEWORK_MAJVER = VERSION.split('.')[0] 44 | 45 | # log levels: 0=WARN (default), 1=INFO, 2=DEBUG 46 | log.set_verbosity(1) 47 | 48 | 49 | # Utility function to read README file 50 | def read(fname): 51 | return open(os.path.join(os.path.dirname(__file__), fname)).read() 52 | 53 | 54 | log.info("Installing version %s (required versions: API >= %s)" % (VERSION, FRAMEWORK_MAJVER)) 55 | 56 | setup( 57 | name="easybuild-easyblocks", 58 | version=VERSION, 59 | author="EasyBuild community", 60 | author_email="easybuild@lists.ugent.be", 61 | description="""Python modules which implement support for installing particular \ 62 | (groups of) software packages with EasyBuild.""", 63 | license="GPLv2", 64 | keywords="software build building installation installing compilation HPC scientific", 65 | url="https://easybuild.io", 66 | packages=["easybuild", "easybuild.easyblocks", "easybuild.easyblocks.generic"], 67 | package_dir={"easybuild.easyblocks": "easybuild/easyblocks"}, 68 | package_data={'easybuild.easyblocks': ["[a-z0-9]/*.py"]}, 69 | long_description=read("README.rst"), 70 | classifiers=[ 71 | "Development Status :: 5 - Production/Stable", 72 | "Environment :: Console", 73 | "Intended Audience :: System Administrators", 74 | "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", 75 | "Operating System :: POSIX :: Linux", 76 | "Programming Language :: Python :: 3.6", 77 | "Programming Language :: Python :: 3.7", 78 | "Programming Language :: Python :: 3.8", 79 | "Programming Language :: Python :: 3.9", 80 | "Programming Language :: Python :: 3.10", 81 | "Programming Language :: Python :: 3.11", 82 | "Programming Language :: Python :: 3.12", 83 | "Programming Language :: Python :: 3.13", 84 | "Topic :: Software Development :: Build Tools", 85 | ], 86 | platforms="Linux", 87 | requires=["easybuild_framework(>=%s.0)" % FRAMEWORK_MAJVER], 88 | ) 89 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2025 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 . 24 | # # 25 | """ 26 | Unit tests. 27 | 28 | @author: Stijn De Weirdt (Ghent University) 29 | @author: Dries Verdegem (Ghent University) 30 | @author: Kenneth Hoste (Ghent University) 31 | @author: Pieter De Baets (Ghent University) 32 | @author: Jens Timmerman (Ghent University) 33 | @author: Toon Willems (Ghent University) 34 | """ 35 | from pkgutil import extend_path 36 | 37 | # we're not the only ones in this namespace 38 | __path__ = extend_path(__path__, __name__) # @ReservedAssignment 39 | -------------------------------------------------------------------------------- /test/easyblocks/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easybuilders/easybuild-easyblocks/0f4157641cd21688f48532cd75153ebe65aecb92/test/easyblocks/__init__.py -------------------------------------------------------------------------------- /test/easyblocks/suite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | ## 3 | # Copyright 2012-2025 Ghent University 4 | # 5 | # This file is part of EasyBuild, 6 | # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), 7 | # with support of Ghent University (http://ugent.be/hpc), 8 | # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), 9 | # Flemish Research Foundation (FWO) (http://www.fwo.be/en) 10 | # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). 11 | # 12 | # https://github.com/easybuilders/easybuild 13 | # 14 | # EasyBuild is free software: you can redistribute it and/or modify 15 | # it under the terms of the GNU General Public License as published by 16 | # the Free Software Foundation v2. 17 | # 18 | # EasyBuild is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | # GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with EasyBuild. If not, see . 25 | ## 26 | """ 27 | This script is a collection of all the testcases for easybuild-easyblocks. 28 | Usage: "python -m test.easyblocks.suite" or "python test/easyblocks/suite.py" 29 | 30 | @author: Toon Willems (Ghent University) 31 | @author: Kenneth Hoste (Ghent University) 32 | """ 33 | import glob 34 | import os 35 | import shutil 36 | import sys 37 | import tempfile 38 | import unittest 39 | 40 | from easybuild.base import fancylogger 41 | from easybuild.tools.build_log import EasyBuildError 42 | from easybuild.tools.options import set_tmpdir 43 | 44 | import test.easyblocks.easyblock_specific as e 45 | import test.easyblocks.general as g 46 | import test.easyblocks.init_easyblocks as i 47 | import test.easyblocks.module as m 48 | 49 | # initialize logger for all the unit tests 50 | fd, log_fn = tempfile.mkstemp(prefix='easybuild-easyblocks-tests-', suffix='.log') 51 | os.close(fd) 52 | os.remove(log_fn) 53 | fancylogger.logToFile(log_fn) 54 | log = fancylogger.getLogger() 55 | log.setLevelName('DEBUG') 56 | 57 | try: 58 | tmpdir = set_tmpdir(raise_error=True) 59 | except EasyBuildError as err: 60 | sys.stderr.write("No execution rights on temporary files, specify another location via $TMPDIR: %s\n" % err) 61 | sys.exit(1) 62 | 63 | os.environ['EASYBUILD_TMP_LOGDIR'] = tempfile.mkdtemp(prefix='easyblocks_test_') 64 | 65 | # call suite() for each module and then run them all 66 | SUITE = unittest.TestSuite([x.suite() for x in [g, i, m, e]]) 67 | res = unittest.TextTestRunner().run(SUITE) 68 | 69 | fancylogger.logToFile(log_fn, enable=False) 70 | shutil.rmtree(os.environ['EASYBUILD_TMP_LOGDIR']) 71 | del os.environ['EASYBUILD_TMP_LOGDIR'] 72 | 73 | if not res.wasSuccessful(): 74 | sys.stderr.write("ERROR: Not all tests were successful.\n") 75 | print("Log available at %s" % log_fn) 76 | sys.exit(2) 77 | else: 78 | for f in glob.glob('%s*' % log_fn): 79 | os.remove(f) 80 | shutil.rmtree(tmpdir) 81 | --------------------------------------------------------------------------------