diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 6dfb5b5672..528e94e069 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -3,7 +3,57 @@ For more detailed information, please see the git log. These release notes can also be consulted at http://easybuild.readthedocs.org/en/latest/Release_notes.html. -The latest version of easybuild-easyblocks provides 254 software-specific easyblocks and 43 generic easyblocks. +The latest version of easybuild-easyblocks provides 255 software-specific easyblocks and 43 generic easyblocks. + + +v4.9.1 (5 April 2024) +--------------------- + +update/bugfix release + +- 1 new software-specific easyblock: DualSPHysics (#3050) +- minor enhancements and updates, including: + - use proxy in sanity check of custom easyblock to install OpenSSL wrapper (#2922) + - update Clang-AOMP easyblock for ROCm 5.6 (#2958) + - consider both `$EBROOTGCC` and `$EBROOTGCCCORE` in Clang-AOMP easyblock to specify `-DGCC_INSTALL_PREFIX` (#2958) + - update WIEN2k easyblock for v23.2 (#3035) + - enhance LAMMPS easyblock dynamically add `ARMV81` and `A64FX` to Kokkos CPU mapping based on LAMMPS version (#3036) + - add `pip_verbose` option to PythonPackage and set it to True in PyTorch easyblock, to show build output when using pip (#3065) + - also support OpenSSL 3 in OpenSSL wrapper easyblock (#3081) + - improve error checking in PyTorch easyblock (#3085) + - update MCR easyblock for compatibility with versions >= R2022b (#3119) + - add `species` easyconfig parameter to VEP easyblock (#3121) + - only install Gurobi Python bindings via `setup.py` for Gurobi v10.x and older (#3225) + - consistently honor `pretestopts` & `testopts` in `PerlModule` (#3231) + - fix OCaml easyblock for recent versions (#3235) + - improve QuantumESPRESSO easyblock by cleaning up and extending configure step + running test suite (#3241, #3258) + - allow overriding `testinstall` in PyTorch easyconfigs (#3250) + - enhance GCC easyblock to set `$LIBRARY_PATH` and disable building of NVPTX offload support on RISC-V systems (#3256) + - add support for conda provided by Miniforge (#3260) + - set `$GOPATH` in configure step of `GoPackage` easyblock to avoid polluting `$HOME/go` (#3262) +- various bug fixes, including: + - set `$BGW_TEST_MPI_NPROCS` in BerkeleyGW test step (#2950) + - fix installation of Python bindings for LAMMPS >= 2Aug2023 + fix sanity check by doing MPI_Finalize (#3036) + - fix ELPA preprocessor flag for QuantumESPRESSO >= 7 (#3063) + - fix link order in PETSc easyblock for SCOTCH >= 7.x (#3069) + - update PyTorch easyblock to avoid configure warnings by disabling some options (#3070) + - pick Tcl/Tk lib directory correctly in R easyblock, may be either `lib` or `lib64` (#3072) + - use `(=|:=)` in regex because OpenFOAM rule files use `:=` instead of `=` since v2212 (#3073) + - add Clang `opt` binary to RPATH wrapper dir (#3076) + - improve `generate_crate_list` + parsing of crates in `Cargo` easyblock (#3084) + - remove trailing slash in `PETSC_DIR` set by custom easyblock for PETSc (#3086) + - use correct TCL configure options for Python 3.11+ (#3087) + - tweak `CMakeMake` easyblock to apply CMake policy to select `python` based on `$PATH` order, instead of highest version (#3088) + - update `Cargo` easyblock to extract crates into a vendor subdir and overwrite git repo URLs with local paths (#3118) + - only add `--with-ucc` for OpenMPI 4.1.4+ (#3223) + - remove trailing slash in `SLEPC_DIR` in configure step of custom easyblock for SLEPc (#3229) + - fix OpenFOAM easyblock to fix `motorBike` example in sanity check for versions >=11 (#3232) + - only run CUDA sanity check command for torchvision if GPU is present (#3236) + - ensure localrc is created in the correct subdir for NVHPC v22.9+ (#3240) + - remove wrong configure option for LibInt 2.6.x (#3249) + - do not rename GCC's include-fixed directory by default + add script to regenerate it (#3254) +- other changes: + - update copyright lines to 2024 (#3268) v4.9.0 (30 December 2023) diff --git a/easybuild/__init__.py b/easybuild/__init__.py index 62a579f2dd..8d496189c3 100644 --- a/easybuild/__init__.py +++ b/easybuild/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/__init__.py b/easybuild/easyblocks/__init__.py index 80b10f5187..a1f69a95f6 100644 --- a/easybuild/easyblocks/__init__.py +++ b/easybuild/easyblocks/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -43,7 +43,7 @@ # recent setuptools versions will *TRANSFORM* something like 'X.Y.Zdev' into 'X.Y.Z.dev0', with a warning like # UserWarning: Normalizing '2.4.0dev' to '2.4.0.dev0' # This causes problems further up the dependency chain... -VERSION = LooseVersion('4.9.0') +VERSION = LooseVersion('4.9.1') UNKNOWN = 'UNKNOWN' diff --git a/easybuild/easyblocks/a/abaqus.py b/easybuild/easyblocks/a/abaqus.py index 371a1b2b42..fc614ab7e8 100644 --- a/easybuild/easyblocks/a/abaqus.py +++ b/easybuild/easyblocks/a/abaqus.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/acml.py b/easybuild/easyblocks/a/acml.py index 5d82316dc5..296c49003e 100644 --- a/easybuild/easyblocks/a/acml.py +++ b/easybuild/easyblocks/a/acml.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/adf.py b/easybuild/easyblocks/a/adf.py index b3e4f9166e..cc96cb86b4 100644 --- a/easybuild/easyblocks/a/adf.py +++ b/easybuild/easyblocks/a/adf.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/advisor.py b/easybuild/easyblocks/a/advisor.py index 45bced4c0a..2f24500b20 100644 --- a/easybuild/easyblocks/a/advisor.py +++ b/easybuild/easyblocks/a/advisor.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/aladin.py b/easybuild/easyblocks/a/aladin.py index aa248b831b..79454792fe 100644 --- a/easybuild/easyblocks/a/aladin.py +++ b/easybuild/easyblocks/a/aladin.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/allinea.py b/easybuild/easyblocks/a/allinea.py index e15d9bc3b2..026b2f58d9 100644 --- a/easybuild/easyblocks/a/allinea.py +++ b/easybuild/easyblocks/a/allinea.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/amber.py b/easybuild/easyblocks/a/amber.py index ca626883db..a306211086 100644 --- a/easybuild/easyblocks/a/amber.py +++ b/easybuild/easyblocks/a/amber.py @@ -1,6 +1,6 @@ ## -# Copyright 2009-2023 Ghent University -# Copyright 2015-2023 Stanford University +# Copyright 2009-2024 Ghent University +# Copyright 2015-2024 Stanford University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/anaconda.py b/easybuild/easyblocks/a/anaconda.py index a792c5e498..0ac18f1b20 100644 --- a/easybuild/easyblocks/a/anaconda.py +++ b/easybuild/easyblocks/a/anaconda.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/ansys.py b/easybuild/easyblocks/a/ansys.py index 6e68fad40b..9cddf8be27 100644 --- a/easybuild/easyblocks/a/ansys.py +++ b/easybuild/easyblocks/a/ansys.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/ant.py b/easybuild/easyblocks/a/ant.py index a345118490..cb6757e663 100644 --- a/easybuild/easyblocks/a/ant.py +++ b/easybuild/easyblocks/a/ant.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/aocc.py b/easybuild/easyblocks/a/aocc.py index aff71ee1b0..ff33673afb 100644 --- a/easybuild/easyblocks/a/aocc.py +++ b/easybuild/easyblocks/a/aocc.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Forschungszentrum Juelich GmbH +# Copyright 2020-2024 Forschungszentrum Juelich GmbH # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/easyblocks/a/aomp.py b/easybuild/easyblocks/a/aomp.py index 7ff4126d6d..e44b6f06ab 100644 --- a/easybuild/easyblocks/a/aomp.py +++ b/easybuild/easyblocks/a/aomp.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/arb.py b/easybuild/easyblocks/a/arb.py index 3d184d88bf..37cc7a6ce1 100644 --- a/easybuild/easyblocks/a/arb.py +++ b/easybuild/easyblocks/a/arb.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/armadillo.py b/easybuild/easyblocks/a/armadillo.py index 27415f3441..f588137257 100644 --- a/easybuild/easyblocks/a/armadillo.py +++ b/easybuild/easyblocks/a/armadillo.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/a/atlas.py b/easybuild/easyblocks/a/atlas.py index 2956e30636..8a0ef0ad69 100644 --- a/easybuild/easyblocks/a/atlas.py +++ b/easybuild/easyblocks/a/atlas.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bamtools.py b/easybuild/easyblocks/b/bamtools.py index 1938ce4c6a..e9c678b954 100644 --- a/easybuild/easyblocks/b/bamtools.py +++ b/easybuild/easyblocks/b/bamtools.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 The Cyprus Institute +# Copyright 2009-2024 The Cyprus Institute # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bazel.py b/easybuild/easyblocks/b/bazel.py index 97a013c8fb..55c686bc97 100644 --- a/easybuild/easyblocks/b/bazel.py +++ b/easybuild/easyblocks/b/bazel.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/berkeleygw.py b/easybuild/easyblocks/b/berkeleygw.py index b5b2e1f28b..8bb5781890 100644 --- a/easybuild/easyblocks/b/berkeleygw.py +++ b/easybuild/easyblocks/b/berkeleygw.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -177,7 +177,8 @@ def test_step(self): """Custom test step for BerkeleyGW.""" if self.cfg['runtest'] is not False: self.cfg['runtest'] = 'check' - setvar('OMP_NUM_THREADS', '4') + setvar('BGW_TEST_MPI_NPROCS', '2') + setvar('OMP_NUM_THREADS', '2') setvar('TEMPDIRPATH', os.path.join(self.builddir, 'tmp')) super(EB_BerkeleyGW, self).test_step() diff --git a/easybuild/easyblocks/b/binutils.py b/easybuild/easyblocks/b/binutils.py index 3985595288..3ea76ae47a 100644 --- a/easybuild/easyblocks/b/binutils.py +++ b/easybuild/easyblocks/b/binutils.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bioconductor.py b/easybuild/easyblocks/b/bioconductor.py index c343d75773..acacb2e8c9 100644 --- a/easybuild/easyblocks/b/bioconductor.py +++ b/easybuild/easyblocks/b/bioconductor.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bisearch.py b/easybuild/easyblocks/b/bisearch.py index 975f5c391f..5c9ec28a9d 100644 --- a/easybuild/easyblocks/b/bisearch.py +++ b/easybuild/easyblocks/b/bisearch.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/blacs.py b/easybuild/easyblocks/b/blacs.py index a600c5285c..482de07401 100644 --- a/easybuild/easyblocks/b/blacs.py +++ b/easybuild/easyblocks/b/blacs.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/blat.py b/easybuild/easyblocks/b/blat.py index 53d01c2b8f..bfdfc8fb0d 100755 --- a/easybuild/easyblocks/b/blat.py +++ b/easybuild/easyblocks/b/blat.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 the Cyprus Institute +# Copyright 2009-2024 the Cyprus Institute # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/blender.py b/easybuild/easyblocks/b/blender.py index 500b65a0e6..2abf715f48 100644 --- a/easybuild/easyblocks/b/blender.py +++ b/easybuild/easyblocks/b/blender.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/boost.py b/easybuild/easyblocks/b/boost.py index 7cb4bd7f03..7b88dd93e9 100644 --- a/easybuild/easyblocks/b/boost.py +++ b/easybuild/easyblocks/b/boost.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bowtie.py b/easybuild/easyblocks/b/bowtie.py index 899019b35b..119cb47ed0 100644 --- a/easybuild/easyblocks/b/bowtie.py +++ b/easybuild/easyblocks/b/bowtie.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bowtie2.py b/easybuild/easyblocks/b/bowtie2.py index 5d0821a6ed..f768ac481d 100644 --- a/easybuild/easyblocks/b/bowtie2.py +++ b/easybuild/easyblocks/b/bowtie2.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/b/bwa.py b/easybuild/easyblocks/b/bwa.py index 587dd03125..55bd60804f 100644 --- a/easybuild/easyblocks/b/bwa.py +++ b/easybuild/easyblocks/b/bwa.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Kenneth Hoste # Authors:: George Tsouloupas , Fotis Georgatos # License:: MIT/GPL diff --git a/easybuild/easyblocks/b/bwise.py b/easybuild/easyblocks/b/bwise.py index 723805ccaf..3e9b3d34e6 100644 --- a/easybuild/easyblocks/b/bwise.py +++ b/easybuild/easyblocks/b/bwise.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Free University of Brussels +# Copyright 2018-2024 Free University of Brussels # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/b/bzip2.py b/easybuild/easyblocks/b/bzip2.py index 5c5d34b8da..aa5e598e93 100644 --- a/easybuild/easyblocks/b/bzip2.py +++ b/easybuild/easyblocks/b/bzip2.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cblas.py b/easybuild/easyblocks/c/cblas.py index 14b1364b74..4a1ca2f349 100644 --- a/easybuild/easyblocks/c/cblas.py +++ b/easybuild/easyblocks/c/cblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cfdemcoupling.py b/easybuild/easyblocks/c/cfdemcoupling.py index 2264ffdeb3..4bb0fd85a5 100644 --- a/easybuild/easyblocks/c/cfdemcoupling.py +++ b/easybuild/easyblocks/c/cfdemcoupling.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cgal.py b/easybuild/easyblocks/c/cgal.py index 0d69d0543d..431b843b50 100644 --- a/easybuild/easyblocks/c/cgal.py +++ b/easybuild/easyblocks/c/cgal.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/chapel.py b/easybuild/easyblocks/c/chapel.py index fc7ddebfb7..2386f5b7db 100644 --- a/easybuild/easyblocks/c/chapel.py +++ b/easybuild/easyblocks/c/chapel.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/c/charmm.py b/easybuild/easyblocks/c/charmm.py index 6c92cae548..6b4791e30b 100644 --- a/easybuild/easyblocks/c/charmm.py +++ b/easybuild/easyblocks/c/charmm.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/clang.py b/easybuild/easyblocks/c/clang.py index 3423e1c96b..b945553969 100644 --- a/easybuild/easyblocks/c/clang.py +++ b/easybuild/easyblocks/c/clang.py @@ -1,6 +1,6 @@ ## -# Copyright 2013-2023 Dmitri Gribenko -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Dmitri Gribenko +# Copyright 2013-2024 Ghent University # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. @@ -46,7 +46,7 @@ from easybuild.tools import run from easybuild.tools.build_log import EasyBuildError, print_warning from easybuild.tools.config import build_option -from easybuild.tools.filetools import apply_regex_substitutions, change_dir, mkdir, which +from easybuild.tools.filetools import apply_regex_substitutions, change_dir, mkdir, symlink, which from easybuild.tools.modules import get_software_root from easybuild.tools.run import run_cmd from easybuild.tools.systemtools import AARCH32, AARCH64, POWER, X86_64 @@ -505,6 +505,11 @@ def build_with_prev_stage(self, prev_obj, next_obj): my_clang_toolchain.prepare_rpath_wrappers() self.log.info("Prepared clang rpath wrappers") + # add symlink for 'opt' to wrapper dir, since Clang expects it in the same directory + # see https://github.com/easybuilders/easybuild-easyblocks/issues/3075 + clang_wrapper_dir = os.path.dirname(which('clang')) + symlink(os.path.join(prev_obj_path, 'opt'), os.path.join(clang_wrapper_dir, 'opt')) + # RPATH wrappers add -Wl,rpath arguments to all command lines, including when it is just compiling # Clang by default warns about that, and then some configure tests use -Werror which turns those warnings # into errors. As a result, those configure tests fail, even though the compiler supports the requested diff --git a/easybuild/easyblocks/c/clang_aomp.py b/easybuild/easyblocks/c/clang_aomp.py index 3a1a2081cf..6f046cdb28 100644 --- a/easybuild/easyblocks/c/clang_aomp.py +++ b/easybuild/easyblocks/c/clang_aomp.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -177,7 +177,9 @@ def sanity_check_step(self): for gfx in self.amd_gfx_archs: if LooseVersion(self.version) < LooseVersion("5.2"): custom_paths['files'].extend([os.path.join(libdevice, 'lib%s-amdgcn-%s.bc' % (x, gfx)) for x in libs]) - if LooseVersion(self.version) >= LooseVersion("5"): + if LooseVersion(self.version) >= LooseVersion("5.6"): + custom_paths['files'].append(os.path.join('lib', 'libomptarget-old-amdgpu-%s.bc' % gfx)) + elif LooseVersion(self.version) >= LooseVersion("5"): custom_paths['files'].append(os.path.join('lib', 'libomptarget-amdgcn-%s.bc' % gfx)) custom_paths['files'].append(os.path.join('lib', 'libomptarget-new-amdgpu-%s.bc' % gfx)) @@ -226,11 +228,14 @@ def _configure_llvm(self, component): # dependency and interrupts building of LLVM component['prebuildopts'] = "unset CPATH && " + projects = ['clang', 'lld', 'clang-tools-extra', 'compiler-rt'] + runtimes = ['libcxx', 'libcxxabi'] # Setup configuration options for LLVM component['configopts'] = ' '.join([ - "-DLLVM_ENABLE_PROJECTS='clang;lld;compiler-rt'", + "-DLLVM_ENABLE_PROJECTS='%s'" % ';'.join(projects), + "-DLLVM_ENABLE_RUNTIMES='%s'" % ';'.join(runtimes), "-DCLANG_DEFAULT_LINKER=lld", - "-DGCC_INSTALL_PREFIX=$EBROOTGCC", + "-DGCC_INSTALL_PREFIX=%s" % os.getenv('EBROOTGCC', os.getenv('EBROOTGCCCORE')), "-DLLVM_ENABLE_ASSERTIONS=ON", "-DLLVM_ENABLE_BINDINGS=OFF", "-DLLVM_INCLUDE_BENCHMARKS=OFF", diff --git a/easybuild/easyblocks/c/cmake.py b/easybuild/easyblocks/c/cmake.py index 42dadd996c..c17750ae45 100644 --- a/easybuild/easyblocks/c/cmake.py +++ b/easybuild/easyblocks/c/cmake.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Alexander Grund +# Copyright 2020-2024 Alexander Grund # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/code_server.py b/easybuild/easyblocks/c/code_server.py index b975340bf8..d8ae7276cc 100644 --- a/easybuild/easyblocks/c/code_server.py +++ b/easybuild/easyblocks/c/code_server.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/comsol.py b/easybuild/easyblocks/c/comsol.py index dd69c2dac3..d38dd75d64 100644 --- a/easybuild/easyblocks/c/comsol.py +++ b/easybuild/easyblocks/c/comsol.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cp2k.py b/easybuild/easyblocks/c/cp2k.py index aa2ad4a93f..1a0f109878 100644 --- a/easybuild/easyblocks/c/cp2k.py +++ b/easybuild/easyblocks/c/cp2k.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cplex.py b/easybuild/easyblocks/c/cplex.py index 9c4a894a4e..286683bad9 100644 --- a/easybuild/easyblocks/c/cplex.py +++ b/easybuild/easyblocks/c/cplex.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cppcheck.py b/easybuild/easyblocks/c/cppcheck.py index ec43ceda09..3fec7d84ad 100644 --- a/easybuild/easyblocks/c/cppcheck.py +++ b/easybuild/easyblocks/c/cppcheck.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Forschungszentrum Juelich GmbH +# Copyright 2016-2024 Forschungszentrum Juelich GmbH # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/crispr_dav.py b/easybuild/easyblocks/c/crispr_dav.py index b528fd1056..e85da91da2 100644 --- a/easybuild/easyblocks/c/crispr_dav.py +++ b/easybuild/easyblocks/c/crispr_dav.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cryptography.py b/easybuild/easyblocks/c/cryptography.py index ac0d4c68d1..12cee79111 100644 --- a/easybuild/easyblocks/c/cryptography.py +++ b/easybuild/easyblocks/c/cryptography.py @@ -1,5 +1,5 @@ ## -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py index dbc30cf4a7..46b3c58854 100644 --- a/easybuild/easyblocks/c/cuda.py +++ b/easybuild/easyblocks/c/cuda.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cudacompat.py b/easybuild/easyblocks/c/cudacompat.py index ef72014175..1013b57137 100644 --- a/easybuild/easyblocks/c/cudacompat.py +++ b/easybuild/easyblocks/c/cudacompat.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cudnn.py b/easybuild/easyblocks/c/cudnn.py index d22834985d..9c1b3557b7 100644 --- a/easybuild/easyblocks/c/cudnn.py +++ b/easybuild/easyblocks/c/cudnn.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/c/cufflinks.py b/easybuild/easyblocks/c/cufflinks.py index 62f2cb7bf2..c6753a07d2 100644 --- a/easybuild/easyblocks/c/cufflinks.py +++ b/easybuild/easyblocks/c/cufflinks.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/d/db.py b/easybuild/easyblocks/d/db.py index 065df60a14..b4d1e01590 100644 --- a/easybuild/easyblocks/d/db.py +++ b/easybuild/easyblocks/d/db.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/dl_poly_classic.py b/easybuild/easyblocks/d/dl_poly_classic.py index 823df870b9..991b32e042 100644 --- a/easybuild/easyblocks/d/dl_poly_classic.py +++ b/easybuild/easyblocks/d/dl_poly_classic.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/dm_reverb.py b/easybuild/easyblocks/d/dm_reverb.py index 802edca1d2..104d1c8841 100644 --- a/easybuild/easyblocks/d/dm_reverb.py +++ b/easybuild/easyblocks/d/dm_reverb.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/dolfin.py b/easybuild/easyblocks/d/dolfin.py index 086fdff170..955fcb52ee 100644 --- a/easybuild/easyblocks/d/dolfin.py +++ b/easybuild/easyblocks/d/dolfin.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/doris.py b/easybuild/easyblocks/d/doris.py index cac0909ba1..c0de79b461 100644 --- a/easybuild/easyblocks/d/doris.py +++ b/easybuild/easyblocks/d/doris.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/doxygen.py b/easybuild/easyblocks/d/doxygen.py index 498e4f920b..9fa4fdde32 100644 --- a/easybuild/easyblocks/d/doxygen.py +++ b/easybuild/easyblocks/d/doxygen.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/d/dualsphysics.py b/easybuild/easyblocks/d/dualsphysics.py new file mode 100644 index 0000000000..fd1b923c29 --- /dev/null +++ b/easybuild/easyblocks/d/dualsphysics.py @@ -0,0 +1,147 @@ +## +# Copyright 2013-2024 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +EasyBuild support for building and installing DualSPHysics, implemented as an easyblock + +@author: Jasper Grimm (University of York) +""" +import glob +import os +import stat + +from easybuild.easyblocks.generic.cmakemakecp import CMakeMakeCp +from easybuild.framework.easyconfig import CUSTOM +from easybuild.tools.build_log import EasyBuildError +from easybuild.tools.config import build_option +from easybuild.tools.filetools import adjust_permissions +from easybuild.tools.modules import get_software_root +from easybuild.tools.run import run_cmd + + +class EB_DualSPHysics(CMakeMakeCp): + """Support for building/installing DualSPHysics.""" + + @staticmethod + def extra_options(): + """Extra easyconfig parameters for DualSPHysics.""" + extra_vars = CMakeMakeCp.extra_options() + + extra_vars['separate_build_dir'][0] = True + + # files_to_copy is not mandatory here since we set it in the easyblock + extra_vars['files_to_copy'][2] = CUSTOM + return extra_vars + + def __init__(self, *args, **kwargs): + """Initialize calss variables custom to DualSPHysics.""" + super(EB_DualSPHysics, self).__init__(*args, **kwargs) + + self.dsph_target = None + self.shortver = '.'.join(self.version.split('.')[0:2]) + + def prepare_step(self, *args, **kwargs): + """Determine name of binary that will be installed.""" + super(EB_DualSPHysics, self).prepare_step(*args, **kwargs) + + if get_software_root('CUDA'): + self.dsph_target = 'GPU' + else: + self.dsph_target = 'CPU' + + def configure_step(self): + """Custom configure procedure for DualSPHysics.""" + srcdir = os.path.join(self.cfg['start_dir'], 'src/source') + super(EB_DualSPHysics, self).configure_step(srcdir=srcdir) + + def install_step(self): + """Custom install procedure for DualSPHysics.""" + # *_linux64 binaries are missing execute permissions + bindir = os.path.join(self.cfg['start_dir'], 'bin', 'linux') + for b in glob.glob(os.path.join(bindir, '*_linux64')): + perms = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH + adjust_permissions(b, perms, add=True) + + # no `make install` target + self.cfg['files_to_copy'] = [ + (['bin/linux/*'], 'bin'), + (['src/lib/linux_gcc/*'], 'lib'), + ] + super(EB_DualSPHysics, self).install_step() + + def post_install_step(self): + """Custom post-installation step: ensure rpath is patched into binaries/libraries if configured.""" + super(EB_DualSPHysics, self).post_install_step() + + if build_option('rpath'): + # only the compiled binary (e.g. DualSPHysics5.0CPU_linux64) is rpath'd, the precompiled libraries + # and binaries are not + # simple solution: copy the RPATH from the compiled binary to the others, then strip excess paths + rpathed_bin = os.path.join( + self.installdir, 'bin', 'DualSPHysics%s%s_linux64' % (self.shortver, self.dsph_target) + ) + + out, _ = run_cmd("patchelf --print-rpath %s" % rpathed_bin, simple=False, trace=False) + comp_rpath = out.strip() + + files_to_patch = [] + for x in [('bin', '*_linux64'), ('bin', '*.so'), ('lib', '*.so')]: + files_to_patch.extend(glob.glob(os.path.join(self.installdir, *x))) + + try: + for x in files_to_patch: + out, _ = run_cmd("patchelf --print-rpath %s" % x, trace=False) + self.log.debug("Original RPATH for %s: %s" % (out, x)) + + run_cmd("patchelf --set-rpath '%s' --force-rpath %s" % (comp_rpath, x), trace=False) + run_cmd("patchelf --shrink-rpath --force-rpath %s" % x, trace=False) + + out, _ = run_cmd("patchelf --print-rpath %s" % x, trace=False) + self.log.debug("RPATH for %s (after patching and shrinking): %s" % (out, x)) + + except OSError as err: + raise EasyBuildError("Failed to patch RPATH section in binaries/libraries: %s", err) + + def sanity_check_step(self): + """Custom sanity checks for DualSPHysics.""" + + # repeated here in case other steps are skipped (e.g. due to --sanity-check-only) + if get_software_root('CUDA'): + self.dsph_target = 'GPU' + else: + self.dsph_target = 'CPU' + + bins = ['GenCase', 'PartVTK', 'IsoSurface', 'MeasureTool', 'GenCase_MkWord', 'DualSPHysics4.0_LiquidGas', + 'DualSPHysics4.0_LiquidGasCPU', 'DualSPHysics%s' % self.shortver, + 'DualSPHysics%s%s' % (self.shortver, self.dsph_target), 'DualSPHysics%s_NNewtonian' % self.shortver, + 'DualSPHysics%s_NNewtonianCPU' % self.shortver] + + custom_paths = { + 'files': ['bin/%s_linux64' % x for x in bins], + 'dirs': ['lib'], + } + + custom_commands = ['%s_linux64 -h' % x for x in bins] + + super(EB_DualSPHysics, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) diff --git a/easybuild/easyblocks/e/easybuildmeta.py b/easybuild/easyblocks/e/easybuildmeta.py index 73e1115fae..990f177478 100644 --- a/easybuild/easyblocks/e/easybuildmeta.py +++ b/easybuild/easyblocks/e/easybuildmeta.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/egglib.py b/easybuild/easyblocks/e/egglib.py index f4aa262042..17916ec410 100644 --- a/easybuild/easyblocks/e/egglib.py +++ b/easybuild/easyblocks/e/egglib.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/eigen.py b/easybuild/easyblocks/e/eigen.py index 70205c5ee0..ed92ee2c14 100644 --- a/easybuild/easyblocks/e/eigen.py +++ b/easybuild/easyblocks/e/eigen.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/e/elpa.py b/easybuild/easyblocks/e/elpa.py index 44acaf507b..f2fd2be700 100644 --- a/easybuild/easyblocks/e/elpa.py +++ b/easybuild/easyblocks/e/elpa.py @@ -1,6 +1,6 @@ ## -# Copyright 2009-2023 Ghent University -# Copyright 2019-2023 Micael Oliveira +# Copyright 2009-2024 Ghent University +# Copyright 2019-2024 Micael Oliveira # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/elsi.py b/easybuild/easyblocks/e/elsi.py index e3e26dea00..053ec3698d 100644 --- a/easybuild/easyblocks/e/elsi.py +++ b/easybuild/easyblocks/e/elsi.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/epd.py b/easybuild/easyblocks/e/epd.py index 26e2610fdb..d3dbfc8e65 100644 --- a/easybuild/easyblocks/e/epd.py +++ b/easybuild/easyblocks/e/epd.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/esmf.py b/easybuild/easyblocks/e/esmf.py index 676be44e44..c29fa207e2 100644 --- a/easybuild/easyblocks/e/esmf.py +++ b/easybuild/easyblocks/e/esmf.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/e/espresso.py b/easybuild/easyblocks/e/espresso.py index 3d1795fe41..7665663a6c 100644 --- a/easybuild/easyblocks/e/espresso.py +++ b/easybuild/easyblocks/e/espresso.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Josh Berryman , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/e/extrae.py b/easybuild/easyblocks/e/extrae.py index fcb10677a1..557ebc7785 100644 --- a/easybuild/easyblocks/e/extrae.py +++ b/easybuild/easyblocks/e/extrae.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/faststructure.py b/easybuild/easyblocks/f/faststructure.py index 5504335056..922d12e0df 100644 --- a/easybuild/easyblocks/f/faststructure.py +++ b/easybuild/easyblocks/f/faststructure.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/fdtd_solutions.py b/easybuild/easyblocks/f/fdtd_solutions.py index 4e044d2788..bacaf32144 100644 --- a/easybuild/easyblocks/f/fdtd_solutions.py +++ b/easybuild/easyblocks/f/fdtd_solutions.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/ferret.py b/easybuild/easyblocks/f/ferret.py index 1b692b485f..9df9958e7f 100644 --- a/easybuild/easyblocks/f/ferret.py +++ b/easybuild/easyblocks/f/ferret.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/fftw.py b/easybuild/easyblocks/f/fftw.py index aa30f3bf06..ff3788a4e2 100644 --- a/easybuild/easyblocks/f/fftw.py +++ b/easybuild/easyblocks/f/fftw.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/fftwmpi.py b/easybuild/easyblocks/f/fftwmpi.py index 3736362493..cb285a576b 100644 --- a/easybuild/easyblocks/f/fftwmpi.py +++ b/easybuild/easyblocks/f/fftwmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/flex.py b/easybuild/easyblocks/f/flex.py index 8e17da560b..0c9fb9b54c 100644 --- a/easybuild/easyblocks/f/flex.py +++ b/easybuild/easyblocks/f/flex.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/flexiblas.py b/easybuild/easyblocks/f/flexiblas.py index ab6fabfc50..c1a7be7679 100644 --- a/easybuild/easyblocks/f/flexiblas.py +++ b/easybuild/easyblocks/f/flexiblas.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/flook.py b/easybuild/easyblocks/f/flook.py index 635fa99854..83d6173e3b 100644 --- a/easybuild/easyblocks/f/flook.py +++ b/easybuild/easyblocks/f/flook.py @@ -1,5 +1,5 @@ ## -# Copyright 2023 Utrecht University +# Copyright 2023-2024 Utrecht University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/fluent.py b/easybuild/easyblocks/f/fluent.py index 5b2a479ce4..f8e764ae80 100644 --- a/easybuild/easyblocks/f/fluent.py +++ b/easybuild/easyblocks/f/fluent.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/foldx.py b/easybuild/easyblocks/f/foldx.py index 8166c9b68a..e07441d64f 100644 --- a/easybuild/easyblocks/f/foldx.py +++ b/easybuild/easyblocks/f/foldx.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/freefem.py b/easybuild/easyblocks/f/freefem.py index 15c0fdd31c..125df068c5 100644 --- a/easybuild/easyblocks/f/freefem.py +++ b/easybuild/easyblocks/f/freefem.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/freesurfer.py b/easybuild/easyblocks/f/freesurfer.py index e547c49453..1c63b53e01 100644 --- a/easybuild/easyblocks/f/freesurfer.py +++ b/easybuild/easyblocks/f/freesurfer.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/freetype.py b/easybuild/easyblocks/f/freetype.py index fa3487a1cd..2621a1fd6f 100644 --- a/easybuild/easyblocks/f/freetype.py +++ b/easybuild/easyblocks/f/freetype.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/f/fsl.py b/easybuild/easyblocks/f/fsl.py index dbd95edce5..5064fb30dd 100644 --- a/easybuild/easyblocks/f/fsl.py +++ b/easybuild/easyblocks/f/fsl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/g2clib.py b/easybuild/easyblocks/g/g2clib.py index 591280cd0f..e15d945e5e 100644 --- a/easybuild/easyblocks/g/g2clib.py +++ b/easybuild/easyblocks/g/g2clib.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/g2lib.py b/easybuild/easyblocks/g/g2lib.py index 8b3e9643de..4c316c3b1d 100644 --- a/easybuild/easyblocks/g/g2lib.py +++ b/easybuild/easyblocks/g/g2lib.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/gamess_us.py b/easybuild/easyblocks/g/gamess_us.py index 973309d0c9..0220bc8c0c 100644 --- a/easybuild/easyblocks/g/gamess_us.py +++ b/easybuild/easyblocks/g/gamess_us.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/gate.py b/easybuild/easyblocks/g/gate.py index 223f49eefe..6347694df7 100644 --- a/easybuild/easyblocks/g/gate.py +++ b/easybuild/easyblocks/g/gate.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/gcc.py b/easybuild/easyblocks/g/gcc.py index 589bdb5386..fd4bc01cd6 100644 --- a/easybuild/easyblocks/g/gcc.py +++ b/easybuild/easyblocks/g/gcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -38,6 +38,7 @@ import os import re import shutil +import stat from copy import copy from easybuild.tools import LooseVersion @@ -47,8 +48,8 @@ from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError from easybuild.tools.config import build_option -from easybuild.tools.filetools import apply_regex_substitutions, change_dir, copy_file, move_file, symlink -from easybuild.tools.filetools import which, read_file, write_file +from easybuild.tools.filetools import apply_regex_substitutions, adjust_permissions, change_dir, copy_file +from easybuild.tools.filetools import mkdir, move_file, read_file, symlink, which, write_file from easybuild.tools.modules import get_software_root from easybuild.tools.run import run_cmd from easybuild.tools.systemtools import RISCV, check_os_dependency, get_cpu_architecture, get_cpu_family @@ -71,6 +72,58 @@ 'f95': 'gfortran', } +RECREATE_INCLUDE_FIXED_SCRIPT_TMPL = """#!/bin/bash + +# Script to (re)generate fixed headers in include-fixed subdirectory of GCC installation + +set -u + +gccInstallDir=$(dirname "$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}")")") +mkheadersPath="$gccInstallDir/%(relative_mkheaders)s" +includesFixedDir="$gccInstallDir/%(relative_include_fixed)s" + +if [[ ! -f "$mkheadersPath" ]]; then + echo "mkheaders not found in '$(dirname "$mkheadersPath")'" >&2 + exit 1 +fi + +if [[ -d "$includesFixedDir" && ! -w "$includesFixedDir" ]]; then + resetReadOnly=1 + echo "Found READONLY $includesFixedDir. Adding write permissions" + if ! chmod -R u+w "$includesFixedDir"; then + echo "$includesFixedDir is readonly and failed to change that automatically." >&2 + echo "Add write permissions manually and rerun this script." >&2 + exit 1 + fi +else + resetReadOnly=0 +fi + +readmePath="$includesFixedDir/README" +if [[ -f $readmePath ]]; then + tmpReadmePath=$(mktemp) + cp "$readmePath" "$tmpReadmePath" +else + tmpReadmePath="" +fi + +echo "Starting $mkheadersPath $*" +"$mkheadersPath" "$@" +ec=$? + +if [[ -n "$tmpReadmePath" && -f "$tmpReadmePath" ]]; then + mv -f "$tmpReadmePath" "$readmePath" +fi + +if [[ $resetReadOnly -eq 1 ]] && ! chmod -R u-w "$includesFixedDir"; then + echo "Failed to set $includesFixedDir as readonly again after adding write permissions." >&2 + echo "Ensure the permissions are set as required!" >&2 + exit 1 +fi + +exit $ec +""" + class EB_GCC(ConfigureMake): """ @@ -84,6 +137,11 @@ def extra_options(): 'clooguseisl': [False, "Use ISL with CLooG or not", CUSTOM], 'generic': [None, "Build GCC and support libraries such that it runs on all processors of the target " "architecture (use False to enforce non-generic regardless of configuration)", CUSTOM], + 'rename_include_fixed': [False, "Rename the 'include-fixed' directory to avoid that it is used by GCC. " + "This avoids issues when upgrading the OS but might limit the " + "functionality of GCC, especially if the OS GLIBC is older than GCC. " + "A script to (re-)generate the include-fixed folder is created in the " + "'easybuild' subfolder inside the installation directory.", CUSTOM], 'languages': [[], "List of languages to build GCC for (--enable-languages)", CUSTOM], 'multilib': [False, "Build multilib gcc (both i386 and x86_64)", CUSTOM], 'pplwatchdog': [False, "Enable PPL watchdog", CUSTOM], @@ -140,14 +198,19 @@ def __init__(self, *args, **kwargs): if get_os_name() not in ['ubuntu', 'debian']: self.cfg.update('unwanted_env_vars', ['LIBRARY_PATH']) + # disable NVPTX on RISC-V + if get_cpu_family() == RISCV: + self.log.warning('Setting withnvptx to False, since we are building on a RISC-V system') + self.cfg['withnvptx'] = False + def create_dir(self, dirname): """ Create a dir to build in. """ dirpath = os.path.join(self.cfg['start_dir'], dirname) try: - os.mkdir(dirpath) - os.chdir(dirpath) + mkdir(dirpath) + change_dir(dirpath) self.log.debug("Created dir at %s" % dirpath) return dirpath except OSError as err: @@ -619,6 +682,10 @@ def build_step(self): 'val': os.getenv('LD_LIBRARY_PATH') } env.setvar('LD_LIBRARY_PATH', ld_lib_path) + if get_cpu_family() == RISCV: + # on RISC-V the compilers built in stage 1 fail to find some libraries from the lib dir, + # so let's also set $LIBRARY_PATH to work around it + env.setvar('LIBRARY_PATH', ld_lib_path) # # STAGE 2: build GMP/PPL/CLooG for stage 3 @@ -849,9 +916,9 @@ def post_install_step(self, *args, **kwargs): else: raise EasyBuildError("Can't link '%s' to non-existing location %s", target, os.path.join(bindir, src)) - # Rename include-fixed directory which includes system header files that were processed by fixincludes, - # since these may cause problems when upgrading to newer OS version. - # (see https://github.com/easybuilders/easybuild-easyconfigs/issues/10666) + # The include-fixed directory includes system header files that were processed by fixincludes. + # These may cause problems when upgrading to newer OS version, + # see https://github.com/easybuilders/easybuild-easyconfigs/issues/10666 glob_pattern = os.path.join(self.installdir, 'lib*', 'gcc', '*-linux-gnu', self.version, 'include-fixed') paths = glob.glob(glob_pattern) if paths: @@ -862,26 +929,26 @@ def post_install_step(self, *args, **kwargs): if not any(os.path.samefile(path, x) for x in include_fixed_paths): include_fixed_paths.append(path) - if len(include_fixed_paths) == 1: - include_fixed_path = include_fixed_paths[0] - - msg = "Found include-fixed subdirectory at %s, " - msg += "renaming it to avoid using system header files patched by fixincludes..." - self.log.info(msg, include_fixed_path) + if len(include_fixed_paths) != 1: + raise EasyBuildError("Exactly one 'include-fixed' directory expected, found %d: %s", + len(include_fixed_paths), include_fixed_paths) + include_fixed_path = include_fixed_paths[0] - # limits.h and syslimits.h need to be copied to include/ first, - # these are strictly required (by /usr/include/limits.h for example) - include_path = os.path.join(os.path.dirname(include_fixed_path), 'include') + if self.cfg['rename_include_fixed']: + self.log.info("Found include-fixed subdirectory at %s", include_fixed_path) + include_fixed_renamed = include_fixed_path + '.renamed-by-easybuild' + move_file(include_fixed_path, include_fixed_renamed) + self.log.info("%s renamed to %s to avoid using the header files in it", + include_fixed_path, include_fixed_renamed) + # We need to retain some files, e.g. syslimits.h is required by /usr/include/limits.h + mkdir(include_fixed_path) retained_header_files = ['limits.h', 'syslimits.h'] for fn in retained_header_files: - from_path = os.path.join(include_fixed_path, fn) - to_path = os.path.join(include_path, fn) + from_path = os.path.join(include_fixed_renamed, fn) + to_path = os.path.join(include_fixed_path, fn) if os.path.exists(from_path): - if os.path.exists(to_path): - raise EasyBuildError("%s already exists, not overwriting it with %s!", to_path, from_path) - else: - copy_file(from_path, to_path) - self.log.info("%s copied to %s before renaming %s", from_path, to_path, include_fixed_path) + copy_file(from_path, to_path) + self.log.info("%s copied to %s after renaming %s", from_path, to_path, include_fixed_path) else: self.log.warning("Can't copy non-existing file %s to %s, since it doesn't exist!", from_path, to_path) @@ -891,20 +958,30 @@ def post_install_step(self, *args, **kwargs): "This directory was renamed by EasyBuild to avoid that the header files in it are picked up,", "since they may cause problems when the OS is upgraded to a new (minor) version.", '', - "These files were copied to %s first: %s" % (include_path, ', '.join(retained_header_files)), + "These files were copied to %s first: %s" % (include_fixed_path, ', '.join(retained_header_files)), '', "See https://github.com/easybuilders/easybuild-easyconfigs/issues/10666 for more information.", '', ]) write_file(readme, readme_txt) - include_fixed_renamed = include_fixed_path + '.renamed-by-easybuild' - move_file(include_fixed_path, include_fixed_renamed) - self.log.info("%s renamed to %s to avoid using the header files in it", - include_fixed_path, include_fixed_renamed) - else: - raise EasyBuildError("Exactly one 'include-fixed' directory expected, found %d: %s", - len(include_fixed_paths), include_fixed_paths) + # If the mkheaders utility exists we create a wrapper script to (re)generate the fixed headers manually, + # e.g. after OS upgrades. + # Get the '*-linux-gnu' part + target_machine = os.path.basename(os.path.dirname(os.path.dirname(include_fixed_path))) + mkheaders_path = os.path.join(self.installdir, 'libexec', 'gcc', target_machine, self.version, + 'install-tools', 'mkheaders') + if os.path.isfile(mkheaders_path): + recreate_include_fixed_script = os.path.join(self.installdir, 'easybuild', 'recreate_includes.sh') + self.log.info("Creating script to regenerate %s on OS upgrades at %s", + include_fixed_path, recreate_include_fixed_script) + relative_mkheaders = os.path.relpath(mkheaders_path, self.installdir) + relative_include_fixed = os.path.relpath(include_fixed_path, self.installdir) + write_file(recreate_include_fixed_script, RECREATE_INCLUDE_FIXED_SCRIPT_TMPL % { + "relative_mkheaders": relative_mkheaders, + "relative_include_fixed": relative_include_fixed + }) + adjust_permissions(recreate_include_fixed_script, stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH, add=True) else: self.log.info("No include-fixed subdirectory found at %s", glob_pattern) @@ -1057,7 +1134,7 @@ def make_module_req_guess(self): guesses.update({ 'PATH': ['bin'], 'CPATH': [], - 'LIBRARY_PATH': [], + 'LIBRARY_PATH': ['lib', 'lib64'] if get_cpu_family() == RISCV else [], 'LD_LIBRARY_PATH': ['lib', 'lib64'], 'MANPATH': ['man', 'share/man'] }) diff --git a/easybuild/easyblocks/g/gctf.py b/easybuild/easyblocks/g/gctf.py index 17397a08c9..cd2b9315fa 100644 --- a/easybuild/easyblocks/g/gctf.py +++ b/easybuild/easyblocks/g/gctf.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (https://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/geant4.py b/easybuild/easyblocks/g/geant4.py index 6c94076980..110fdce7f8 100644 --- a/easybuild/easyblocks/g/geant4.py +++ b/easybuild/easyblocks/g/geant4.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/ghc.py b/easybuild/easyblocks/g/ghc.py index af2ef6382f..cfae065062 100644 --- a/easybuild/easyblocks/g/ghc.py +++ b/easybuild/easyblocks/g/ghc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/go.py b/easybuild/easyblocks/g/go.py index 97f0d79db7..25d06272e3 100644 --- a/easybuild/easyblocks/g/go.py +++ b/easybuild/easyblocks/g/go.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/gromacs.py b/easybuild/easyblocks/g/gromacs.py index 74d129626c..5a010d4f26 100644 --- a/easybuild/easyblocks/g/gromacs.py +++ b/easybuild/easyblocks/g/gromacs.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/g/gurobi.py b/easybuild/easyblocks/g/gurobi.py index 49147d9a2f..c8b90e9dfe 100644 --- a/easybuild/easyblocks/g/gurobi.py +++ b/easybuild/easyblocks/g/gurobi.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -34,6 +34,7 @@ from easybuild.easyblocks.generic.pythonpackage import det_pylibdir from easybuild.easyblocks.generic.tarball import Tarball from easybuild.framework.easyconfig import CUSTOM +from easybuild.tools import LooseVersion from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import copy_file from easybuild.tools.modules import get_software_root @@ -75,7 +76,7 @@ def install_step(self): copy_file(self.orig_license_file, self.license_file) - if get_software_root('Python'): + if get_software_root('Python') and LooseVersion(self.version) < LooseVersion('11'): run_cmd("python setup.py install --prefix=%s" % self.installdir) def sanity_check_step(self): diff --git a/easybuild/easyblocks/generic/__init__.py b/easybuild/easyblocks/generic/__init__.py index 62a579f2dd..8d496189c3 100644 --- a/easybuild/easyblocks/generic/__init__.py +++ b/easybuild/easyblocks/generic/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/binariestarball.py b/easybuild/easyblocks/generic/binariestarball.py index fc74fbe313..53b8de19f7 100644 --- a/easybuild/easyblocks/generic/binariestarball.py +++ b/easybuild/easyblocks/generic/binariestarball.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/binary.py b/easybuild/easyblocks/generic/binary.py index d9ff3a5bb7..288859ecbb 100644 --- a/easybuild/easyblocks/generic/binary.py +++ b/easybuild/easyblocks/generic/binary.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/buildenv.py b/easybuild/easyblocks/generic/buildenv.py index cb75e3a348..35be80739c 100644 --- a/easybuild/easyblocks/generic/buildenv.py +++ b/easybuild/easyblocks/generic/buildenv.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/bundle.py b/easybuild/easyblocks/generic/bundle.py index 97e982405a..23da2338c2 100644 --- a/easybuild/easyblocks/generic/bundle.py +++ b/easybuild/easyblocks/generic/bundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cargo.py b/easybuild/easyblocks/generic/cargo.py index c47f2e9f05..62f6bc1cf3 100644 --- a/easybuild/easyblocks/generic/cargo.py +++ b/easybuild/easyblocks/generic/cargo.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -26,23 +26,43 @@ EasyBuild support for installing Cargo packages (Rust lang package system) @author: Mikael Oehman (Chalmers University of Technology) +@author: Alex Domingo (Vrije Universiteit Brussel) """ import os +import re import easybuild.tools.environment as env import easybuild.tools.systemtools as systemtools -from easybuild.tools.build_log import EasyBuildError +from easybuild.tools.build_log import EasyBuildError, print_warning from easybuild.framework.easyconfig import CUSTOM from easybuild.framework.extensioneasyblock import ExtensionEasyBlock from easybuild.tools.filetools import extract_file, change_dir from easybuild.tools.run import run_cmd from easybuild.tools.config import build_option -from easybuild.tools.filetools import write_file, compute_checksum +from easybuild.tools.filetools import compute_checksum, mkdir, write_file from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC CRATESIO_SOURCE = "https://crates.io/api/v1/crates" +CONFIG_TOML_SOURCE_VENDOR = """ +[source.vendored-sources] +directory = "{vendor_dir}" + +[source.crates-io] +replace-with = "vendored-sources" + +""" + +CONFIG_TOML_PATCH_GIT = """ +[patch."{repo}"] +{crates} +""" +CONFIG_TOML_PATCH_GIT_CRATES = """{0} = {{ path = "{1}" }} +""" + +CARGO_CHECKSUM_JSON = '{{"files": {{}}, "package": "{chksum}"}}' + class Cargo(ExtensionEasyBlock): """Support for installing Cargo packages (Rust)""" @@ -60,6 +80,16 @@ def extra_options(extra_vars=None): return extra_vars + @staticmethod + def crate_src_filename(pkg_name, pkg_version, *args): + """Crate tarball filename based on package name and version""" + return "{0}-{1}.tar.gz".format(pkg_name, pkg_version) + + @staticmethod + def crate_download_filename(pkg_name, pkg_version, *args): + """Crate download filename based on package name and version""" + return "{0}/{1}/download".format(pkg_name, pkg_version) + def rustc_optarch(self): """Determines what architecture to target. Translates GENERIC optarch, and respects rustc specific optarch. @@ -92,6 +122,7 @@ def __init__(self, *args, **kwargs): """Constructor for Cargo easyblock.""" super(Cargo, self).__init__(*args, **kwargs) self.cargo_home = os.path.join(self.builddir, '.cargo') + self.vendor_dir = os.path.join(self.builddir, 'easybuild_vendor') env.setvar('CARGO_HOME', self.cargo_home) env.setvar('RUSTC', 'rustc') env.setvar('RUSTDOC', 'rustdoc') @@ -102,81 +133,102 @@ def __init__(self, *args, **kwargs): # Populate sources from "crates" list of tuples (only once) if self.cfg['crates']: - # copy list of crates, so we can wipe 'crates' easyconfig parameter, + # Move 'crates' list from easyconfig parameter to property, # to avoid that creates are processed into 'sources' easyconfig parameter again - # when easyblock is initialized again using same parsed easyconfig + # when easyblock is initialized again using the same parsed easyconfig # (for example when check_sha256_checksums function is called, like in easyconfigs test suite) - self.crates = self.cfg['crates'][:] + self.crates = self.cfg['crates'] + self.cfg['crates'] = [] sources = [] - for crate_info in self.cfg['crates']: + for crate_info in self.crates: if len(crate_info) == 2: - crate, version = crate_info sources.append({ - 'download_filename': crate + '/' + version + '/download', - 'filename': crate + '-' + version + '.tar.gz', + 'download_filename': self.crate_download_filename(*crate_info), + 'filename': self.crate_src_filename(*crate_info), 'source_urls': [CRATESIO_SOURCE], 'alt_location': 'crates.io', }) else: crate, version, repo, rev = crate_info - url, repo_name_git = repo.rsplit('/', maxsplit=1) + url, repo_name = repo.rsplit('/', maxsplit=1) + if repo_name.endswith('.git'): + repo_name = repo_name[:-4] sources.append({ - 'git_config': {'url': url, 'repo_name': repo_name_git[:-4], 'commit': rev}, - 'filename': crate + '-' + version + '.tar.gz', - 'source_urls': [CRATESIO_SOURCE], + 'git_config': {'url': url, 'repo_name': repo_name, 'commit': rev}, + 'filename': self.crate_src_filename(crate, version), }) self.cfg.update('sources', sources) - # set 'crates' easyconfig parameter to empty list to prevent re-processing into sources - self.cfg['crates'] = [] - def extract_step(self): """ Unpack the source files and populate them with required .cargo-checksum.json if offline """ + mkdir(self.vendor_dir) + + vendor_crates = {self.crate_src_filename(*crate): crate for crate in self.crates} + git_sources = {crate[2]: [] for crate in self.crates if len(crate) == 4} + + for src in self.src: + extraction_dir = self.builddir + # Extract dependency crates into vendor subdirectory, separate from sources of main package + if src['name'] in vendor_crates: + extraction_dir = self.vendor_dir + + self.log.info("Unpacking source of %s", src['name']) + existing_dirs = set(os.listdir(extraction_dir)) + crate_dir = None + src_dir = extract_file(src['path'], extraction_dir, cmd=src['cmd'], + extra_options=self.cfg['unpack_options'], change_into_dir=False) + new_extracted_dirs = set(os.listdir(extraction_dir)) - existing_dirs + + if len(new_extracted_dirs) == 1: + # Expected crate tarball with 1 folder + crate_dir = new_extracted_dirs.pop() + src_dir = os.path.join(extraction_dir, crate_dir) + self.log.debug("Unpacked sources of %s into: %s", src['name'], src_dir) + elif len(new_extracted_dirs) == 0: + # Extraction went wrong + raise EasyBuildError("Unpacking sources of '%s' failed", src['name']) + # TODO: properly handle case with multiple extracted folders + # this is currently in a grey area, might still be used by cargo + + change_dir(src_dir) + self.src[self.src.index(src)]['finalpath'] = src_dir + + if self.cfg['offline'] and crate_dir: + # Create checksum file for extracted sources required by vendored crates.io sources + self.log.info('creating .cargo-checksums.json file for : %s', crate_dir) + chksum = compute_checksum(src['path'], checksum_type='sha256') + chkfile = os.path.join(extraction_dir, crate_dir, '.cargo-checksum.json') + write_file(chkfile, CARGO_CHECKSUM_JSON.format(chksum=chksum)) + # Add path to extracted sources for any crate from a git repo + try: + crate_name, _, crate_repo, _ = vendor_crates[src['name']] + except (ValueError, KeyError): + pass + else: + self.log.debug("Sources of %s belong to git repo: %s", src['name'], crate_repo) + git_src_dir = (crate_name, src_dir) + git_sources[crate_repo].append(git_src_dir) + if self.cfg['offline']: - self.log.info("Setting vendored crates dir") + self.log.info("Setting vendored crates dir for offline operation") + config_toml = os.path.join(self.cargo_home, 'config.toml') # Replace crates-io with vendored sources using build dir wide toml file in CARGO_HOME # because the rust source subdirectories might differ with python packages - config_toml = os.path.join(self.cargo_home, 'config.toml') - write_file(config_toml, '[source.vendored-sources]\ndirectory = "%s"\n\n' % self.builddir, append=True) - write_file(config_toml, '[source.crates-io]\nreplace-with = "vendored-sources"\n\n', append=True) + self.log.debug("Writting config.toml entry for vendored crates from crate.io") + write_file(config_toml, CONFIG_TOML_SOURCE_VENDOR.format(vendor_dir=self.vendor_dir), append=True) # also vendor sources from other git sources (could be many crates for one git source) - git_sources = set() - for crate_info in self.crates: - if len(crate_info) == 4: - _, _, repo, rev = crate_info - git_sources.add((repo, rev)) - for repo, rev in git_sources: - write_file(config_toml, '[source."%s"]\ngit = "%s"\nrev = "%s"\n' - 'replace-with = "vendored-sources"\n\n' % (repo, repo, rev), append=True) + for git_repo, repo_crates in git_sources.items(): + self.log.debug("Writting config.toml entry for git repo: %s", git_repo) + config_crates = ''.join([CONFIG_TOML_PATCH_GIT_CRATES.format(*crate) for crate in repo_crates]) + write_file(config_toml, CONFIG_TOML_PATCH_GIT.format(repo=git_repo, crates=config_crates), append=True) # Use environment variable since it would also be passed along to builds triggered via python packages env.setvar('CARGO_NET_OFFLINE', 'true') - # More work is needed here for git sources to work, especially those repos with multiple packages. - for src in self.src: - existing_dirs = set(os.listdir(self.builddir)) - self.log.info("Unpacking source %s" % src['name']) - srcdir = extract_file(src['path'], self.builddir, cmd=src['cmd'], - extra_options=self.cfg['unpack_options'], change_into_dir=False) - change_dir(srcdir) - if srcdir: - self.src[self.src.index(src)]['finalpath'] = srcdir - else: - raise EasyBuildError("Unpacking source %s failed", src['name']) - - # Create checksum file for all sources required by vendored crates.io sources - new_dirs = set(os.listdir(self.builddir)) - existing_dirs - if self.cfg['offline'] and len(new_dirs) == 1: - cratedir = new_dirs.pop() - self.log.info('creating .cargo-checksums.json file for : %s', cratedir) - chksum = compute_checksum(src['path'], checksum_type='sha256') - chkfile = os.path.join(self.builddir, cratedir, '.cargo-checksum.json') - write_file(chkfile, '{"files":{},"package":"%s"}' % chksum) - def configure_step(self): """Empty configuration step.""" pass @@ -242,7 +294,11 @@ def generate_crate_list(sourcedir): cargo_toml = toml.load(os.path.join(sourcedir, 'Cargo.toml')) cargo_lock = toml.load(os.path.join(sourcedir, 'Cargo.lock')) - app_name = cargo_toml['package']['name'] + try: + app_name = cargo_toml['package']['name'] + except KeyError: + app_name = os.path.basename(os.path.abspath(sourcedir)) + print_warning('Did not find a [package] name= entry. Assuming it is the folder name: ' + app_name) deps = cargo_lock['package'] app_in_cratesio = False @@ -258,8 +314,14 @@ def generate_crate_list(sourcedir): if dep['source'] == 'registry+https://github.com/rust-lang/crates.io-index': crates.append((name, version)) else: - # Lock file has revision#revision in the url for some reason. - crates.append((name, version, dep['source'].rsplit('#', maxsplit=1)[0])) + # Lock file has revision#revision in the url + url, rev = dep['source'].rsplit('#', maxsplit=1) + for prefix in ('registry+', 'git+'): + if url.startswith(prefix): + url = url[len(prefix):] + # Remove branch name if present + url = re.sub(r'\?branch=\w+$', '', url) + crates.append((name, version, url, rev)) else: other_crates.append((name, version)) return app_in_cratesio, crates, other_crates @@ -274,5 +336,5 @@ def generate_crate_list(sourcedir): if app_in_cratesio: print(' (name, version),') for crate_info in crates: - print(" ('" + "', '".join(crate_info) + "'),") + print(" %s," % str(crate_info)) print(']') diff --git a/easybuild/easyblocks/generic/cargopythonbundle.py b/easybuild/easyblocks/generic/cargopythonbundle.py index 4745b8a91e..090a38dff4 100644 --- a/easybuild/easyblocks/generic/cargopythonbundle.py +++ b/easybuild/easyblocks/generic/cargopythonbundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cargopythonpackage.py b/easybuild/easyblocks/generic/cargopythonpackage.py index a935e190a0..9d27f67181 100644 --- a/easybuild/easyblocks/generic/cargopythonpackage.py +++ b/easybuild/easyblocks/generic/cargopythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 0a326a8e5a..eb0d582018 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -273,6 +273,11 @@ def configure_step(self, srcdir=None, builddir=None): # see https://github.com/Kitware/CMake/commit/3ec9226779776811240bde88a3f173c29aa935b5 options['CMAKE_SKIP_RPATH'] = 'ON' + # make sure that newer CMAKE picks python based on location, not just the newest python + # Avoids issues like e.g. https://github.com/EESSI/software-layer/pull/370#issuecomment-1785594932 + if LooseVersion(self.cmake_version) >= '3.15': + options['CMAKE_POLICY_DEFAULT_CMP0094'] = 'NEW' + # show what CMake is doing by default options['CMAKE_VERBOSE_MAKEFILE'] = 'ON' diff --git a/easybuild/easyblocks/generic/cmakemakecp.py b/easybuild/easyblocks/generic/cmakemakecp.py index 866ffe9e86..51a9cf3d29 100644 --- a/easybuild/easyblocks/generic/cmakemakecp.py +++ b/easybuild/easyblocks/generic/cmakemakecp.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cmakeninja.py b/easybuild/easyblocks/generic/cmakeninja.py index f14acb9989..f9c4d7556b 100644 --- a/easybuild/easyblocks/generic/cmakeninja.py +++ b/easybuild/easyblocks/generic/cmakeninja.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cmakepythonpackage.py b/easybuild/easyblocks/generic/cmakepythonpackage.py index fac9aeced4..5a4bc30f53 100644 --- a/easybuild/easyblocks/generic/cmakepythonpackage.py +++ b/easybuild/easyblocks/generic/cmakepythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/cmdcp.py b/easybuild/easyblocks/generic/cmdcp.py index 5a91112a4e..ee24055169 100644 --- a/easybuild/easyblocks/generic/cmdcp.py +++ b/easybuild/easyblocks/generic/cmdcp.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/conda.py b/easybuild/easyblocks/generic/conda.py index 03e78ab42e..5fce4607e6 100644 --- a/easybuild/easyblocks/generic/conda.py +++ b/easybuild/easyblocks/generic/conda.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -62,7 +62,8 @@ def install_step(self): """Install software using 'conda env create' or 'conda create' & 'conda install' (or the 'mamba', etc., equivalent).""" if (get_software_root('anaconda2') or get_software_root('miniconda2') or - get_software_root('anaconda3') or get_software_root('miniconda3')): + get_software_root('anaconda3') or get_software_root('miniconda3') or + get_software_root('miniforge3')): conda_cmd = 'conda' elif get_software_root('mamba'): conda_cmd = 'mamba' diff --git a/easybuild/easyblocks/generic/configuremake.py b/easybuild/easyblocks/generic/configuremake.py index 3b88de8f6c..8ad952db5e 100644 --- a/easybuild/easyblocks/generic/configuremake.py +++ b/easybuild/easyblocks/generic/configuremake.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/configuremakepythonpackage.py b/easybuild/easyblocks/generic/configuremakepythonpackage.py index 8da38021a2..8da4ac0331 100644 --- a/easybuild/easyblocks/generic/configuremakepythonpackage.py +++ b/easybuild/easyblocks/generic/configuremakepythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/craytoolchain.py b/easybuild/easyblocks/generic/craytoolchain.py index e324b72e7f..210b7e9f47 100644 --- a/easybuild/easyblocks/generic/craytoolchain.py +++ b/easybuild/easyblocks/generic/craytoolchain.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/fortranpythonpackage.py b/easybuild/easyblocks/generic/fortranpythonpackage.py index 849dacf54b..1a8a512f1d 100644 --- a/easybuild/easyblocks/generic/fortranpythonpackage.py +++ b/easybuild/easyblocks/generic/fortranpythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index 8a3b591402..268d0eea61 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -65,6 +65,8 @@ def prepare_step(self, *args, **kwargs): def configure_step(self): """Configure Go package build/install.""" + # Move compiled .a files into builddir, else they pollute $HOME/go + env.setvar('GOPATH', self.builddir, verbose=False) # enforce use of go modules env.setvar('GO111MODULE', 'on', verbose=False) # set bin folder diff --git a/easybuild/easyblocks/generic/intelbase.py b/easybuild/easyblocks/generic/intelbase.py index 1e918605dc..5c03926642 100644 --- a/easybuild/easyblocks/generic/intelbase.py +++ b/easybuild/easyblocks/generic/intelbase.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/jar.py b/easybuild/easyblocks/generic/jar.py index 55765f11ab..2ac88971af 100644 --- a/easybuild/easyblocks/generic/jar.py +++ b/easybuild/easyblocks/generic/jar.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/juliabundle.py b/easybuild/easyblocks/generic/juliabundle.py index 0f316092c4..a983db773f 100644 --- a/easybuild/easyblocks/generic/juliabundle.py +++ b/easybuild/easyblocks/generic/juliabundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2022-2023 Vrije Universiteit Brussel +# Copyright 2022-2024 Vrije Universiteit Brussel # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/juliapackage.py b/easybuild/easyblocks/generic/juliapackage.py index 2ff1e49e89..5e5d8f9987 100644 --- a/easybuild/easyblocks/generic/juliapackage.py +++ b/easybuild/easyblocks/generic/juliapackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2022-2023 Vrije Universiteit Brussel +# Copyright 2022-2024 Vrije Universiteit Brussel # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/makecp.py b/easybuild/easyblocks/generic/makecp.py index f02937570b..230608d3aa 100644 --- a/easybuild/easyblocks/generic/makecp.py +++ b/easybuild/easyblocks/generic/makecp.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 the Cyprus Institute +# Copyright 2013-2024 the Cyprus Institute # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/mesonninja.py b/easybuild/easyblocks/generic/mesonninja.py index 1fafaed53d..c432bfd021 100644 --- a/easybuild/easyblocks/generic/mesonninja.py +++ b/easybuild/easyblocks/generic/mesonninja.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/modulerc.py b/easybuild/easyblocks/generic/modulerc.py index c6bd4b988c..e9547aada1 100644 --- a/easybuild/easyblocks/generic/modulerc.py +++ b/easybuild/easyblocks/generic/modulerc.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/ocamlpackage.py b/easybuild/easyblocks/generic/ocamlpackage.py index d0b460d2ca..538ecb8c3f 100644 --- a/easybuild/easyblocks/generic/ocamlpackage.py +++ b/easybuild/easyblocks/generic/ocamlpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/octavepackage.py b/easybuild/easyblocks/generic/octavepackage.py index cff63cc9c6..c7891460cc 100644 --- a/easybuild/easyblocks/generic/octavepackage.py +++ b/easybuild/easyblocks/generic/octavepackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/packedbinary.py b/easybuild/easyblocks/generic/packedbinary.py index 2520397b3e..18ebbbf28d 100644 --- a/easybuild/easyblocks/generic/packedbinary.py +++ b/easybuild/easyblocks/generic/packedbinary.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/perlbundle.py b/easybuild/easyblocks/generic/perlbundle.py index 43cd4545c1..928dfe6886 100644 --- a/easybuild/easyblocks/generic/perlbundle.py +++ b/easybuild/easyblocks/generic/perlbundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/perlmodule.py b/easybuild/easyblocks/generic/perlmodule.py index e10b6d5b1c..648b5d6dab 100644 --- a/easybuild/easyblocks/generic/perlmodule.py +++ b/easybuild/easyblocks/generic/perlmodule.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -102,8 +102,9 @@ def install_perl_module(self): run_cmd("%s perl Build build %s" % (self.cfg['prebuildopts'], self.cfg['buildopts'])) - if self.cfg['runtest']: - run_cmd('perl Build %s' % self.cfg['runtest']) + runtest = self.cfg['runtest'] + if runtest: + run_cmd('%s perl Build %s %s' % (self.cfg['pretestopts'], runtest, self.cfg['testopts'])) run_cmd('%s perl Build install %s' % (self.cfg['preinstallopts'], self.cfg['installopts'])) def run(self): diff --git a/easybuild/easyblocks/generic/pythonbundle.py b/easybuild/easyblocks/generic/pythonbundle.py index 292cc275aa..01d9c4c672 100644 --- a/easybuild/easyblocks/generic/pythonbundle.py +++ b/easybuild/easyblocks/generic/pythonbundle.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/pythonpackage.py b/easybuild/easyblocks/generic/pythonpackage.py index 952666220c..da6ca8c2a8 100644 --- a/easybuild/easyblocks/generic/pythonpackage.py +++ b/easybuild/easyblocks/generic/pythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -344,6 +344,8 @@ def extra_options(extra_vars=None): 'pip_ignore_installed': [True, "Let pip ignore installed Python packages (i.e. don't remove them)", CUSTOM], 'pip_no_index': [None, "Pass --no-index to pip to disable connecting to PyPi entirely which also disables " "the pip version check. Enabled by default when pip_ignore_installed=True", CUSTOM], + 'pip_verbose': [None, "Pass --verbose to 'pip install' (if pip is used). " + "Enabled by default if the EB option --debug is used.", CUSTOM], 'req_py_majver': [None, "Required major Python version (only relevant when using system Python)", CUSTOM], 'req_py_minver': [None, "Required minor Python version (only relevant when using system Python)", CUSTOM], 'sanity_pip_check': [False, "Run 'python -m pip check' to ensure all required Python packages are " @@ -427,7 +429,8 @@ def determine_install_command(self): if self.cfg.get('use_pip', False) or self.cfg.get('use_pip_editable', False): self.install_cmd = PIP_INSTALL_CMD - if build_option('debug'): + pip_verbose = self.cfg.get('pip_verbose', None) + if pip_verbose or (pip_verbose is None and build_option('debug')): self.cfg.update('installopts', '--verbose') # don't auto-install dependencies with pip unless use_pip_for_deps=True diff --git a/easybuild/easyblocks/generic/rpackage.py b/easybuild/easyblocks/generic/rpackage.py index 897408503c..46230f3a4a 100644 --- a/easybuild/easyblocks/generic/rpackage.py +++ b/easybuild/easyblocks/generic/rpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/rpm.py b/easybuild/easyblocks/generic/rpm.py index 1ab63bfff1..d23d4427e0 100644 --- a/easybuild/easyblocks/generic/rpm.py +++ b/easybuild/easyblocks/generic/rpm.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/rubygem.py b/easybuild/easyblocks/generic/rubygem.py index 58ecfa05c4..7d6a621f0f 100644 --- a/easybuild/easyblocks/generic/rubygem.py +++ b/easybuild/easyblocks/generic/rubygem.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/scons.py b/easybuild/easyblocks/generic/scons.py index 9820cb5855..9e8b615cb0 100644 --- a/easybuild/easyblocks/generic/scons.py +++ b/easybuild/easyblocks/generic/scons.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/systemcompiler.py b/easybuild/easyblocks/generic/systemcompiler.py index 0b01c30036..ff9db971e0 100644 --- a/easybuild/easyblocks/generic/systemcompiler.py +++ b/easybuild/easyblocks/generic/systemcompiler.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/systemmpi.py b/easybuild/easyblocks/generic/systemmpi.py index 5ba5a3f812..84cb89d7eb 100644 --- a/easybuild/easyblocks/generic/systemmpi.py +++ b/easybuild/easyblocks/generic/systemmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/tarball.py b/easybuild/easyblocks/generic/tarball.py index 5ad887cc81..1eef4528ae 100644 --- a/easybuild/easyblocks/generic/tarball.py +++ b/easybuild/easyblocks/generic/tarball.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/toolchain.py b/easybuild/easyblocks/generic/toolchain.py index 389182c684..957971d03a 100644 --- a/easybuild/easyblocks/generic/toolchain.py +++ b/easybuild/easyblocks/generic/toolchain.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/versionindependentpythonpackage.py b/easybuild/easyblocks/generic/versionindependentpythonpackage.py index f6cc181b41..9c7dc3fc8b 100644 --- a/easybuild/easyblocks/generic/versionindependentpythonpackage.py +++ b/easybuild/easyblocks/generic/versionindependentpythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/vscpythonpackage.py b/easybuild/easyblocks/generic/vscpythonpackage.py index 772aeb3946..ea2012878a 100644 --- a/easybuild/easyblocks/generic/vscpythonpackage.py +++ b/easybuild/easyblocks/generic/vscpythonpackage.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/generic/waf.py b/easybuild/easyblocks/generic/waf.py index 30d36a72dd..8cec720fd9 100644 --- a/easybuild/easyblocks/generic/waf.py +++ b/easybuild/easyblocks/generic/waf.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hadoop.py b/easybuild/easyblocks/h/hadoop.py index aa1ec66619..856def79fd 100644 --- a/easybuild/easyblocks/h/hadoop.py +++ b/easybuild/easyblocks/h/hadoop.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hdf5.py b/easybuild/easyblocks/h/hdf5.py index 6ee28991e3..5501a9db54 100644 --- a/easybuild/easyblocks/h/hdf5.py +++ b/easybuild/easyblocks/h/hdf5.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/healpix.py b/easybuild/easyblocks/h/healpix.py index 3f3bd08b2d..8969836898 100644 --- a/easybuild/easyblocks/h/healpix.py +++ b/easybuild/easyblocks/h/healpix.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hpcc.py b/easybuild/easyblocks/h/hpcc.py index 57893788b2..c8137cc143 100644 --- a/easybuild/easyblocks/h/hpcc.py +++ b/easybuild/easyblocks/h/hpcc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hpcg.py b/easybuild/easyblocks/h/hpcg.py index 13d9fe0621..e634111bce 100644 --- a/easybuild/easyblocks/h/hpcg.py +++ b/easybuild/easyblocks/h/hpcg.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hpl.py b/easybuild/easyblocks/h/hpl.py index 3599b3004a..1f1b23e0df 100644 --- a/easybuild/easyblocks/h/hpl.py +++ b/easybuild/easyblocks/h/hpl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/h/hypre.py b/easybuild/easyblocks/h/hypre.py index 556d40ff7b..1d9615bd74 100644 --- a/easybuild/easyblocks/h/hypre.py +++ b/easybuild/easyblocks/h/hypre.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/icc.py b/easybuild/easyblocks/i/icc.py index f827dd4679..527921d0fa 100644 --- a/easybuild/easyblocks/i/icc.py +++ b/easybuild/easyblocks/i/icc.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/iccifort.py b/easybuild/easyblocks/i/iccifort.py index b2f0d01492..1072de00d7 100644 --- a/easybuild/easyblocks/i/iccifort.py +++ b/easybuild/easyblocks/i/iccifort.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Bart Oldeman, McGill University, Compute Canada +# Copyright 2019-2024 Bart Oldeman, McGill University, Compute Canada # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/easyblocks/i/ifort.py b/easybuild/easyblocks/i/ifort.py index 5b3356c84d..6497c1124f 100644 --- a/easybuild/easyblocks/i/ifort.py +++ b/easybuild/easyblocks/i/ifort.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/imkl.py b/easybuild/easyblocks/i/imkl.py index 3901a22cf3..59ce1159a6 100644 --- a/easybuild/easyblocks/i/imkl.py +++ b/easybuild/easyblocks/i/imkl.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/imkl_fftw.py b/easybuild/easyblocks/i/imkl_fftw.py index e8f8ee4cce..18cd02246b 100644 --- a/easybuild/easyblocks/i/imkl_fftw.py +++ b/easybuild/easyblocks/i/imkl_fftw.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/imod.py b/easybuild/easyblocks/i/imod.py index 75d0760041..cda5c3a70f 100644 --- a/easybuild/easyblocks/i/imod.py +++ b/easybuild/easyblocks/i/imod.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/impi.py b/easybuild/easyblocks/i/impi.py index 9b646ce9be..f7c3c9c998 100644 --- a/easybuild/easyblocks/i/impi.py +++ b/easybuild/easyblocks/i/impi.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/inspector.py b/easybuild/easyblocks/i/inspector.py index a0d595c2e8..7d7ddbf062 100644 --- a/easybuild/easyblocks/i/inspector.py +++ b/easybuild/easyblocks/i/inspector.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/intel_compilers.py b/easybuild/easyblocks/i/intel_compilers.py index d1839a7a7b..c3fce10a99 100644 --- a/easybuild/easyblocks/i/intel_compilers.py +++ b/easybuild/easyblocks/i/intel_compilers.py @@ -1,5 +1,5 @@ # # -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/ipp.py b/easybuild/easyblocks/i/ipp.py index 3b70620b0d..d39c55b07b 100644 --- a/easybuild/easyblocks/i/ipp.py +++ b/easybuild/easyblocks/i/ipp.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/ironpython.py b/easybuild/easyblocks/i/ironpython.py index 9b5eee4111..dedbbe8fec 100644 --- a/easybuild/easyblocks/i/ironpython.py +++ b/easybuild/easyblocks/i/ironpython.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/i/itac.py b/easybuild/easyblocks/i/itac.py index 542b1f5e37..d0811cbcc5 100644 --- a/easybuild/easyblocks/i/itac.py +++ b/easybuild/easyblocks/i/itac.py @@ -1,5 +1,5 @@ # # -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/j/java.py b/easybuild/easyblocks/j/java.py index caef94fabe..bca89cc6b2 100644 --- a/easybuild/easyblocks/j/java.py +++ b/easybuild/easyblocks/j/java.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/j/jaxlib.py b/easybuild/easyblocks/j/jaxlib.py index ad6fa016f5..d4dca3245c 100644 --- a/easybuild/easyblocks/j/jaxlib.py +++ b/easybuild/easyblocks/j/jaxlib.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/lammps.py b/easybuild/easyblocks/l/lammps.py index 2769014eab..111a23af63 100644 --- a/easybuild/easyblocks/l/lammps.py +++ b/easybuild/easyblocks/l/lammps.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -34,6 +34,7 @@ import os import re import tempfile +import copy from easybuild.tools import LooseVersion import easybuild.tools.environment as env @@ -41,7 +42,7 @@ from easybuild.framework.easyconfig import CUSTOM, MANDATORY from easybuild.tools.build_log import EasyBuildError, print_warning, print_msg from easybuild.tools.config import build_option -from easybuild.tools.filetools import copy_dir +from easybuild.tools.filetools import copy_dir, mkdir from easybuild.tools.modules import get_software_root, get_software_version from easybuild.tools.run import run_cmd from easybuild.tools.systemtools import get_shared_lib_ext @@ -53,7 +54,11 @@ 'SNB', # Intel Sandy/Ivy Bridge CPU (AVX 1) 'HSW', # Intel Haswell CPU (AVX 2) 'BDW', # Intel Broadwell Xeon E-class CPU (AVX 2 + transactional mem) + 'SKL', # Intel Skylake Client CPU 'SKX', # Intel Sky Lake Xeon E-class HPC CPU (AVX512 + transactional mem) + 'ICL', # Intel Ice Lake Client CPU (AVX512) + 'ICX', # Intel Ice Lake Xeon Server CPU (AVX512) + 'SPR', # Intel Sapphire Rapids Xeon Server CPU (AVX512) 'KNC', # Intel Knights Corner Xeon Phi 'KNL', # Intel Knights Landing Xeon Phi ] @@ -86,15 +91,21 @@ 'TURING75', # NVIDIA Turing generation CC 7.5 GPU 'AMPERE80', # NVIDIA Ampere generation CC 8.0 GPU 'AMPERE86', # NVIDIA Ampere generation CC 8.6 GPU + 'ADA89', # NVIDIA Ada Lovelace generation CC 8.9 GPU 'HOPPER90', # NVIDIA Hopper generation CC 9.0 GPU 'VEGA900', # AMD GPU MI25 GFX900 'VEGA906', # AMD GPU MI50/MI60 GFX906 'VEGA908', # AMD GPU MI100 GFX908 + 'VEGA90A', # AMD GPU MI200 GFX90A + 'NAVI1030', # AMD GPU MI200 GFX90A + 'NAVI1100', # AMD GPU RX7900XTX 'INTEL_GEN', # Intel GPUs Gen9+ + 'INTEL_DG1', # Intel Iris XeMAX GPU 'INTEL_GEN9', # Intel GPU Gen9 'INTEL_GEN11', # Intel GPU Gen11 'INTEL_GEN12LP', # Intel GPU Gen12LP 'INTEL_XEHP', # Intel GPUs Xe-HP + 'INTEL_PVC', # Intel GPU Ponte Vecchio ] + INTEL_PACKAGE_ARCH_LIST KOKKOS_LEGACY_ARCH_MAPPING = { @@ -146,8 +157,8 @@ def translate_lammps_version(version): """Translate the LAMMPS version into something that can be used in a comparison""" items = [x for x in re.split('(\\d+)', version) if x] - if len(items) != 3: - raise ValueError("Version %s does not have 3 elements" % version) + if len(items) < 3: + raise ValueError("Version %s does not have (at least) 3 elements" % version) month_map = { "JAN": '01', "FEB": '02', @@ -198,6 +209,9 @@ def __init__(self, *args, **kwargs): for cc in KOKKOS_GPU_ARCH_TABLE.keys(): KOKKOS_GPU_ARCH_TABLE[cc] = KOKKOS_GPU_ARCH_TABLE[cc].lower().title() + self.kokkos_cpu_mapping = copy.deepcopy(KOKKOS_CPU_MAPPING) + self.update_kokkos_cpu_mapping() + @staticmethod def extra_options(**kwargs): """Custom easyconfig parameters for LAMMPS""" @@ -211,6 +225,15 @@ def extra_options(**kwargs): extra_vars['separate_build_dir'][0] = True return extra_vars + def update_kokkos_cpu_mapping(self): + + if LooseVersion(self.cur_version) >= LooseVersion(translate_lammps_version('31Mar2017')): + self.kokkos_cpu_mapping['neoverse_n1'] = 'ARMV81' + self.kokkos_cpu_mapping['neoverse_v1'] = 'ARMV81' + + if LooseVersion(self.cur_version) >= LooseVersion(translate_lammps_version('21sep2021')): + self.kokkos_cpu_mapping['a64fx'] = 'A64FX' + def prepare_step(self, *args, **kwargs): """Custom prepare step for LAMMPS.""" super(EB_LAMMPS, self).prepare_step(*args, **kwargs) @@ -278,6 +301,11 @@ def configure_step(self, **kwargs): else: self.cfg.update('configopts', with_opt + 'no') + if get_software_root('MDI'): + # Disable auto-downloading/building MDI dependency: + if '-DDOWNLOAD_MDI_DEFAULT=' not in self.cfg['configopts']: + self.cfg.update('configopts', '-DDOWNLOAD_MDI_DEFAULT=OFF') + # Disable auto-downloading/building Eigen dependency: if '-DDOWNLOAD_EIGEN3=' not in self.cfg['configopts']: self.cfg.update('configopts', '-DDOWNLOAD_EIGEN3=no') @@ -308,7 +336,10 @@ def configure_step(self, **kwargs): self.cfg.update('configopts', pkg_opt + 'on') # grab the architecture so we can check if we have Intel hardware (also used for Kokkos below) - processor_arch, gpu_arch = get_kokkos_arch(cuda_cc, self.cfg['kokkos_arch'], cuda=self.cuda) + processor_arch, gpu_arch = get_kokkos_arch(self.kokkos_cpu_mapping, + cuda_cc, + self.cfg['kokkos_arch'], + cuda=self.cuda) # arch names changed between some releases :( if LooseVersion(self.cur_version) < LooseVersion(self.ref_version): if processor_arch in KOKKOS_LEGACY_ARCH_MAPPING.keys(): @@ -428,6 +459,32 @@ def install_step(self): copy_dir(examples_dir, os.path.join(self.installdir, 'examples'), symlinks=True) potentials_dir = os.path.join(self.start_dir, 'potentials') copy_dir(potentials_dir, os.path.join(self.installdir, 'potentials')) + if LooseVersion(self.cur_version) >= LooseVersion(translate_lammps_version('2Aug2023')): + # From ver 2Aug2023: + # "make install in a CMake based installation will no longer install + # the LAMMPS python module. make install-python can be used for that" + # https://github.com/lammps/lammps/releases/tag/stable_2Aug2023 + pyshortver = '.'.join(get_software_version('Python').split('.')[:2]) + site_packages = os.path.join(self.installdir, 'lib', 'python%s' % pyshortver, 'site-packages') + + mkdir(site_packages, parents=True) + + self.lammpsdir = os.path.join(self.builddir, '%s-stable_%s' % (self.name.lower(), self.version)) + self.python_dir = os.path.join(self.lammpsdir, 'python') + + # The -i flag is added through a patch to the lammps source file python/install.py + # This patch is necessary because the current lammps only allows + # the lammps python package to be installed system-wide or in user site-packages + cmd = 'python %(python_dir)s/install.py -p %(python_dir)s/lammps \ + -l %(builddir)s/easybuild_obj/liblammps.so \ + -v %(lammpsdir)s/src/version.h -w %(builddir)s/easybuild_obj -i %(site_packages)s' % { + 'python_dir': self.python_dir, + 'builddir': self.builddir, + 'lammpsdir': self.lammpsdir, + 'site_packages': site_packages, + } + + run_cmd(cmd, log_all=True, simple=False) def sanity_check_step(self, *args, **kwargs): """Run custom sanity checks for LAMMPS files, dirs and commands.""" @@ -443,13 +500,19 @@ def sanity_check_step(self, *args, **kwargs): custom_commands = [ # LAMMPS test - you need to call specific test file on path - """python -c 'from lammps import lammps; l=lammps(); l.file("%s")'""" % + 'from lammps import lammps; l=lammps(); l.file("%s")' % # Examples are part of the install with paths like (installdir)/examples/filename/in.filename os.path.join(self.installdir, "examples", "%s" % check_file, "in.%s" % check_file) # And this should be done for every file specified above for check_file in check_files ] + # mpirun command needs an l.finalize() in the sanity check from LAMMPS 29Sep2021 + if LooseVersion(self.cur_version) >= LooseVersion(translate_lammps_version('29Sep2021')): + custom_commands = [cmd + '; l.finalize()' for cmd in custom_commands] + + custom_commands = ["""python -c '%s'""" % cmd for cmd in custom_commands] + # Execute sanity check commands within an initialized MPI in MPI enabled toolchains if self.toolchain.options.get('usempi', None): custom_commands = [self.toolchain.mpi_cmd_for(cmd, 1) for cmd in custom_commands] @@ -500,11 +563,11 @@ def get_cuda_gpu_arch(cuda_cc): return 'sm_%s' % str(sorted(cuda_cc, reverse=True)[0]).replace(".", "") -def get_kokkos_arch(cuda_cc, kokkos_arch, cuda=None): +def get_kokkos_arch(kokkos_cpu_mapping, cuda_cc, kokkos_arch, cuda=None): """ Return KOKKOS ARCH in LAMMPS required format, which is 'CPU_ARCH' and 'GPU_ARCH'. - see: https://lammps.sandia.gov/doc/Build_extras.html#kokkos + see: https://docs.lammps.org/Build_extras.html#kokkos """ if cuda is None or not isinstance(cuda, bool): cuda = get_software_root('CUDA') @@ -523,7 +586,7 @@ def get_kokkos_arch(cuda_cc, kokkos_arch, cuda=None): warning_msg = "kokkos_arch not set. Trying to auto-detect CPU arch." print_warning(warning_msg) - processor_arch = KOKKOS_CPU_MAPPING.get(get_cpu_arch()) + processor_arch = kokkos_cpu_mapping.get(get_cpu_arch()) if not processor_arch: error_msg = "Couldn't determine CPU architecture, you need to set 'kokkos_arch' manually." diff --git a/easybuild/easyblocks/l/lapack.py b/easybuild/easyblocks/l/lapack.py index b0322030b7..f2f3ce6705 100644 --- a/easybuild/easyblocks/l/lapack.py +++ b/easybuild/easyblocks/l/lapack.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/libdrm.py b/easybuild/easyblocks/l/libdrm.py index 5cc2786f69..dd3d2c2b87 100644 --- a/easybuild/easyblocks/l/libdrm.py +++ b/easybuild/easyblocks/l/libdrm.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/libint.py b/easybuild/easyblocks/l/libint.py index a5ff58df41..ea4f86cb78 100644 --- a/easybuild/easyblocks/l/libint.py +++ b/easybuild/easyblocks/l/libint.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -55,7 +55,8 @@ def extra_options(): def configure_step(self): """Add some extra configure options.""" - if LooseVersion(self.version) >= LooseVersion('2.6.0'): + self_version = LooseVersion(self.version) + if self_version >= '2.6.0': # Libint 2.6.0 requires first compiling the Libint compiler, # by running configure with appropriate options, followed by 'make export' # and unpacking the resulting source tarball; @@ -88,7 +89,7 @@ def configure_step(self): # Libint < 2.7.0 can be configured using configure script, # Libint >= 2.7.0 should be configured via cmake - if LooseVersion(self.version) < LooseVersion('2.7.0'): + if self_version < '2.7.0': # also build shared libraries (not enabled by default) self.cfg.update('configopts', "--enable-shared") @@ -97,14 +98,16 @@ def configure_step(self): # Enforce consistency. self.cfg.update('configopts', "--with-pic") - if LooseVersion(self.version) >= LooseVersion('2.0') and LooseVersion(self.version) < LooseVersion('2.1'): + if self_version >= '2.0' and self_version < '2.1': # the code in libint is automatically generated and hence it is in some # parts so complex that -O2 or -O3 compiler optimization takes forever self.cfg.update('configopts', "--with-cxx-optflags='-O1'") - elif LooseVersion(self.version) >= LooseVersion('2.1'): + elif self_version >= '2.1' and self_version < '2.6.0': # pass down $CXXFLAGS to --with-cxxgen-optflags configure option; # mainly to avoid warning about it not being set (but $CXXFLAGS is picked up anyway in practice) + # However this isn't required/supported anymore in the already generated "source", + # see the above creation of the LibInt compiler/library self.cfg.update('configopts', "--with-cxxgen-optflags='%s'" % os.getenv('CXXFLAGS')) # --enable-fortran is only a known configure option for Libint library, not for Libint compiler, diff --git a/easybuild/easyblocks/l/libqglviewer.py b/easybuild/easyblocks/l/libqglviewer.py index b126068ead..6c38a1103b 100644 --- a/easybuild/easyblocks/l/libqglviewer.py +++ b/easybuild/easyblocks/l/libqglviewer.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/libsmm.py b/easybuild/easyblocks/l/libsmm.py index 58d73cbb45..6010a7bb6c 100644 --- a/easybuild/easyblocks/l/libsmm.py +++ b/easybuild/easyblocks/l/libsmm.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/libxml2.py b/easybuild/easyblocks/l/libxml2.py index 10544c2db9..dd43089579 100644 --- a/easybuild/easyblocks/l/libxml2.py +++ b/easybuild/easyblocks/l/libxml2.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/llvm.py b/easybuild/easyblocks/l/llvm.py index 7b63296045..1193828e6f 100644 --- a/easybuild/easyblocks/l/llvm.py +++ b/easybuild/easyblocks/l/llvm.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/l/lua.py b/easybuild/easyblocks/l/lua.py index e77c44775c..a31ec8e107 100644 --- a/easybuild/easyblocks/l/lua.py +++ b/easybuild/easyblocks/l/lua.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mamba.py b/easybuild/easyblocks/m/mamba.py index c6cfd49e0b..232011e137 100644 --- a/easybuild/easyblocks/m/mamba.py +++ b/easybuild/easyblocks/m/mamba.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/maple.py b/easybuild/easyblocks/m/maple.py index 65868877ff..e10ab4d218 100644 --- a/easybuild/easyblocks/m/maple.py +++ b/easybuild/easyblocks/m/maple.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mathematica.py b/easybuild/easyblocks/m/mathematica.py index 6f18474490..4372c06f2d 100644 --- a/easybuild/easyblocks/m/mathematica.py +++ b/easybuild/easyblocks/m/mathematica.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/matlab.py b/easybuild/easyblocks/m/matlab.py index 7e5a7e54be..56475545cd 100644 --- a/easybuild/easyblocks/m/matlab.py +++ b/easybuild/easyblocks/m/matlab.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mcr.py b/easybuild/easyblocks/m/mcr.py index 7a420bd660..9b16706f4f 100644 --- a/easybuild/easyblocks/m/mcr.py +++ b/easybuild/easyblocks/m/mcr.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -158,8 +158,13 @@ def set_subdir(self): """Determine subdirectory in installation directory""" # no-op is self.subdir is already set if self.subdir is None: - # determine subdirectory (e.g. v84 (2014a, 2014b), v85 (2015a), ...) - subdirs = glob.glob(os.path.join(self.installdir, 'v[0-9][0-9]*')) + # determine subdirectory + if LooseVersion(self.version) < LooseVersion('R2022b'): + # (e.g. v84 (2014a, 2014b), v85 (2015a), ...) + subdirs = glob.glob(os.path.join(self.installdir, 'v[0-9][0-9]*')) + else: + # (e.g. R2023a, R2023b, ...) + subdirs = glob.glob(os.path.join(self.installdir, 'R[0-9][0-9][0-9][0-9]*')) if len(subdirs) == 1: self.subdir = os.path.basename(subdirs[0]) else: diff --git a/easybuild/easyblocks/m/mesa.py b/easybuild/easyblocks/m/mesa.py index b6d127361f..4a73625185 100644 --- a/easybuild/easyblocks/m/mesa.py +++ b/easybuild/easyblocks/m/mesa.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/metagenome_atlas.py b/easybuild/easyblocks/m/metagenome_atlas.py index 3658b5cfa6..2391595cee 100644 --- a/easybuild/easyblocks/m/metagenome_atlas.py +++ b/easybuild/easyblocks/m/metagenome_atlas.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/metavelvet.py b/easybuild/easyblocks/m/metavelvet.py index 57311202e1..4ffc693bb2 100644 --- a/easybuild/easyblocks/m/metavelvet.py +++ b/easybuild/easyblocks/m/metavelvet.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/m/metis.py b/easybuild/easyblocks/m/metis.py index 451ca67f84..d724630d91 100644 --- a/easybuild/easyblocks/m/metis.py +++ b/easybuild/easyblocks/m/metis.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/modeller.py b/easybuild/easyblocks/m/modeller.py index feb1876b16..d3dec47929 100755 --- a/easybuild/easyblocks/m/modeller.py +++ b/easybuild/easyblocks/m/modeller.py @@ -1,5 +1,5 @@ ## -# Copyright 2014-2023 Ghent University +# Copyright 2014-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of the University of Ghent (http://ugent.be/hpc). diff --git a/easybuild/easyblocks/m/molpro.py b/easybuild/easyblocks/m/molpro.py index 6cfdfa069d..e6f53ed1bc 100644 --- a/easybuild/easyblocks/m/molpro.py +++ b/easybuild/easyblocks/m/molpro.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mono.py b/easybuild/easyblocks/m/mono.py index 11b04cce53..c82f6a5303 100644 --- a/easybuild/easyblocks/m/mono.py +++ b/easybuild/easyblocks/m/mono.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mothur.py b/easybuild/easyblocks/m/mothur.py index bc14dd4cef..7e44bc7b4f 100644 --- a/easybuild/easyblocks/m/mothur.py +++ b/easybuild/easyblocks/m/mothur.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/motioncor2.py b/easybuild/easyblocks/m/motioncor2.py index 7b0c086a04..80daae592b 100644 --- a/easybuild/easyblocks/m/motioncor2.py +++ b/easybuild/easyblocks/m/motioncor2.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mpich.py b/easybuild/easyblocks/m/mpich.py index 05057f4ff2..95b9512bde 100644 --- a/easybuild/easyblocks/m/mpich.py +++ b/easybuild/easyblocks/m/mpich.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University, Forschungszentrum Juelich +# Copyright 2009-2024 Ghent University, Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mrbayes.py b/easybuild/easyblocks/m/mrbayes.py index ea7da301b5..5584122689 100644 --- a/easybuild/easyblocks/m/mrbayes.py +++ b/easybuild/easyblocks/m/mrbayes.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mrtrix.py b/easybuild/easyblocks/m/mrtrix.py index a676719c65..08ca57b013 100644 --- a/easybuild/easyblocks/m/mrtrix.py +++ b/easybuild/easyblocks/m/mrtrix.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/msm.py b/easybuild/easyblocks/m/msm.py index 1269e198ad..2f31dddabe 100644 --- a/easybuild/easyblocks/m/msm.py +++ b/easybuild/easyblocks/m/msm.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mtl4.py b/easybuild/easyblocks/m/mtl4.py index e788498643..a77b223c4b 100644 --- a/easybuild/easyblocks/m/mtl4.py +++ b/easybuild/easyblocks/m/mtl4.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mummer.py b/easybuild/easyblocks/m/mummer.py index a5038cb895..ee259fa0fc 100644 --- a/easybuild/easyblocks/m/mummer.py +++ b/easybuild/easyblocks/m/mummer.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of the University of Ghent (http://ugent.be/hpc). diff --git a/easybuild/easyblocks/m/mumps.py b/easybuild/easyblocks/m/mumps.py index d701f82de6..4cd1b71f00 100644 --- a/easybuild/easyblocks/m/mumps.py +++ b/easybuild/easyblocks/m/mumps.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mutil.py b/easybuild/easyblocks/m/mutil.py index bb0d8dc11b..7559a44ee6 100644 --- a/easybuild/easyblocks/m/mutil.py +++ b/easybuild/easyblocks/m/mutil.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mvapich2.py b/easybuild/easyblocks/m/mvapich2.py index 5810f227ac..a80bd8b8d2 100644 --- a/easybuild/easyblocks/m/mvapich2.py +++ b/easybuild/easyblocks/m/mvapich2.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University, Forschungszentrum Juelich +# Copyright 2009-2024 Ghent University, Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mxnet.py b/easybuild/easyblocks/m/mxnet.py index 8e52f3635d..016c5ebab8 100644 --- a/easybuild/easyblocks/m/mxnet.py +++ b/easybuild/easyblocks/m/mxnet.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Free University of Brussels (VUB) +# Copyright 2018-2024 Free University of Brussels (VUB) # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/m/mymedialite.py b/easybuild/easyblocks/m/mymedialite.py index 181ef9f051..5aeb784b86 100644 --- a/easybuild/easyblocks/m/mymedialite.py +++ b/easybuild/easyblocks/m/mymedialite.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/namd.py b/easybuild/easyblocks/n/namd.py index 301dfb5028..2fb826b4cf 100644 --- a/easybuild/easyblocks/n/namd.py +++ b/easybuild/easyblocks/n/namd.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2013-2023 CaSToRC, The Cyprus Institute +# Copyright:: Copyright 2013-2024 CaSToRC, The Cyprus Institute # Authors:: George Tsouloupas # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/n/nccl.py b/easybuild/easyblocks/n/nccl.py index e51707013f..ea9acc25f8 100644 --- a/easybuild/easyblocks/n/nccl.py +++ b/easybuild/easyblocks/n/nccl.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/ncl.py b/easybuild/easyblocks/n/ncl.py index ddc0b3cc99..3169ab86d1 100644 --- a/easybuild/easyblocks/n/ncl.py +++ b/easybuild/easyblocks/n/ncl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/ncurses.py b/easybuild/easyblocks/n/ncurses.py index 019d31b153..66176969aa 100644 --- a/easybuild/easyblocks/n/ncurses.py +++ b/easybuild/easyblocks/n/ncurses.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/n/nemo.py b/easybuild/easyblocks/n/nemo.py index bb6cfad970..f6ce8fca1d 100644 --- a/easybuild/easyblocks/n/nemo.py +++ b/easybuild/easyblocks/n/nemo.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/netcdf.py b/easybuild/easyblocks/n/netcdf.py index b1b0a41ed8..3d90c79540 100644 --- a/easybuild/easyblocks/n/netcdf.py +++ b/easybuild/easyblocks/n/netcdf.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/netcdf4_python.py b/easybuild/easyblocks/n/netcdf4_python.py index a78dab4f4b..c8bb096f62 100644 --- a/easybuild/easyblocks/n/netcdf4_python.py +++ b/easybuild/easyblocks/n/netcdf4_python.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/netcdf_fortran.py b/easybuild/easyblocks/n/netcdf_fortran.py index 9de127e0a0..3365cb837d 100644 --- a/easybuild/easyblocks/n/netcdf_fortran.py +++ b/easybuild/easyblocks/n/netcdf_fortran.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/neuron.py b/easybuild/easyblocks/n/neuron.py index cdad4158e5..fb462030fc 100644 --- a/easybuild/easyblocks/n/neuron.py +++ b/easybuild/easyblocks/n/neuron.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/nim.py b/easybuild/easyblocks/n/nim.py index 3ecc804cff..d54fdde56c 100644 --- a/easybuild/easyblocks/n/nim.py +++ b/easybuild/easyblocks/n/nim.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/nose.py b/easybuild/easyblocks/n/nose.py index 091f6a756d..d46223e7fa 100644 --- a/easybuild/easyblocks/n/nose.py +++ b/easybuild/easyblocks/n/nose.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/numexpr.py b/easybuild/easyblocks/n/numexpr.py index e5d192fff2..8d222b40dd 100644 --- a/easybuild/easyblocks/n/numexpr.py +++ b/easybuild/easyblocks/n/numexpr.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/numpy.py b/easybuild/easyblocks/n/numpy.py index 889faf9d2d..968cefa919 100644 --- a/easybuild/easyblocks/n/numpy.py +++ b/easybuild/easyblocks/n/numpy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/n/nvhpc.py b/easybuild/easyblocks/n/nvhpc.py index 6efc018a93..b70bfb66f9 100644 --- a/easybuild/easyblocks/n/nvhpc.py +++ b/easybuild/easyblocks/n/nvhpc.py @@ -1,6 +1,6 @@ ## -# Copyright 2015-2023 Bart Oldeman -# Copyright 2016-2023 Forschungszentrum Juelich +# Copyright 2015-2024 Bart Oldeman +# Copyright 2016-2024 Forschungszentrum Juelich # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. @@ -38,6 +38,7 @@ import re import stat import sys +import tempfile import platform from easybuild.tools import LooseVersion @@ -68,6 +69,14 @@ append LDLIBARGS=-L/usr/lib/x86_64-linux-gnu; """ +# contents for minimal example compiled in sanity check, used to catch issue +# seen in: https://github.com/easybuilders/easybuild-easyblocks/pull/3240 +NVHPC_MINIMAL_EXAMPLE = """ +#include + +int main(){ return 0; } +""" + class EB_NVHPC(PackedBinary): """ @@ -165,7 +174,8 @@ def install_step(self): sys.stdout.write(line) if LooseVersion(self.version) >= LooseVersion('22.9'): - cmd = "%s -x %s" % (makelocalrc_filename, compilers_subdir) + bin_subdir = os.path.join(compilers_subdir, "bin") + cmd = "%s -x %s" % (makelocalrc_filename, bin_subdir) else: cmd = "%s -x %s -g77 /" % (makelocalrc_filename, compilers_subdir) run_cmd(cmd, log_all=True, simple=True) @@ -202,7 +212,18 @@ def sanity_check_step(self): 'dirs': [os.path.join(prefix, 'compilers', 'bin'), os.path.join(prefix, 'compilers', 'lib'), os.path.join(prefix, 'compilers', 'include'), os.path.join(prefix, 'compilers', 'man')] } + custom_commands = ["%s -v" % compiler for compiler in compiler_names] + + if LooseVersion(self.version) >= LooseVersion('21'): + # compile minimal example using -std=c++20 to catch issue where it picks up the wrong GCC + # (as long as system gcc is < 9.0) + # see: https://github.com/easybuilders/easybuild-easyblocks/pull/3240 + tmpdir = tempfile.mkdtemp() + write_file(os.path.join(tmpdir, 'minimal.cpp'), NVHPC_MINIMAL_EXAMPLE) + minimal_compiler_cmd = "cd %s && nvc++ -std=c++20 minimal.cpp -o minimal" % tmpdir + custom_commands.append(minimal_compiler_cmd) + super(EB_NVHPC, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) def _nvhpc_extended_components(self, dirs, basepath, env_vars_dirs): diff --git a/easybuild/easyblocks/n/nwchem.py b/easybuild/easyblocks/n/nwchem.py index d60d019855..fb8e78b9a4 100644 --- a/easybuild/easyblocks/n/nwchem.py +++ b/easybuild/easyblocks/n/nwchem.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/ocaml.py b/easybuild/easyblocks/o/ocaml.py index 0a8d9c8172..875a0583ac 100644 --- a/easybuild/easyblocks/o/ocaml.py +++ b/easybuild/easyblocks/o/ocaml.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -86,7 +86,8 @@ def __init__(self, *args, **kwargs): def configure_step(self): """Custom configuration procedure for OCaml.""" self.cfg['prefix_opt'] = '-prefix ' - self.cfg.update('configopts', '-cc "%s %s"' % (os.environ['CC'], os.environ['CFLAGS'])) + if LooseVersion(self.version) < LooseVersion("4.12"): + self.cfg.update('configopts', '-cc "%s %s"' % (os.environ['CC'], os.environ['CFLAGS'])) if 'world.opt' not in self.cfg['buildopts']: self.cfg.update('buildopts', 'world.opt') diff --git a/easybuild/easyblocks/o/octave.py b/easybuild/easyblocks/o/octave.py index d810251351..f342303bb7 100644 --- a/easybuild/easyblocks/o/octave.py +++ b/easybuild/easyblocks/o/octave.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/openbabel.py b/easybuild/easyblocks/o/openbabel.py index 61e54e2cc5..420d54c9ce 100644 --- a/easybuild/easyblocks/o/openbabel.py +++ b/easybuild/easyblocks/o/openbabel.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/opencv.py b/easybuild/easyblocks/o/opencv.py index 538d7a7e29..b777f3bec3 100644 --- a/easybuild/easyblocks/o/opencv.py +++ b/easybuild/easyblocks/o/opencv.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/openfoam.py b/easybuild/easyblocks/o/openfoam.py index a13368c0ef..db69ddc569 100644 --- a/easybuild/easyblocks/o/openfoam.py +++ b/easybuild/easyblocks/o/openfoam.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -232,9 +232,9 @@ def configure_step(self): self.log.debug("Patching compiler variables in %s", fullpath) regex_subs = [] for comp_var, newval in comp_vars.items(): - regex_subs.append((r"^(%s\s*=\s*).*$" % re.escape(comp_var), r"\1%s" % newval)) + regex_subs.append((r"^(%s\s*(=|:=)\s*).*$" % re.escape(comp_var), r"\1%s" % newval)) # replace /lib/cpp by cpp, but keep the arguments - regex_subs.append((r"^(CPP\s*=\s*)/lib/cpp(.*)$", r"\1cpp\2")) + regex_subs.append((r"^(CPP\s*(=|:=)\s*)/lib/cpp(.*)$", r"\1cpp\2")) apply_regex_substitutions(fullpath, regex_subs) # enable verbose build for debug purposes @@ -495,7 +495,13 @@ def sanity_check_step(self): # only for recent (>= v6.0) versions of openfoam.org variant if self.is_dot_org and self.looseversion >= LooseVersion('6'): openfoamdir_path = os.path.join(self.installdir, self.openfoamdir) - motorbike_path = os.path.join(openfoamdir_path, 'tutorials', 'incompressible', 'simpleFoam', 'motorBike') + if self.looseversion <= LooseVersion('10'): + motorbike_path = os.path.join( + openfoamdir_path, 'tutorials', 'incompressible', 'simpleFoam', 'motorBike' + ) + else: + motorbike_path = os.path.join(openfoamdir_path, 'tutorials', 'incompressibleFluid', + 'motorBike', 'motorBike') if os.path.exists(motorbike_path): test_dir = tempfile.mkdtemp() @@ -503,28 +509,52 @@ def sanity_check_step(self): geom_target_dir = 'geometry' else: geom_target_dir = 'triSurface' + else: + raise EasyBuildError("motorBike tutorial not found at %s", motorbike_path) + if self.looseversion <= LooseVersion('10'): + cmds = [ + "cp -a %s %s" % (motorbike_path, test_dir), + # Make sure the tmpdir for tests ir writeable if read-only-installdir is used + "chmod -R +w %s" % test_dir, + "cd %s" % os.path.join(test_dir, os.path.basename(motorbike_path)), + "source $FOAM_BASH", + ". $WM_PROJECT_DIR/bin/tools/RunFunctions", + "cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/%s/" % geom_target_dir, + "runApplication surfaceFeatures", + "runApplication blockMesh", + "runApplication decomposePar -copyZero", + "runParallel snappyHexMesh -overwrite", + "runParallel patchSummary", + "runParallel potentialFoam", + "runParallel simpleFoam", + "runApplication reconstructParMesh -constant", + "runApplication reconstructPar -latestTime", + "cd %s" % self.builddir, + "rm -r %s" % test_dir, + ] + # v11 and above run the motorBike example differently + else: cmds = [ - "cp -a %s %s" % (motorbike_path, test_dir), - "cd %s" % os.path.join(test_dir, os.path.basename(motorbike_path)), - "source $FOAM_BASH", - ". $WM_PROJECT_DIR/bin/tools/RunFunctions", - "cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/%s/" % geom_target_dir, - "runApplication surfaceFeatures", - "runApplication blockMesh", - "runApplication decomposePar -copyZero", - "runParallel snappyHexMesh -overwrite", - "runParallel patchSummary", - "runParallel potentialFoam", - "runParallel simpleFoam", - "runApplication reconstructParMesh -constant", - "runApplication reconstructPar -latestTime", - "cd %s" % self.builddir, - "rm -r %s" % test_dir, + "cp -a %s %s" % (motorbike_path, test_dir), + # Make sure the tmpdir for tests ir writeable if read-only-installdir is used + "chmod -R +w %s" % os.path.join(test_dir, os.path.basename(motorbike_path)), + "cd %s" % os.path.join(test_dir, os.path.basename(motorbike_path)), + "source $FOAM_BASH", + ". $WM_PROJECT_DIR/bin/tools/RunFunctions", + "cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/%s/" % geom_target_dir, + "runApplication blockMesh", + "runApplication decomposePar -copyZero", + "find . -type f -iname '*level*' -exec rm {} \\;", + "runParallel renumberMesh -overwrite", + "runParallel potentialFoam -initialiseUBCs", + "runParallel simpleFoam", + "cd %s" % self.builddir, + "rm -r %s" % test_dir, ] - # all commands need to be run in a single shell command, - # because sourcing $FOAM_BASH sets up environment - custom_commands.append(' && '.join(cmds)) + # all commands need to be run in a single shell command, + # because sourcing $FOAM_BASH sets up environment + custom_commands.append(' && '.join(cmds)) super(EB_OpenFOAM, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) diff --git a/easybuild/easyblocks/o/openifs.py b/easybuild/easyblocks/o/openifs.py index 2fd8c5a137..f9aa48dfeb 100644 --- a/easybuild/easyblocks/o/openifs.py +++ b/easybuild/easyblocks/o/openifs.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/openmpi.py b/easybuild/easyblocks/o/openmpi.py index b60c01142c..8460aad58a 100644 --- a/easybuild/easyblocks/o/openmpi.py +++ b/easybuild/easyblocks/o/openmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -69,7 +69,10 @@ def config_opt_used(key, enable_opt=False): self.cfg.update('configopts', '--enable-%s' % key) # List of EasyBuild dependencies for which OMPI has known options - known_dependencies = ('CUDA', 'hwloc', 'libevent', 'libfabric', 'PMIx', 'UCX', 'UCC') + known_dependencies = ['CUDA', 'hwloc', 'libevent', 'libfabric', 'PMIx', 'UCX'] + if LooseVersion(self.version) >= '4.1.4': + known_dependencies.append('UCC') + # Value to use for `--with-=` if the dependency is not specified in the easyconfig # No entry is interpreted as no option added at all # This is to make builds reproducible even when the system libraries are changed and avoids failures diff --git a/easybuild/easyblocks/o/openssl.py b/easybuild/easyblocks/o/openssl.py index c84a6e065e..09daefcae7 100644 --- a/easybuild/easyblocks/o/openssl.py +++ b/easybuild/easyblocks/o/openssl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/o/openssl_wrapper.py b/easybuild/easyblocks/o/openssl_wrapper.py index aa4a5dd91c..247a018d62 100644 --- a/easybuild/easyblocks/o/openssl_wrapper.py +++ b/easybuild/easyblocks/o/openssl_wrapper.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Vrije Universiteit Brussel +# Copyright 2021-2024 Vrije Universiteit Brussel # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -30,6 +30,8 @@ import os import re +from urllib.parse import urlparse + from easybuild.tools import LooseVersion from easybuild.easyblocks.generic.bundle import Bundle @@ -71,13 +73,16 @@ def __init__(self, *args, **kwargs): """Locate the installation files of OpenSSL in the host system""" super(EB_OpenSSL_wrapper, self).__init__(*args, **kwargs) - # Wrapper should have at least a major minor version numbers - try: - subversions = self.version.split('.') - self.majmin_version = '%s.%s' % (subversions[0], subversions[1]) - except (AttributeError, IndexError): - err_msg = "Wrapper OpenSSL version does not have any subversion: %s" - raise EasyBuildError(err_msg, self.version) + # Wrapper should have at least a major minor version numbers for OpenSSL before version 3+ + if LooseVersion(self.version) >= LooseVersion('3') and self.version.count('.') == 0: + self.majmin_version = self.version + else: + try: + subversions = self.version.split('.') + self.majmin_version = '%s.%s' % (subversions[0], subversions[1]) + except (AttributeError, IndexError): + err_msg = "Wrapper OpenSSL version does not have any subversion: %s" + raise EasyBuildError(err_msg, self.version) # Set minimum OpenSSL version min_openssl_version = self.cfg.get('minimum_openssl_version') @@ -116,6 +121,10 @@ def __init__(self, *args, **kwargs): LINUX: ('so.3', ), DARWIN: ('3.dylib', ), }, + '3': { + LINUX: ('so.3', ), + DARWIN: ('3.dylib', ), + }, } os_type = get_os_type() @@ -140,6 +149,7 @@ def __init__(self, *args, **kwargs): '1.0': 'engines', '1.1': 'engines-1.1', '3.0': 'engines-3', + '3': 'engines-3', } self.target_ssl_engine = openssl_engines[self.majmin_version] @@ -368,10 +378,25 @@ def sanity_check_step(self): 'dirs': ssl_dirs, } + # use proxy to connect if https_proxy environment variable is defined + proxy_arg = '' + if os.environ.get('https_proxy'): + # only use host & port from https_proxy env var, that is, strip + # any protocol prefix and trailing slashes + proxy_parsed = urlparse(os.environ.get('https_proxy')) + if proxy_parsed.netloc: + proxy_arg = ' -proxy %s' % proxy_parsed.netloc + + if LooseVersion(self.version) >= LooseVersion('3') and self.version.count('.') == 0: + ssl_ver_comp_chars = 1 + else: + ssl_ver_comp_chars = 3 + custom_commands = [ # make sure that version mentioned in output of 'openssl version' matches version we are using - "ssl_ver=$(openssl version); [ ${ssl_ver:8:3} == '%s' ]" % self.majmin_version, - "echo | openssl s_client -connect github.com:443 -verify 9 | grep 'Verify return code: 0 (ok)'", + "ssl_ver=$(openssl version); [ ${ssl_ver:8:%s} == '%s' ]" % (ssl_ver_comp_chars, self.majmin_version), + ("echo | openssl s_client%s -connect github.com:443 -verify 9 " + "| grep 'Verify return code: 0 (ok)'" % proxy_arg), ] super(Bundle, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) diff --git a/easybuild/easyblocks/o/orca.py b/easybuild/easyblocks/o/orca.py index 3f08570d81..92b5bbdf54 100644 --- a/easybuild/easyblocks/o/orca.py +++ b/easybuild/easyblocks/o/orca.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Vrije Universiteit Brussel +# Copyright 2021-2024 Vrije Universiteit Brussel # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/palm.py b/easybuild/easyblocks/p/palm.py index 6674be5c7a..a3881d0719 100644 --- a/easybuild/easyblocks/p/palm.py +++ b/easybuild/easyblocks/p/palm.py @@ -1,5 +1,5 @@ ## -# Copyright 2023 Ghent University +# Copyright 2023-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/paraver.py b/easybuild/easyblocks/p/paraver.py index 08288d2721..4e4b9c6390 100644 --- a/easybuild/easyblocks/p/paraver.py +++ b/easybuild/easyblocks/p/paraver.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/parmetis.py b/easybuild/easyblocks/p/parmetis.py index 807ba8bd53..a728784cce 100644 --- a/easybuild/easyblocks/p/parmetis.py +++ b/easybuild/easyblocks/p/parmetis.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pasha.py b/easybuild/easyblocks/p/pasha.py index 7d1c87e81c..9634aad21f 100644 --- a/easybuild/easyblocks/p/pasha.py +++ b/easybuild/easyblocks/p/pasha.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pbdmpi.py b/easybuild/easyblocks/p/pbdmpi.py index 73e23b0ae5..d1f9b1b6f9 100644 --- a/easybuild/easyblocks/p/pbdmpi.py +++ b/easybuild/easyblocks/p/pbdmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pbdslap.py b/easybuild/easyblocks/p/pbdslap.py index f30d131ff4..1337c02f60 100644 --- a/easybuild/easyblocks/p/pbdslap.py +++ b/easybuild/easyblocks/p/pbdslap.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pdt.py b/easybuild/easyblocks/p/pdt.py index 253c2f5bbb..fc49b71047 100644 --- a/easybuild/easyblocks/p/pdt.py +++ b/easybuild/easyblocks/p/pdt.py @@ -1,7 +1,7 @@ ## # This is an easyblock for EasyBuild, see https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2015-2023 Juelich Supercomputing Centre, Germany +# Copyright:: Copyright 2015-2024 Juelich Supercomputing Centre, Germany # Authors:: Bernd Mohr # Markus Geimer # License:: 3-clause BSD diff --git a/easybuild/easyblocks/p/perl.py b/easybuild/easyblocks/p/perl.py index 93cc07d6ef..c4c0d430eb 100644 --- a/easybuild/easyblocks/p/perl.py +++ b/easybuild/easyblocks/p/perl.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/petsc.py b/easybuild/easyblocks/p/petsc.py index d5081d528a..0ec7aba421 100644 --- a/easybuild/easyblocks/p/petsc.py +++ b/easybuild/easyblocks/p/petsc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -237,10 +237,10 @@ def configure_step(self): inc_spec = "-include=[%s]" % ','.join(scotch_inc) # For some reason there is a v3 suffix added to libptscotchparmetis - # which is the reason for this new code. - req_scotch_libs = ['libesmumps.a', 'libptesmumps.a', 'libptscotch.a', - 'libptscotcherr.a', 'libptscotchparmetisv3.a', 'libscotch.a', - 'libscotcherr.a'] + # which is the reason for this new code; + # note: order matters here, don't sort these alphabetically! + req_scotch_libs = ['libptesmumps.a', 'libptscotchparmetisv3.a', 'libptscotch.a', + 'libptscotcherr.a', 'libesmumps.a', 'libscotch.a', 'libscotcherr.a'] scotch_libs = [os.path.join(scotch, "lib", x) for x in req_scotch_libs] lib_spec = "-lib=[%s]" % ','.join(scotch_libs) self.cfg.update('configopts', ' '.join([withdep + spec for spec in ['=1', inc_spec, lib_spec]])) @@ -257,6 +257,10 @@ def configure_step(self): ss_libs = ["UMFPACK", "KLU", "SPQR", "CHOLMOD", "BTF", "CCOLAMD", "COLAMD", "CXSparse", "LDL", "RBio", "SLIP_LU", "CAMD", "AMD"] + # SLIP_LU was replaced by SPEX in SuiteSparse >= 6.0 + if LooseVersion(get_software_version('SuiteSparse')) >= LooseVersion("6.0"): + ss_libs = [x if x != "SLIP_LU" else "SPEX" for x in ss_libs] + suitesparse_inc = os.path.join(suitesparse, "include") inc_spec = "-include=[%s]" % suitesparse_inc @@ -275,8 +279,9 @@ def configure_step(self): self.cfg.update('configopts', ' '.join([withdep + spec for spec in ['=1', inc_spec, lib_spec]])) # set PETSC_DIR for configure (env) and build_step - env.setvar('PETSC_DIR', self.cfg['start_dir']) - self.cfg.update('buildopts', 'PETSC_DIR=%s' % self.cfg['start_dir']) + petsc_dir = self.cfg['start_dir'].rstrip(os.path.sep) + env.setvar('PETSC_DIR', petsc_dir) + self.cfg.update('buildopts', 'PETSC_DIR=%s' % petsc_dir) if self.cfg['sourceinstall']: if self.petsc_arch: diff --git a/easybuild/easyblocks/p/pgi.py b/easybuild/easyblocks/p/pgi.py index 38e8076756..e8ad2b6670 100644 --- a/easybuild/easyblocks/p/pgi.py +++ b/easybuild/easyblocks/p/pgi.py @@ -1,6 +1,6 @@ ## -# Copyright 2015-2023 Bart Oldeman -# Copyright 2016-2023 Forschungszentrum Juelich +# Copyright 2015-2024 Bart Oldeman +# Copyright 2016-2024 Forschungszentrum Juelich # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/easyblocks/p/picard.py b/easybuild/easyblocks/p/picard.py index e49bc58ca0..15481fd40e 100644 --- a/easybuild/easyblocks/p/picard.py +++ b/easybuild/easyblocks/p/picard.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pplacer.py b/easybuild/easyblocks/p/pplacer.py index 8e85666dd6..3972d0e975 100644 --- a/easybuild/easyblocks/p/pplacer.py +++ b/easybuild/easyblocks/p/pplacer.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University +# Copyright 2016-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/primer3.py b/easybuild/easyblocks/p/primer3.py index 31995b2550..e2776b8e59 100644 --- a/easybuild/easyblocks/p/primer3.py +++ b/easybuild/easyblocks/p/primer3.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/psi.py b/easybuild/easyblocks/p/psi.py index 14324a2711..1779b59ec7 100644 --- a/easybuild/easyblocks/p/psi.py +++ b/easybuild/easyblocks/p/psi.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/psmpi.py b/easybuild/easyblocks/p/psmpi.py index f12b6aa5d9..6407edd82d 100644 --- a/easybuild/easyblocks/p/psmpi.py +++ b/easybuild/easyblocks/p/psmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2016-2023 Ghent University, Forschungszentrum Juelich +# Copyright 2016-2024 Ghent University, Forschungszentrum Juelich # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pybind11.py b/easybuild/easyblocks/p/pybind11.py index d964ffb9ac..e9c4e3df1e 100644 --- a/easybuild/easyblocks/p/pybind11.py +++ b/easybuild/easyblocks/p/pybind11.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pyquante.py b/easybuild/easyblocks/p/pyquante.py index 8bfaf5be3f..a7e93b35a2 100644 --- a/easybuild/easyblocks/p/pyquante.py +++ b/easybuild/easyblocks/p/pyquante.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index d01cf50ae8..0f42c6e41f 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -376,8 +376,6 @@ def configure_step(self): if tcltk_maj_min_ver != '.'.join(tkver.split('.')[:2]): raise EasyBuildError("Tcl and Tk major/minor versions don't match: %s vs %s", tclver, tkver) - self.cfg.update('configopts', "--with-tcltk-includes='-I%s/include -I%s/include'" % (tcl, tk)) - tcl_libdir = os.path.join(tcl, get_software_libdir('Tcl')) tk_libdir = os.path.join(tk, get_software_libdir('Tk')) tcltk_libs = "-L%(tcl_libdir)s -L%(tk_libdir)s -ltcl%(maj_min_ver)s -ltk%(maj_min_ver)s" % { @@ -385,7 +383,12 @@ def configure_step(self): 'tk_libdir': tk_libdir, 'maj_min_ver': tcltk_maj_min_ver, } - self.cfg.update('configopts', "--with-tcltk-libs='%s'" % tcltk_libs) + if LooseVersion(self.version) < '3.11': + self.cfg.update('configopts', "--with-tcltk-includes='-I%s/include -I%s/include'" % (tcl, tk)) + self.cfg.update('configopts', "--with-tcltk-libs='%s'" % tcltk_libs) + else: + env.setvar('TCLTK_CFLAGS', '-I%s/include -I%s/include' % (tcl, tk)) + env.setvar('TCLTK_LIBS', tcltk_libs) # don't add user site directory to sys.path (equivalent to python -s) # This matters e.g. when python installs the bundled pip & setuptools (for >= 3.4) diff --git a/easybuild/easyblocks/p/python_meep.py b/easybuild/easyblocks/p/python_meep.py index 106d31392a..3ae46d996b 100644 --- a/easybuild/easyblocks/p/python_meep.py +++ b/easybuild/easyblocks/p/python_meep.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/p/pytorch.py b/easybuild/easyblocks/p/pytorch.py index ec9b40a5ee..495f49bc86 100644 --- a/easybuild/easyblocks/p/pytorch.py +++ b/easybuild/easyblocks/p/pytorch.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 Ghent University +# Copyright 2020-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -30,6 +30,7 @@ import os import re +import sys import tempfile import easybuild.tools.environment as env from easybuild.tools import LooseVersion @@ -42,6 +43,164 @@ from easybuild.tools.systemtools import POWER, get_cpu_architecture +if sys.version_info >= (3, 9): + from typing import NamedTuple + FailedTestNames = NamedTuple('FailedTestNames', [('error', list[str]), ('fail', list[str])]) + TestSuiteResult = NamedTuple('TestSuiteResult', [('name', str), ('summary', str)]) + TestResult = NamedTuple('TestResult', [('test_cnt', int), + ('error_cnt', int), + ('failure_cnt', int), + ('failed_suites', list[TestSuiteResult])]) +else: + from collections import namedtuple + FailedTestNames = namedtuple('FailedTestNames', ('error', 'fail')) + TestSuiteResult = namedtuple('TestSuiteResult', ('name', 'summary')) + TestResult = namedtuple('TestResult', ('test_cnt', 'error_cnt', 'failure_cnt', 'failed_suites')) + + +def find_failed_test_names(tests_out): + """Find failed names of failed test cases in the output of the test step + + Return sorted list of names in FailedTestNames tuple + """ + # patterns like + # === FAIL: test_add_scalar_relu (quantization.core.test_quantized_op.TestQuantizedOps) === + # --- ERROR: test_all_to_all_group_cuda (__main__.TestDistBackendWithSpawn) --- + regex = r"^[=-]+\n(FAIL|ERROR): (test_.*?)\s\(.*\n[=-]+\n" + failed_test_cases = re.findall(regex, tests_out, re.M) + # And patterns like: + # FAILED test_ops_gradients.py::TestGradientsCPU::test_fn_grad_linalg_det_singular_cpu_complex128 - [snip] + # FAILED [22.8699s] test_sparse_csr.py::TestSparseCompressedCPU::test_invalid_input_csr_large_cpu - [snip] + # FAILED [0.0623s] dynamo/test_dynamic_shapes.py::DynamicShapesExportTests::test_predispatch - [snip] + regex = r"^(FAILED) (?:\[.*?\] )?(?:\w|/)+\.py.*::(test_.*?) - " + failed_test_cases.extend(re.findall(regex, tests_out, re.M)) + return FailedTestNames(error=sorted(m[1] for m in failed_test_cases if m[0] == 'ERROR'), + fail=sorted(m[1] for m in failed_test_cases if m[0] != 'ERROR')) + + +def parse_test_log(tests_out): + """Parse the test output and return result as TestResult tuple""" + + def get_count_for_pattern(regex, text): + """Match the regexp containing a single group and return the integer value of the matched group. + Return zero if no or more than 1 match was found and warn for the latter case + """ + match = re.findall(regex, text) + if len(match) == 1: + return int(match[0]) + elif len(match) > 1: + # Shouldn't happen, but means something went wrong with the regular expressions. + # Throw warning, as the build might be fine, no need to error on this. + warn_msg = "Error in counting the number of test failures in the output of the PyTorch test suite.\n" + warn_msg += "Please check the EasyBuild log to verify the number of failures (if any) was acceptable." + print_warning(warn_msg) + return 0 + + failure_cnt = 0 + error_cnt = 0 + failed_suites = [] + + # Remove empty lines to make RegExs below simpler + tests_out = re.sub(r'^[ \t]*\n', '', tests_out, flags=re.MULTILINE) + + # Grep for patterns like: + # Ran 219 tests in 67.325s + # + # FAILED (errors=10, skipped=190, expected failures=6) + # test_fx failed! + regex = (r"^Ran (?P[0-9]+) tests.*$\n" + r"FAILED \((?P.*)\)$\n" + r"(?:^(?:(?!failed!).)*$\n){0,5}" + r"(?P.*) failed!(?: Received signal: \w+)?\s*$") + + for m in re.finditer(regex, tests_out, re.M): + # E.g. 'failures=3, errors=10, skipped=190, expected failures=6' + failure_summary = m.group('failure_summary') + total, test_suite = m.group('test_cnt', 'failed_test_suite_name') + failed_suites.append( + TestSuiteResult(test_suite, "{total} total tests, {failure_summary}".format( + total=total, failure_summary=failure_summary)) + ) + failure_cnt += get_count_for_pattern(r"(?.*) in [0-9]+\.*[0-9]*[a-zA-Z]* (\([0-9]+:[0-9]+:[0-9]+\) )?=+$\n" + r"(?:.*skip info is located in the xml test reports.*\n)?" + r"(?:.*FINISHED PRINTING LOG FILE.*\n)?" + r"(?P.*) failed!$" + ) + + for m in re.finditer(regex, tests_out, re.M): + # E.g. '2 failed, 128 passed, 2 skipped, 2 warnings' + failure_summary = m.group('failure_summary') + test_suite = m.group('failed_test_suite_name') + failed_suites.append(TestSuiteResult(test_suite, failure_summary)) + failure_cnt += get_count_for_pattern(r"([0-9]+) failed", failure_summary) + error_cnt += get_count_for_pattern(r"([0-9]+) error", failure_summary) + + # Grep for patterns like: + # AssertionError: 2 unit test(s) failed: + # DistributedDataParallelTest.test_find_unused_parameters_kwarg_debug_detail + # DistributedDataParallelTest.test_find_unused_parameters_kwarg_grad_is_view_debug_detail + # + # FINISHED PRINTING LOG FILE of distributed/test_c10d_nccl () + # + # distributed/test_c10d_nccl failed! + + regex = ( + r"^AssertionError: (?P[0-9]+ unit test\(s\) failed):\n" + r"(\s+.*\n)+" + r"(((?!failed!).)*\n){0,5}" + r"(?P.*) failed!$" + ) + + for m in re.finditer(regex, tests_out, re.M): + # E.g. '2 unit test(s) failed' + failure_summary = m.group('failure_summary') + test_suite = m.group('failed_test_suite_name') + failed_suites.append(TestSuiteResult(test_suite, failure_summary)) + failure_cnt += get_count_for_pattern(r"([0-9]+) unit test\(s\) failed", failure_summary) + + # Collect total number of tests + + # Pattern for tests ran with unittest like: + # Ran 3 tests in 0.387s + regex = r"^Ran (?P[0-9]+) tests in" + test_cnt = sum(int(hit) for hit in re.findall(regex, tests_out, re.M)) + # Pattern for tests ran with pytest like: + # ============ 286 passed, 18 skipped, 2 xfailed in 38.71s ============ + regex = r"=+ (?P.*) in \d+.* =+\n" + count_patterns = [re.compile(r"([0-9]+) " + reason) for reason in [ + "failed", + "passed", + "skipped", + "deselected", + "xfailed", + "xpassed", + ]] + for m in re.finditer(regex, tests_out, re.M): + test_cnt += sum(get_count_for_pattern(p, m.group("summary")) for p in count_patterns) + + return TestResult(test_cnt=test_cnt, error_cnt=error_cnt, failure_cnt=failure_cnt, failed_suites=failed_suites) + + class EB_PyTorch(PythonPackage): """Support for building/installing PyTorch.""" @@ -56,6 +215,10 @@ def extra_options(): }) extra_vars['download_dep_fail'][0] = True extra_vars['sanity_pip_check'][0] = True + # Make pip show output of build process as that may often contain errors or important warnings + extra_vars['pip_verbose'][0] = True + # Test as-if pytorch was installed + extra_vars['testinstall'][0] = True return extra_vars @@ -63,8 +226,7 @@ def __init__(self, *args, **kwargs): """Constructor for PyTorch easyblock.""" super(EB_PyTorch, self).__init__(*args, **kwargs) self.options['modulename'] = 'torch' - # Test as-if pytorch was installed - self.testinstall = True + self.tmpdir = tempfile.mkdtemp(suffix='-pytorch-build') def fetch_step(self, skip_checksums=False): @@ -145,9 +307,12 @@ def configure_step(self): # Gather default options. Will be checked against (and can be overwritten by) custom_opts options = ['PYTORCH_BUILD_VERSION=' + self.version, 'PYTORCH_BUILD_NUMBER=1'] + def add_enable_option(name, enabled): + """Add `name=0` or `name=1` depending on enabled""" + options.append('%s=%s' % (name, '1' if enabled else '0')) + # enable verbose mode when --debug is used (to show compiler commands) - if build_option('debug'): - options.append('VERBOSE=1') + add_enable_option('VERBOSE', build_option('debug')) # Restrict parallelism options.append('MAX_JOBS=%s' % self.cfg['parallel']) @@ -224,12 +389,20 @@ def configure_step(self): # Disable CUDA options.append('USE_CUDA=0') + if pytorch_version >= '2.0': + add_enable_option('USE_ROCM', get_software_root('ROCm')) + elif pytorch_version >= 'v1.10.0': + add_enable_option('USE_MAGMA', get_software_root('magma')) + if get_cpu_architecture() == POWER: # *NNPACK is not supported on Power, disable to avoid warnings options.extend(['USE_NNPACK=0', 'USE_QNNPACK=0', 'USE_PYTORCH_QNNPACK=0', 'USE_XNNPACK=0']) # Breakpad (Added in 1.10, removed in 1.12.0) doesn't support PPC if pytorch_version >= '1.10.0' and pytorch_version < '1.12.0': options.append('USE_BREAKPAD=0') + # FBGEMM requires AVX512, so not available on PPC + if pytorch_version >= 'v1.10.0': + options.append('USE_FBGEMM=0') # Metal only supported on IOS which likely doesn't work with EB, so disabled options.append('USE_METAL=0') @@ -281,126 +454,21 @@ def test_step(self): tests_out, tests_ec = test_result # Show failed subtests to aid in debugging failures - # I.e. patterns like - # === FAIL: test_add_scalar_relu (quantization.core.test_quantized_op.TestQuantizedOps) === - # --- ERROR: test_all_to_all_group_cuda (__main__.TestDistBackendWithSpawn) --- - regex = r"^[=-]+\n(FAIL|ERROR): (test_.*?)\s\(.*\n[=-]+\n" - failed_test_cases = re.findall(regex, tests_out, re.M) - # And patterns like: - # FAILED test_ops_gradients.py::TestGradientsCPU::test_fn_grad_linalg_det_singular_cpu_complex128 - [snip] - # FAILED [22.8699s] test_sparse_csr.py::TestSparseCompressedCPU::test_invalid_input_csr_large_cpu - [snip] - # FAILED [0.0623s] dynamo/test_dynamic_shapes.py::DynamicShapesExportTests::test_predispatch - [snip] - regex = r"^(FAILED) (?:\[.*?\] )?(?:\w|/)+\.py.*::(test_.*?) - " - failed_test_cases.extend(re.findall(regex, tests_out, re.M)) - if failed_test_cases: - errored_test_cases = sorted(m[1] for m in failed_test_cases if m[0] == 'ERROR') - failed_test_cases = sorted(m[1] for m in failed_test_cases if m[0] != 'ERROR') + failed_test_names = find_failed_test_names(tests_out) + if failed_test_names.error or failed_test_names.fail: msg = [] - if errored_test_cases: + if failed_test_names.error: msg.append("Found %d individual tests that exited with an error: %s" - % (len(errored_test_cases), ', '.join(errored_test_cases))) - if failed_test_cases: + % (len(failed_test_names.error), ', '.join(failed_test_names.error))) + if failed_test_names.fail: msg.append("Found %d individual tests with failed assertions: %s" - % (len(failed_test_cases), ', '.join(failed_test_cases))) + % (len(failed_test_names.fail), ', '.join(failed_test_names.fail))) self.log.warning("\n".join(msg)) - def get_count_for_pattern(regex, text): - """Match the regexp containing a single group and return the integer value of the matched group. - Return zero if no or more than 1 match was found and warn for the latter case - """ - match = re.findall(regex, text) - if len(match) == 1: - return int(match[0]) - elif len(match) > 1: - # Shouldn't happen, but means something went wrong with the regular expressions. - # Throw warning, as the build might be fine, no need to error on this. - warn_msg = "Error in counting the number of test failures in the output of the PyTorch test suite.\n" - warn_msg += "Please check the EasyBuild log to verify the number of failures (if any) was acceptable." - print_warning(warn_msg) - return 0 - # Create clear summary report - failure_report = [] - failure_cnt = 0 - error_cnt = 0 - failed_test_suites = [] - - # Grep for patterns like: - # Ran 219 tests in 67.325s - # - # FAILED (errors=10, skipped=190, expected failures=6) - # test_fx failed! - regex = (r"^Ran (?P[0-9]+) tests.*$\n\n" - r"FAILED \((?P.*)\)$\n" - r"(?:^(?:(?!failed!).)*$\n){0,5}" - r"(?P.*) failed!(?: Received signal: \w+)?\s*$") - - for m in re.finditer(regex, tests_out, re.M): - # E.g. 'failures=3, errors=10, skipped=190, expected failures=6' - failure_summary = m.group('failure_summary') - total, test_suite = m.group('test_cnt', 'failed_test_suite_name') - failure_report.append("{test_suite} ({total} total tests, {failure_summary})".format( - test_suite=test_suite, total=total, failure_summary=failure_summary - )) - failure_cnt += get_count_for_pattern(r"(?.*) in [0-9]+\.*[0-9]*[a-zA-Z]* (\([0-9]+:[0-9]+:[0-9]+\) )?=+$\n" - r"(?:.*FINISHED PRINTING LOG FILE.*\n)?" - r"(?:^\s*\n)*" - r"(?P.*) failed!$" - ) - - for m in re.finditer(regex, tests_out, re.M): - # E.g. '2 failed, 128 passed, 2 skipped, 2 warnings' - failure_summary = m.group('failure_summary') - test_suite = m.group('failed_test_suite_name') - failure_report.append("{test_suite} ({failure_summary})".format( - test_suite=test_suite, failure_summary=failure_summary - )) - failure_cnt += get_count_for_pattern(r"([0-9]+) failed", failure_summary) - error_cnt += get_count_for_pattern(r"([0-9]+) error", failure_summary) - failed_test_suites.append(test_suite) - - # Grep for patterns like: - # AssertionError: 2 unit test(s) failed: - # DistributedDataParallelTest.test_find_unused_parameters_kwarg_debug_detail - # DistributedDataParallelTest.test_find_unused_parameters_kwarg_grad_is_view_debug_detail - # - # FINISHED PRINTING LOG FILE of distributed/test_c10d_nccl () - # - # distributed/test_c10d_nccl failed! - - regex = ( - r"^AssertionError: (?P[0-9]+ unit test\(s\) failed):\n" - r"(\s+.*\n)+" - r"(((?!failed!).)*\n){0,5}" - r"(?P.*) failed!$" - ) - - for m in re.finditer(regex, tests_out, re.M): - # E.g. '2 unit test(s) failed' - failure_summary = m.group('failure_summary') - test_suite = m.group('failed_test_suite_name') - failure_report.append("{test_suite} ({failure_summary})".format( - test_suite=test_suite, failure_summary=failure_summary - )) - failure_cnt += get_count_for_pattern(r"([0-9]+) unit test\(s\) failed", failure_summary) - failed_test_suites.append(test_suite) - - # Make the names unique - failed_test_suites = set(failed_test_suites) + test_result = parse_test_log(tests_out) + failure_report = ['%s (%s)' % (suite.name, suite.summary) for suite in test_result.failed_suites] + failed_test_suites = set(suite.name for suite in test_result.failed_suites) # Gather all failed tests suites in case we missed any (e.g. when it exited due to syntax errors) # Also unique to be able to compare the lists below all_failed_test_suites = set( @@ -417,32 +485,17 @@ def get_count_for_pattern(regex, text): failure_report = '\n'.join(failure_report) # Calculate total number of unsuccesful and total tests - failed_test_cnt = failure_cnt + error_cnt - # Pattern for tests ran with unittest like: - # Ran 3 tests in 0.387s - regex = r"^Ran (?P[0-9]+) tests in" - test_cnt = sum(int(hit) for hit in re.findall(regex, tests_out, re.M)) - # Pattern for tests ran with pytest like: - # ============ 286 passed, 18 skipped, 2 xfailed in 38.71s ============ - regex = r"=+ (?P.*) in \d+.* =+\n" - count_patterns = [re.compile(r"([0-9]+) " + reason) for reason in [ - "failed", - "passed", - "skipped", - "deselected", - "xfailed", - "xpassed", - ]] - for m in re.finditer(regex, tests_out, re.M): - test_cnt += sum(get_count_for_pattern(p, m.group("summary")) for p in count_patterns) + failed_test_cnt = test_result.failure_cnt + test_result.error_cnt if failed_test_cnt > 0: max_failed_tests = self.cfg['max_failed_tests'] - failure_or_failures = 'failure' if failure_cnt == 1 else 'failures' - error_or_errors = 'error' if error_cnt == 1 else 'errors' + failure_or_failures = 'failure' if test_result.failure_cnt == 1 else 'failures' + error_or_errors = 'error' if test_result.error_cnt == 1 else 'errors' msg = "%d test %s, %d test %s (out of %d):\n" % ( - failure_cnt, failure_or_failures, error_cnt, error_or_errors, test_cnt + test_result.failure_cnt, failure_or_failures, + test_result.error_cnt, error_or_errors, + test_result.test_cnt ) msg += failure_report @@ -468,7 +521,7 @@ def get_count_for_pattern(regex, text): raise EasyBuildError("Too many failed tests (%d), maximum allowed is %d", failed_test_cnt, max_failed_tests) elif failure_report: - raise EasyBuildError("Test command had non-zero exit code (%s)!\n%s", tests_ec, failure_report) + raise EasyBuildError("Test ended with failures! Exit code: %s\n%s", tests_ec, failure_report) elif tests_ec: raise EasyBuildError("Test command had non-zero exit code (%s), but no failed tests found?!", tests_ec) @@ -500,3 +553,21 @@ def make_module_req_guess(self): # Required to dynamically load libcaffe2_nvrtc.so guesses['LD_LIBRARY_PATH'] = [os.path.join(self.pylibdir, 'torch', 'lib')] return guesses + + +if __name__ == '__main__': + arg = sys.argv[1] + if not os.path.isfile(arg): + raise RuntimeError('Expected a test result file to parse, got: ' + arg) + with open(arg, 'r') as f: + content = f.read() + m = re.search(r'cmd .*python[^ ]* run_test\.py .* exited with exit code.*output', content) + if m: + content = content[m.end():] + # Heuristic for next possible text added by EasyBuild + m = re.search(r'^== \d+-\d+-\d+ .* (pytorch\.py|EasyBuild)', content) + if m: + content = content[:m.start()] + + print("Failed test names: ", find_failed_test_names(content)) + print("Test result: ", parse_test_log(content)) diff --git a/easybuild/easyblocks/p/pyzmq.py b/easybuild/easyblocks/p/pyzmq.py index 8007d936bb..34911c3d56 100644 --- a/easybuild/easyblocks/p/pyzmq.py +++ b/easybuild/easyblocks/p/pyzmq.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/q/qscintilla.py b/easybuild/easyblocks/q/qscintilla.py index ef98de5df6..0034c35967 100644 --- a/easybuild/easyblocks/q/qscintilla.py +++ b/easybuild/easyblocks/q/qscintilla.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/q/qt.py b/easybuild/easyblocks/q/qt.py index 2cace72e0c..1eb3f90970 100644 --- a/easybuild/easyblocks/q/qt.py +++ b/easybuild/easyblocks/q/qt.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/q/quantumespresso.py b/easybuild/easyblocks/q/quantumespresso.py index 15d00f53d0..83016ec82f 100644 --- a/easybuild/easyblocks/q/quantumespresso.py +++ b/easybuild/easyblocks/q/quantumespresso.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -27,26 +27,31 @@ @author: Kenneth Hoste (Ghent University) @author: Ake Sandgren (HPC2N, Umea University) +@author: Davide Grassano (CECAM, EPFL) """ import fileinput import os import re import shutil import sys -from easybuild.tools import LooseVersion import easybuild.tools.environment as env import easybuild.tools.toolchain as toolchain -from easybuild.easyblocks.generic.configuremake import ConfigureMake from easybuild.framework.easyconfig import CUSTOM +from easybuild.tools import LooseVersion from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import copy_dir, copy_file from easybuild.tools.modules import get_software_root, get_software_version +from easybuild.tools.run import run_cmd + +from easybuild.easyblocks.generic.configuremake import ConfigureMake class EB_QuantumESPRESSO(ConfigureMake): """Support for building and installing Quantum ESPRESSO.""" + TEST_SUITE_DIR = "test-suite" + @staticmethod def extra_options(): """Custom easyconfig parameters for Quantum ESPRESSO.""" @@ -54,6 +59,28 @@ def extra_options(): 'hybrid': [False, "Enable hybrid build (with OpenMP)", CUSTOM], 'with_scalapack': [True, "Enable ScaLAPACK support", CUSTOM], 'with_ace': [False, "Enable Adaptively Compressed Exchange support", CUSTOM], + 'with_fox': [False, "Enable FoX support", CUSTOM], + 'with_epw': [True, "Enable EPW support", CUSTOM], + 'with_gipaw': [True, "Enable GIPAW support", CUSTOM], + 'with_wannier90': [False, "Enable Wannier90 support", CUSTOM], + 'test_suite_targets': [[ + "pw", "pp", "ph", "cp", "hp", "tddfpt", "epw", + ], "List of test suite targets to run", CUSTOM], + 'test_suite_allow_failures': [[ + 'relax', # Too strict thresholds + 'epw_polar', # Too strict thresholds + 'cp_h2o_scan_libxc', # Too strict thresholds + 'hp_metal_us_magn', # Too strict thresholds + 'hp_soc_UV_paw_magn', # In 7.3 test has more params than the baseline + 'ph_ahc_diam', # Test detects a ! as an energy in baseline + 'tddfpt_magnons_fe', # Too strict thresholds + ], "List of test suite targets that are allowed to fail (name can partially match)", CUSTOM], + 'test_suite_threshold': [ + 0.97, + "Threshold for test suite success rate (does count also allowed failures)", + CUSTOM + ], + 'test_suite_max_failed': [0, "Maximum number of failing tests (does not count allowed failures)", CUSTOM], } return ConfigureMake.extra_options(extra_vars) @@ -61,185 +88,355 @@ def __init__(self, *args, **kwargs): """Add extra config options specific to Quantum ESPRESSO.""" super(EB_QuantumESPRESSO, self).__init__(*args, **kwargs) - if LooseVersion(self.version) >= LooseVersion("6"): - self.install_subdir = "qe-%s" % self.version - else: - self.install_subdir = "espresso-%s" % self.version + self.install_subdir = "qe-%s" % self.version def patch_step(self): """Patch files from build dir (not start dir).""" super(EB_QuantumESPRESSO, self).patch_step(beginpath=self.builddir) - def configure_step(self): - """Custom configuration procedure for Quantum ESPRESSO.""" - - # compose list of DFLAGS (flag, value, keep_stuff) - # for guidelines, see include/defs.h.README in sources - dflags = [] - - repls = [] - - extra_libs = [] - - comp_fam_dflags = { - toolchain.INTELCOMP: '-D__INTEL', - toolchain.GCC: '-D__GFORTRAN -D__STD_F95', - } - comp_fam = self.toolchain.comp_family() - if comp_fam in comp_fam_dflags: - dflags.append(comp_fam_dflags[comp_fam]) - else: + def _add_compiler_flags(self, comp_fam): + """Add compiler flags to the build.""" + allowed_toolchains = [toolchain.INTELCOMP, toolchain.GCC] + if comp_fam not in allowed_toolchains: raise EasyBuildError("EasyBuild does not yet have support for QuantumESPRESSO with toolchain %s" % comp_fam) + if LooseVersion(self.version) >= LooseVersion("6.1"): + if comp_fam == toolchain.INTELCOMP: + self.dflags += ["-D__INTEL_COMPILER"] + elif comp_fam == toolchain.GCC: + self.dflags += ["-D__GFORTRAN__"] + elif LooseVersion(self.version) >= LooseVersion("5.2.1"): + if comp_fam == toolchain.INTELCOMP: + self.dflags += ["-D__INTEL"] + elif comp_fam == toolchain.GCC: + self.dflags += ["-D__GFORTRAN"] + elif LooseVersion(self.version) >= LooseVersion("5.0"): + if comp_fam == toolchain.INTELCOMP: + self.dflags += ["-D__INTEL"] + elif comp_fam == toolchain.GCC: + self.dflags += ["-D__GFORTRAN", "-D__STD_F95"] + + def _add_openmp(self): + """Add OpenMP support to the build.""" if self.toolchain.options.get('openmp', False) or self.cfg['hybrid']: self.cfg.update('configopts', '--enable-openmp') - dflags.append(" -D__OPENMP") - - if self.toolchain.options.get('usempi', None): - dflags.append('-D__MPI -D__PARA') - else: + if LooseVersion(self.version) >= LooseVersion("6.2.1"): + self.dflags += ["-D_OPENMP"] + elif LooseVersion(self.version) >= LooseVersion("5.0"): + self.dflags += ["-D__OPENMP"] + + def _add_mpi(self): + """Add MPI support to the build.""" + if not self.toolchain.options.get('usempi', False): self.cfg.update('configopts', '--disable-parallel') - - if self.cfg['with_scalapack']: - dflags.append(" -D__SCALAPACK") - if self.toolchain.options.get('usempi', None): - if get_software_root("impi") and get_software_root("imkl"): - self.cfg.update('configopts', '--with-scalapack=intel') else: + self.cfg.update('configopts', '--enable-parallel') + if LooseVersion(self.version) >= LooseVersion("6.0"): + self.dflags += ["-D__MPI"] + elif LooseVersion(self.version) >= LooseVersion("5.0"): + self.dflags += ["-D__MPI", "-D__PARA"] + + def _add_scalapack(self, comp_fam): + """Add ScaLAPACK support to the build.""" + if not self.cfg['with_scalapack']: self.cfg.update('configopts', '--without-scalapack') + else: + if comp_fam == toolchain.INTELCOMP: + if get_software_root("impi") and get_software_root("imkl"): + if LooseVersion(self.version) >= LooseVersion("6.2"): + self.cfg.update('configopts', '--with-scalapack=intel') + elif LooseVersion(self.version) >= LooseVersion("5.1.1"): + self.cfg.update('configopts', '--with-scalapack=intel') + self.repls += [ + ('SCALAPACK_LIBS', os.getenv('LIBSCALAPACK'), False) + ] + elif LooseVersion(self.version) >= LooseVersion("5.0"): + self.cfg.update('configopts', '--with-scalapack=yes') + self.dflags += ["-D__SCALAPACK"] + elif comp_fam == toolchain.GCC: + if get_software_root("OpenMPI") and get_software_root("ScaLAPACK"): + self.cfg.update('configopts', '--with-scalapack=yes') + self.dflags += ["-D__SCALAPACK"] + else: + self.cfg.update('configopts', '--without-scalapack') + def _add_libxc(self): + """Add libxc support to the build.""" libxc = get_software_root("libxc") if libxc: libxc_v = get_software_version("libxc") if LooseVersion(libxc_v) < LooseVersion("3.0.1"): raise EasyBuildError("Must use libxc >= 3.0.1") - dflags.append(" -D__LIBXC") - repls.append(('IFLAGS', '-I%s' % os.path.join(libxc, 'include'), True)) - if LooseVersion(self.version) < LooseVersion("6.5"): - extra_libs.append(" -lxcf90 -lxc") + if LooseVersion(self.version) >= LooseVersion("7.0"): + if LooseVersion(libxc_v) < LooseVersion("4"): + raise EasyBuildError("libxc support for QuantumESPRESSO 7.x only available for libxc >= 4") + self.cfg.update('configopts', '--with-libxc=yes') + self.cfg.update('configopts', '--with-libxc-prefix=%s' % libxc) + elif LooseVersion(self.version) >= LooseVersion("6.6"): + if LooseVersion(libxc_v) >= LooseVersion("6.0"): + raise EasyBuildError("libxc support for QuantumESPRESSO 6.6 to 6.8 only available for libxc < 6.0") + if LooseVersion(libxc_v) < LooseVersion("4"): + raise EasyBuildError("libxc support for QuantumESPRESSO 6.x only available for libxc >= 4") + self.cfg.update('configopts', '--with-libxc=yes') + self.cfg.update('configopts', '--with-libxc-prefix=%s' % libxc) + elif LooseVersion(self.version) >= LooseVersion("6.0"): + if LooseVersion(libxc_v) >= LooseVersion("5.0"): + raise EasyBuildError( + "libxc support for QuantumESPRESSO 6.0 to 6.5 only available for libxc <= 4.3.4" + ) + if LooseVersion(libxc_v) < LooseVersion("4"): + raise EasyBuildError("libxc support for QuantumESPRESSO 6.x only available for libxc >= 4") + self.cfg.update('configopts', '--with-libxc=yes') + self.cfg.update('configopts', '--with-libxc-prefix=%s' % libxc) else: - extra_libs.append(" -lxcf90 -lxcf03 -lxc") + self.extra_libs += ['-L%s/lib' % libxc, '-lxcf90', '-lxc'] + self.dflags += ["-D__LIBXC"] + + def _add_hdf5(self): + """Add HDF5 support to the build.""" hdf5 = get_software_root("HDF5") if hdf5: self.cfg.update('configopts', '--with-hdf5=%s' % hdf5) - dflags.append(" -D__HDF5") + self.dflags += ["-D__HDF5"] hdf5_lib_repl = '-L%s/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lsz -lz -ldl -lm' % hdf5 - repls.append(('HDF5_LIB', hdf5_lib_repl, False)) + self.repls += [('HDF5_LIB', hdf5_lib_repl, False)] + if LooseVersion(self.version) >= LooseVersion("6.2.1"): + pass + else: + # Should be experimental in 6.0 but gives segfaults when used + raise EasyBuildError("HDF5 support is only available in QuantumESPRESSO 6.2.1 and later") + + def _add_elpa(self): + """Add ELPA support to the build.""" elpa = get_software_root("ELPA") if elpa: - if not self.cfg['with_scalapack']: - raise EasyBuildError("ELPA requires ScaLAPACK but 'with_scalapack' is set to False") - elpa_v = get_software_version("ELPA") - if LooseVersion(self.version) >= LooseVersion("6"): - # NOTE: Quantum Espresso should use -D__ELPA_ for corresponding ELPA version - # However for ELPA VERSION >= 2017.11 Quantum Espresso needs to use ELPA_2018 - # because of outdated bindings. See: https://xconfigure.readthedocs.io/en/latest/elpa/ - if LooseVersion("2018") > LooseVersion(elpa_v) >= LooseVersion("2017.11"): - dflags.append('-D__ELPA_2018') - else: - # get year from LooseVersion + if LooseVersion(elpa_v) < LooseVersion("2015"): + raise EasyBuildError("ELPA versions lower than 2015 are not supported") + + flag = True + if LooseVersion(self.version) >= LooseVersion("6.8"): + if LooseVersion(elpa_v) >= LooseVersion("2018.11"): + self.dflags += ["-D__ELPA"] + elif LooseVersion(elpa_v) >= LooseVersion("2016.11"): + self.dflags += ["-D__ELPA_2016"] + elif LooseVersion(elpa_v) >= LooseVersion("2015"): + self.dflags += ["-D__ELPA_2015"] + elif LooseVersion(self.version) >= LooseVersion("6.6"): + if LooseVersion(elpa_v) >= LooseVersion("2020"): + raise EasyBuildError("ELPA support for QuantumESPRESSO 6.6/6.7 only available up to v2019.xx") + elif LooseVersion(elpa_v) >= LooseVersion("2018"): + self.dflags += ["-D__ELPA"] + elif LooseVersion(elpa_v) >= LooseVersion("2015"): elpa_year_v = elpa_v.split('.')[0] - dflags.append('-D__ELPA_%s' % elpa_year_v) - - elpa_min_ver = "2016.11.001.pre" + self.dflags += ["-D__ELPA_%s" % elpa_year_v] + elif LooseVersion(self.version) >= LooseVersion("6.0"): + if LooseVersion(elpa_v) >= LooseVersion("2017"): + raise EasyBuildError("ELPA support for QuantumESPRESSO 6.x only available up to v2016.xx") + elif LooseVersion(elpa_v) >= LooseVersion("2016"): + self.dflags += ["-D__ELPA_2016"] + elif LooseVersion(elpa_v) >= LooseVersion("2015"): + self.dflags += ["-D__ELPA_2015"] + elif LooseVersion(self.version) >= LooseVersion("5.4"): + self.dflags += ["-D__ELPA"] + self.cfg.update('configopts', '--with-elpa=%s' % elpa) + flag = False + elif LooseVersion(self.version) >= LooseVersion("5.1.1"): + self.cfg.update('configopts', '--with-elpa=%s' % elpa) + flag = False else: - elpa_min_ver = "2015" - dflags.append('-D__ELPA_2015 -D__ELPA') + raise EasyBuildError("ELPA support is only available in QuantumESPRESSO 5.1.1 and later") - if LooseVersion(elpa_v) < LooseVersion(elpa_min_ver): - raise EasyBuildError("QuantumESPRESSO %s needs ELPA to be " + - "version %s or newer", self.version, elpa_min_ver) + if flag: + if self.toolchain.options.get('openmp', False): + elpa_include = 'elpa_openmp-%s' % elpa_v + elpa_lib = 'libelpa_openmp.a' + else: + elpa_include = 'elpa-%s' % elpa_v + elpa_lib = 'libelpa.a' + elpa_include = os.path.join(elpa, 'include', elpa_include, 'modules') + elpa_lib = os.path.join(elpa, 'lib', elpa_lib) + self.repls += [ + ('IFLAGS', '-I%s' % elpa_include, True) + ] + self.cfg.update('configopts', '--with-elpa-include=%s' % elpa_include) + self.cfg.update('configopts', '--with-elpa-lib=%s' % elpa_lib) + if LooseVersion(self.version) < LooseVersion("7.0"): + self.repls += [ + ('SCALAPACK_LIBS', '%s %s' % (elpa_lib, os.getenv("LIBSCALAPACK")), False) + ] + + def _add_fftw(self, comp_fam): + """Add FFTW support to the build.""" + if self.toolchain.options.get('openmp', False): + libfft = os.getenv('LIBFFT_MT') + else: + libfft = os.getenv('LIBFFT') - if self.toolchain.options.get('openmp', False): - elpa_include = 'elpa_openmp-%s' % elpa_v - elpa_lib = 'libelpa_openmp.a' + if LooseVersion(self.version) >= LooseVersion("5.2.1"): + if comp_fam == toolchain.INTELCOMP and get_software_root("imkl"): + self.dflags += ["-D__DFTI"] + elif libfft: + self.dflags += ["-D__FFTW"] if "fftw3" not in libfft else ["-D__FFTW3"] + self.repls += [ + ('FFT_LIBS', libfft, False), + ] + elif LooseVersion(self.version) >= LooseVersion("5.0"): + if libfft: + self.dflags += ["-D__FFTW"] if "fftw3" not in libfft else ["-D__FFTW3"] + self.repls += [ + ('FFT_LIBS', libfft, False), + ] + + def _add_ace(self): + """Add ACE support to the build.""" + if self.cfg['with_ace']: + if LooseVersion(self.version) >= LooseVersion("6.2"): + self.log.warning("ACE support is not available in QuantumESPRESSO >= 6.2") + elif LooseVersion(self.version) >= LooseVersion("6.0"): + self.dflags += ["-D__EXX_ACE"] + else: + self.log.warning("ACE support is not available in QuantumESPRESSO < 6.0") + + def _add_beef(self): + """Add BEEF support to the build.""" + if LooseVersion(self.version) == LooseVersion("6.6"): + libbeef = get_software_root("libbeef") + if libbeef: + self.dflags += ["-Duse_beef"] + libbeef_lib = os.path.join(libbeef, 'lib') + self.cfg.update('configopts', '--with-libbeef-prefix=%s' % libbeef_lib) + self.repls += [ + ('BEEF_LIBS_SWITCH', 'external', False), + ('BEEF_LIBS', str(os.path.join(libbeef_lib, "libbeef.a")), False) + ] + + def _add_fox(self): + """Add FoX support to the build.""" + if self.cfg['with_fox']: + if LooseVersion(self.version) >= LooseVersion("7.2"): + self.cfg.update('configopts', '--with-fox=yes') + + def _add_epw(self): + """Add EPW support to the build.""" + if self.cfg['with_epw']: + if LooseVersion(self.version) >= LooseVersion("6.0"): + self.cfg.update('buildopts', 'epw', allow_duplicate=False) + self.cfg.update('test_suite_targets', ['epw'], allow_duplicate=False) else: - elpa_include = 'elpa-%s' % elpa_v - elpa_lib = 'libelpa.a' - elpa_include = os.path.join(elpa, 'include', elpa_include) - repls.append(('IFLAGS', '-I%s' % os.path.join(elpa_include, 'modules'), True)) - self.cfg.update('configopts', '--with-elpa-include=%s' % elpa_include) - elpa_lib = os.path.join(elpa, 'lib', elpa_lib) - self.cfg.update('configopts', '--with-elpa-lib=%s' % elpa_lib) + self.log.warning("EPW support is not available in QuantumESPRESSO < 6.0") + else: + if 'epw' in self.cfg['buildopts']: + self.cfg['buildopts'] = self.cfg['buildopts'].replace('epw', '') + if 'epw' in self.cfg['test_suite_targets']: + self.cfg['test_suite_targets'].remove('epw') + + def _add_gipaw(self): + """Add GIPAW support to the build.""" + if self.cfg['with_gipaw']: + self.cfg.update('buildopts', 'gipaw', allow_duplicate=False) + else: + if 'gipaw' in self.cfg['buildopts']: + self.cfg['buildopts'] = self.cfg['buildopts'].replace('gipaw', '') + def _add_wannier90(self): + """Add Wannier90 support to the build.""" + if self.cfg['with_wannier90']: + self.cfg.update('buildopts', 'w90', allow_duplicate=False) + else: + if 'w90' in self.cfg['buildopts']: + self.cfg['buildopts'] = self.cfg['buildopts'].replace('w90', '') + + def _adjust_compiler_flags(self, comp_fam): + """Adjust compiler flags based on the compiler family and code version.""" if comp_fam == toolchain.INTELCOMP: - # set preprocessor command (-E to stop after preprocessing, -C to preserve comments) - cpp = "%s -E -C" % os.getenv('CC') - repls.append(('CPP', cpp, False)) - env.setvar('CPP', cpp) + if LooseVersion("6.0") <= LooseVersion(self.version) <= LooseVersion("6.4"): + i_mpi_cc = os.getenv('I_MPI_CC', '') + if i_mpi_cc == 'icx': + env.setvar('I_MPI_CC', 'icc') # Needed as clib/qmmm_aux.c using implicitly + elif comp_fam == toolchain.GCC: + pass - # also define $FCCPP, but do *not* include -C (comments should not be preserved when preprocessing Fortran) - env.setvar('FCCPP', "%s -E" % os.getenv('CC')) + def configure_step(self): + """Custom configuration procedure for Quantum ESPRESSO.""" + + # compose list of DFLAGS (flag, value, keep_stuff) + # for guidelines, see include/defs.h.README in sources + self.dflags = [] + self.repls = [] + self.extra_libs = [] + + comp_fam = self.toolchain.comp_family() + + self._add_compiler_flags(comp_fam) + self._add_openmp() + self._add_mpi() + self._add_scalapack(comp_fam) + self._add_libxc() + self._add_hdf5() + self._add_elpa() + self._add_fftw(comp_fam) + self._add_ace() + self._add_beef() + self._add_fox() + self._add_epw() + self._add_gipaw() + self._add_wannier90() + + run_cmd("module list", log_all=True, log_ok=True, simple=False, regexp=False) if comp_fam == toolchain.INTELCOMP: # Intel compiler must have -assume byterecl (see install/configure) - repls.append(('F90FLAGS', '-fpp -assume byterecl', True)) - repls.append(('FFLAGS', '-assume byterecl', True)) + self.repls.append(('F90FLAGS', '-fpp -assume byterecl', True)) + self.repls.append(('FFLAGS', '-assume byterecl', True)) elif comp_fam == toolchain.GCC: f90_flags = ['-cpp'] if LooseVersion(get_software_version('GCC')) >= LooseVersion('10'): f90_flags.append('-fallow-argument-mismatch') - repls.append(('F90FLAGS', ' '.join(f90_flags), True)) + self.repls.append(('F90FLAGS', ' '.join(f90_flags), True)) - super(EB_QuantumESPRESSO, self).configure_step() + self._adjust_compiler_flags(comp_fam) - if self.toolchain.options.get('openmp', False): - libfft = os.getenv('LIBFFT_MT') - else: - libfft = os.getenv('LIBFFT') - if libfft: - if "fftw3" in libfft: - dflags.append('-D__FFTW3') - else: - dflags.append('-D__FFTW') - env.setvar('FFTW_LIBS', libfft) - - if get_software_root('ACML'): - dflags.append('-D__ACML') - - if self.cfg['with_ace']: - dflags.append(" -D__EXX_ACE") + super(EB_QuantumESPRESSO, self).configure_step() # always include -w to supress warnings - dflags.append('-w') + self.dflags.append('-w') - if LooseVersion(self.version) >= LooseVersion("6.6"): - dflags.append(" -Duse_beef") - libbeef = get_software_root("libbeef") - if libbeef: - repls.append(('BEEF_LIBS_SWITCH', 'external', False)) - repls.append(('BEEF_LIBS', '%s/lib/libbeef.a' % libbeef, False)) - - repls.append(('DFLAGS', ' '.join(dflags), False)) + self.repls.append(('DFLAGS', ' '.join(self.dflags), False)) # complete C/Fortran compiler and LD flags if self.toolchain.options.get('openmp', False) or self.cfg['hybrid']: - repls.append(('LDFLAGS', self.toolchain.get_flag('openmp'), True)) - repls.append(('(?:C|F90|F)FLAGS', self.toolchain.get_flag('openmp'), True)) + self.repls.append(('LDFLAGS', self.toolchain.get_flag('openmp'), True)) + self.repls.append(('(?:C|F90|F)FLAGS', self.toolchain.get_flag('openmp'), True)) - # obtain library settings + # libs is being used for the replacement in the wannier90 files libs = [] - num_libs = ['BLAS', 'LAPACK', 'FFT'] - if self.cfg['with_scalapack']: - num_libs.extend(['SCALAPACK']) - for lib in num_libs: - if self.toolchain.options.get('openmp', False): - val = os.getenv('LIB%s_MT' % lib) - else: - val = os.getenv('LIB%s' % lib) - if lib == 'SCALAPACK' and elpa: - val = ' '.join([elpa_lib, val]) - repls.append(('%s_LIBS' % lib, val, False)) - libs.append(val) + # Only overriding for gcc as the intel flags are already being properly + # set. + if comp_fam == toolchain.GCC: + num_libs = ['BLAS', 'LAPACK', 'FFT'] + if self.cfg['with_scalapack']: + num_libs.extend(['SCALAPACK']) + elpa = get_software_root('ELPA') + elpa_lib = 'libelpa_openmp.a' if self.toolchain.options.get('openmp', False) else 'libelpa.a' + elpa_lib = os.path.join(elpa or '', 'lib', elpa_lib) + for lib in num_libs: + if self.toolchain.options.get('openmp', False): + val = os.getenv('LIB%s_MT' % lib) + else: + val = os.getenv('LIB%s' % lib) + if lib == 'SCALAPACK' and elpa: + val = ' '.join([elpa_lib, val]) + self.repls.append(('%s_LIBS' % lib, val, False)) + libs.append(val) libs = ' '.join(libs) - repls.append(('BLAS_LIBS_SWITCH', 'external', False)) - repls.append(('LAPACK_LIBS_SWITCH', 'external', False)) - repls.append(('LD_LIBS', ' '.join(extra_libs + [os.getenv('LIBS')]), False)) + self.repls.append(('BLAS_LIBS_SWITCH', 'external', False)) + self.repls.append(('LAPACK_LIBS_SWITCH', 'external', False)) + self.repls.append(('LD_LIBS', ' '.join(self.extra_libs + [os.getenv('LIBS')]), False)) # Do not use external FoX. # FoX starts to be used in 6.2 and they use a patched version that @@ -249,7 +446,7 @@ def configure_step(self): raise EasyBuildError("Found FoX external module, QuantumESPRESSO" + "must use the version they include with the source.") - self.log.debug("List of replacements to perform: %s" % repls) + self.log.info("List of replacements to perform: %s" % str(self.repls)) if LooseVersion(self.version) >= LooseVersion("6"): make_ext = '.inc' @@ -260,7 +457,7 @@ def configure_step(self): fn = os.path.join(self.cfg['start_dir'], 'make' + make_ext) try: for line in fileinput.input(fn, inplace=1, backup='.orig.eb'): - for (k, v, keep) in repls: + for (k, v, keep) in self.repls: # need to use [ \t]* instead of \s*, because vars may be undefined as empty, # and we don't want to include newlines if keep: @@ -276,7 +473,7 @@ def configure_step(self): "\t$(MPIF90) $(F90FLAGS) -c $*.F90 -o $*.o", line) - if LooseVersion(self.version) >= LooseVersion("6.6"): + if LooseVersion(self.version) == LooseVersion("6.6"): # fix order of BEEF_LIBS in QE_LIBS line = re.sub(r"^(QELIBS\s*=[ \t]*)(.*) \$\(BEEF_LIBS\) (.*)$", r"QELIBS = $(BEEF_LIBS) \2 \3", line) @@ -289,7 +486,8 @@ def configure_step(self): except IOError as err: raise EasyBuildError("Failed to patch %s: %s", fn, err) - self.log.debug("Contents of patched %s: %s" % (fn, open(fn, "r").read())) + with open(fn, "r") as f: + self.log.info("Contents of patched %s: %s" % (fn, f.read())) # patch default make.sys for wannier if LooseVersion(self.version) >= LooseVersion("5"): @@ -298,14 +496,16 @@ def configure_step(self): fn = os.path.join(self.cfg['start_dir'], 'plugins', 'install', 'make_wannier90.sys') try: for line in fileinput.input(fn, inplace=1, backup='.orig.eb'): - line = re.sub(r"^(LIBS\s*=\s*).*", r"\1%s" % libs, line) + if libs: + line = re.sub(r"^(LIBS\s*=\s*).*", r"\1%s" % libs, line) sys.stdout.write(line) except IOError as err: raise EasyBuildError("Failed to patch %s: %s", fn, err) - self.log.debug("Contents of patched %s: %s" % (fn, open(fn, "r").read())) + with open(fn, "r") as f: + self.log.info("Contents of patched %s: %s" % (fn, f.read())) # patch Makefile of want plugin wantprefix = 'want-' @@ -365,9 +565,118 @@ def configure_step(self): except OSError as err: raise EasyBuildError("Failed to move non-espresso directories: %s", err) + def test_step(self): + """ + Test the compilation using Quantum ESPRESSO's test suite. + cd test-suite && make run-tests NPROCS=XXX (XXX <= 4) + """ + + thr = self.cfg.get('test_suite_threshold', 0.9) + stot = 0 + spass = 0 + parallel = min(4, self.cfg.get('parallel', 1)) + test_dir = os.path.join(self.start_dir, self.TEST_SUITE_DIR) + + pseudo_loc = "https://pseudopotentials.quantum-espresso.org/upf_files/" + # NETWORK_PSEUDO in test_suite/ENVIRONMENT is set to old url for qe 7.0 and older + if LooseVersion(self.version) < LooseVersion("7.1"): + cmd = ' && '.join([ + "cd %s" % test_dir, + "sed -i 's|export NETWORK_PSEUDO=.*|export NETWORK_PSEUDO=%s|g' ENVIRONMENT" % pseudo_loc + ]) + run_cmd(cmd, log_all=False, log_ok=False, simple=False, regexp=False) + + targets = self.cfg.get('test_suite_targets', []) + allow_fail = self.cfg.get('test_suite_allow_failures', []) + + full_out = '' + failures = [] + for target in targets: + pcmd = '' + if LooseVersion(self.version) < LooseVersion("7.2"): + if parallel > 1: + target = target + "-parallel" + else: + target = target + "-serial" + else: + pcmd = 'NPROCS=%d' % parallel + + cmd = 'cd %s && %s make run-tests-%s' % (test_dir, pcmd, target) + (out, _) = run_cmd(cmd, log_all=False, log_ok=False, simple=False, regexp=False) + + # Example output: + # All done. 2 out of 2 tests passed. + # All done. ERROR: only 6 out of 9 tests passed + _tot = 0 + _pass = 0 + rgx = r'All done. (ERROR: only )?(?P\d+) out of (?P\d+) tests passed.' + for mch in re.finditer(rgx, out): + succeeded = int(mch.group('succeeded')) + total = int(mch.group('total')) + _tot += total + _pass += succeeded + + perc = _pass / max(_tot, 1) + self.log.info("%s: Passed %d out of %d (%.2f%%)" % (target, _pass, _tot, perc * 100)) + + # Log test-suite errors if present + if _pass < _tot: + # Example output for reported failures: + # pw_plugins - plugin-pw2casino_1.in (arg(s): 1): **FAILED**. + # Different sets of data extracted from benchmark and test. + # Data only in benchmark: p1. + # (empty line) + flag = False + for line in out.splitlines(): + if '**FAILED**' in line: + for allowed in allow_fail: + if allowed in line: + self.log.info('Ignoring failure: %s' % line) + break + else: + failures.append(line) + flag = True + self.log.warning(line) + continue + elif line.strip() == '': + flag = False + if flag: + self.log.warning('| ' + line) + + stot += _tot + spass += _pass + full_out += out + + # Allow for flaky tests (eg too strict thresholds on results for structure relaxation) + num_fail = len(failures) + num_fail_thr = self.cfg.get('test_suite_max_failed', 0) + perc = spass / max(stot, 1) + self.log.info("Total tests passed %d out of %d (%.2f%%)" % (spass, stot, perc * 100)) + if failures: + self.log.warning("The following tests failed:") + for failure in failures: + self.log.warning('| ' + failure) + if perc < thr: + raise EasyBuildError( + "Test suite failed with less than %.2f %% (%.2f) success rate" % (thr * 100, perc * 100) + ) + if num_fail > num_fail_thr: + raise EasyBuildError( + "Test suite failed with %d failures (%d failures permitted)" % (num_fail, num_fail_thr) + ) + + return full_out + def install_step(self): """Custom install step for Quantum ESPRESSO.""" + # In QE 7.3 the w90 target is always invoked (even if only used as a library), and the symlink to the + # `wannier90.x` executable is generated, but the actual binary is not built. We need to remove the symlink + if LooseVersion(self.version) == LooseVersion("7.3"): + w90_path = os.path.join(self.start_dir, 'bin', 'wannier90.x') + if os.path.islink(w90_path) and not os.path.exists(os.readlink(w90_path)): + os.unlink(w90_path) + # extract build targets as list targets = self.cfg['buildopts'].split() @@ -459,7 +768,7 @@ def sanity_check_step(self): bins.extend(["generate_vdW_kernel_table.x"]) if LooseVersion(self.version) <= LooseVersion("5"): bins.extend(["path_int.x"]) - if LooseVersion(self.version) < LooseVersion("5.3.0"): + if LooseVersion(self.version) < LooseVersion("5.3"): bins.extend(["band_plot.x", "bands_FS.x", "kvecs_FS.x"]) if 'pwcond' in targets or 'pwall' in targets or 'all' in targets: diff --git a/easybuild/easyblocks/r/__init__.py b/easybuild/easyblocks/r/__init__.py index d1e94b14c8..6d31738209 100644 --- a/easybuild/easyblocks/r/__init__.py +++ b/easybuild/easyblocks/r/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/r.py b/easybuild/easyblocks/r/r.py index 27d5d2ac32..8151df81a6 100644 --- a/easybuild/easyblocks/r/r.py +++ b/easybuild/easyblocks/r/r.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -70,8 +70,11 @@ def configure_step(self): for dep in ['Tcl', 'Tk']: root = get_software_root(dep) if root: - dep_config = os.path.join(root, 'lib', '%sConfig.sh' % dep.lower()) - self.cfg.update('configopts', '--with-%s-config=%s' % (dep.lower(), dep_config)) + for libdir in ['lib', 'lib64']: + dep_config = os.path.join(root, libdir, '%sConfig.sh' % dep.lower()) + if os.path.exists(dep_config): + self.cfg.update('configopts', '--with-%s-config=%s' % (dep.lower(), dep_config)) + break if "--with-x=" not in self.cfg['configopts'].lower(): if get_software_root('X11'): diff --git a/easybuild/easyblocks/r/repeatmasker.py b/easybuild/easyblocks/r/repeatmasker.py index e0a50b1a1d..29e62abcae 100644 --- a/easybuild/easyblocks/r/repeatmasker.py +++ b/easybuild/easyblocks/r/repeatmasker.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/repeatmodeler.py b/easybuild/easyblocks/r/repeatmodeler.py index 122f64cc4c..45bb1a4996 100644 --- a/easybuild/easyblocks/r/repeatmodeler.py +++ b/easybuild/easyblocks/r/repeatmodeler.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/reticulate.py b/easybuild/easyblocks/r/reticulate.py index 7d5a7a79d5..99c4ca3aee 100644 --- a/easybuild/easyblocks/r/reticulate.py +++ b/easybuild/easyblocks/r/reticulate.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/rmpi.py b/easybuild/easyblocks/r/rmpi.py index 8bca1893be..a0f248828d 100644 --- a/easybuild/easyblocks/r/rmpi.py +++ b/easybuild/easyblocks/r/rmpi.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/root.py b/easybuild/easyblocks/r/root.py index 2a10a86d57..3645d1fcc7 100644 --- a/easybuild/easyblocks/r/root.py +++ b/easybuild/easyblocks/r/root.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/rosetta.py b/easybuild/easyblocks/r/rosetta.py index 71630c7902..973b5ada96 100644 --- a/easybuild/easyblocks/r/rosetta.py +++ b/easybuild/easyblocks/r/rosetta.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/rserve.py b/easybuild/easyblocks/r/rserve.py index e06b7007b1..c9fd24716d 100644 --- a/easybuild/easyblocks/r/rserve.py +++ b/easybuild/easyblocks/r/rserve.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/ruby.py b/easybuild/easyblocks/r/ruby.py index 80b66064f3..a7ba02930b 100644 --- a/easybuild/easyblocks/r/ruby.py +++ b/easybuild/easyblocks/r/ruby.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/r/rust.py b/easybuild/easyblocks/r/rust.py index 777d962391..5c66d71239 100644 --- a/easybuild/easyblocks/r/rust.py +++ b/easybuild/easyblocks/r/rust.py @@ -1,5 +1,5 @@ ## -# Copyright 2023-2023 Ghent University +# Copyright 2023-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/samcef.py b/easybuild/easyblocks/s/samcef.py index 2f5e7b69d4..6874863c1c 100644 --- a/easybuild/easyblocks/s/samcef.py +++ b/easybuild/easyblocks/s/samcef.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/samtools.py b/easybuild/easyblocks/s/samtools.py index 4be92850f0..3f613be14b 100644 --- a/easybuild/easyblocks/s/samtools.py +++ b/easybuild/easyblocks/s/samtools.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/s/sas.py b/easybuild/easyblocks/s/sas.py index 31e6c20b50..ce0df1d3b9 100644 --- a/easybuild/easyblocks/s/sas.py +++ b/easybuild/easyblocks/s/sas.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/scalapack.py b/easybuild/easyblocks/s/scalapack.py index 11d285e4ae..ff0d3fadf0 100644 --- a/easybuild/easyblocks/s/scalapack.py +++ b/easybuild/easyblocks/s/scalapack.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/scalasca1.py b/easybuild/easyblocks/s/scalasca1.py index d991af9a31..641deb4ee7 100644 --- a/easybuild/easyblocks/s/scalasca1.py +++ b/easybuild/easyblocks/s/scalasca1.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/scipion.py b/easybuild/easyblocks/s/scipion.py index 42d21a981b..5d11ff1992 100644 --- a/easybuild/easyblocks/s/scipion.py +++ b/easybuild/easyblocks/s/scipion.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/scipy.py b/easybuild/easyblocks/s/scipy.py index b0551a2b74..4d2d011885 100644 --- a/easybuild/easyblocks/s/scipy.py +++ b/easybuild/easyblocks/s/scipy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/score_p.py b/easybuild/easyblocks/s/score_p.py index 1c473d2099..8d70d10360 100644 --- a/easybuild/easyblocks/s/score_p.py +++ b/easybuild/easyblocks/s/score_p.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/scotch.py b/easybuild/easyblocks/s/scotch.py index b09d3cdc0d..600afb8753 100644 --- a/easybuild/easyblocks/s/scotch.py +++ b/easybuild/easyblocks/s/scotch.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/sepp.py b/easybuild/easyblocks/s/sepp.py index 389f591219..506ff2c539 100644 --- a/easybuild/easyblocks/s/sepp.py +++ b/easybuild/easyblocks/s/sepp.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/shrimp.py b/easybuild/easyblocks/s/shrimp.py index c4a09fab69..9c28875e35 100644 --- a/easybuild/easyblocks/s/shrimp.py +++ b/easybuild/easyblocks/s/shrimp.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/siesta.py b/easybuild/easyblocks/s/siesta.py index 69a911fa80..a6f9b491e2 100644 --- a/easybuild/easyblocks/s/siesta.py +++ b/easybuild/easyblocks/s/siesta.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/slepc.py b/easybuild/easyblocks/s/slepc.py index 43ecff7a4c..1c15a5537d 100644 --- a/easybuild/easyblocks/s/slepc.py +++ b/easybuild/easyblocks/s/slepc.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -70,7 +70,7 @@ def configure_step(self): raise EasyBuildError("PETSc module not loaded?") # set SLEPC_DIR environment variable - env.setvar('SLEPC_DIR', self.cfg['start_dir']) + env.setvar('SLEPC_DIR', self.cfg['start_dir'].rstrip(os.path.sep)) self.log.debug('SLEPC_DIR: %s' % os.getenv('SLEPC_DIR')) # optional dependencies diff --git a/easybuild/easyblocks/s/snphylo.py b/easybuild/easyblocks/s/snphylo.py index 7fed0ace86..0826477418 100644 --- a/easybuild/easyblocks/s/snphylo.py +++ b/easybuild/easyblocks/s/snphylo.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/soapdenovo.py b/easybuild/easyblocks/s/soapdenovo.py index f404470ce8..79c9176c37 100644 --- a/easybuild/easyblocks/s/soapdenovo.py +++ b/easybuild/easyblocks/s/soapdenovo.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/s/star_ccm.py b/easybuild/easyblocks/s/star_ccm.py index b4993bb23a..9acff54a65 100644 --- a/easybuild/easyblocks/s/star_ccm.py +++ b/easybuild/easyblocks/s/star_ccm.py @@ -1,5 +1,5 @@ ## -# Copyright 2018-2023 Ghent University +# Copyright 2018-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/stata.py b/easybuild/easyblocks/s/stata.py index 6fd83d850a..cfa31fc951 100644 --- a/easybuild/easyblocks/s/stata.py +++ b/easybuild/easyblocks/s/stata.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/suitesparse.py b/easybuild/easyblocks/s/suitesparse.py index c581b3c7a1..61e4e1642f 100644 --- a/easybuild/easyblocks/s/suitesparse.py +++ b/easybuild/easyblocks/s/suitesparse.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/superlu.py b/easybuild/easyblocks/s/superlu.py index 9e85160587..060272073f 100644 --- a/easybuild/easyblocks/s/superlu.py +++ b/easybuild/easyblocks/s/superlu.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University, University of Luxembourg +# Copyright 2009-2024 Ghent University, University of Luxembourg # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/swig.py b/easybuild/easyblocks/s/swig.py index d434e9f34f..ed641ffe68 100644 --- a/easybuild/easyblocks/s/swig.py +++ b/easybuild/easyblocks/s/swig.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/s/sympy.py b/easybuild/easyblocks/s/sympy.py index 15e5186231..2f8fef6433 100644 --- a/easybuild/easyblocks/s/sympy.py +++ b/easybuild/easyblocks/s/sympy.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tau.py b/easybuild/easyblocks/t/tau.py index 33ca3ea127..2cb7598656 100644 --- a/easybuild/easyblocks/t/tau.py +++ b/easybuild/easyblocks/t/tau.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tbb.py b/easybuild/easyblocks/t/tbb.py index 995bfa854a..4fdbcc4fbe 100644 --- a/easybuild/easyblocks/t/tbb.py +++ b/easybuild/easyblocks/t/tbb.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tensorflow.py b/easybuild/easyblocks/t/tensorflow.py index 174a5e38fe..f907e8981b 100644 --- a/easybuild/easyblocks/t/tensorflow.py +++ b/easybuild/easyblocks/t/tensorflow.py @@ -1,5 +1,5 @@ ## -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tensorflow_compression.py b/easybuild/easyblocks/t/tensorflow_compression.py index c13acb7fca..108ba59cc3 100644 --- a/easybuild/easyblocks/t/tensorflow_compression.py +++ b/easybuild/easyblocks/t/tensorflow_compression.py @@ -1,5 +1,5 @@ ## -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tensorrt.py b/easybuild/easyblocks/t/tensorrt.py index 8c818b959c..52eeef2c6f 100644 --- a/easybuild/easyblocks/t/tensorrt.py +++ b/easybuild/easyblocks/t/tensorrt.py @@ -1,5 +1,5 @@ ## -# Copyright 2017-2023 Ghent University +# Copyright 2017-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tinker.py b/easybuild/easyblocks/t/tinker.py index 78ecd57312..24adb95a00 100644 --- a/easybuild/easyblocks/t/tinker.py +++ b/easybuild/easyblocks/t/tinker.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/tkinter.py b/easybuild/easyblocks/t/tkinter.py index eb792c876c..7d06319d30 100644 --- a/easybuild/easyblocks/t/tkinter.py +++ b/easybuild/easyblocks/t/tkinter.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/torchvision.py b/easybuild/easyblocks/t/torchvision.py index 5536b89139..928574e50a 100644 --- a/easybuild/easyblocks/t/torchvision.py +++ b/easybuild/easyblocks/t/torchvision.py @@ -1,5 +1,5 @@ ## -# Copyright 2021-2023 Ghent University +# Copyright 2021-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -90,11 +90,12 @@ def sanity_check_step(self): # the-cuda-backend-this-could-be-because-the-operator-doesnt-exist-for-this-backend/132352/4 if self.with_cuda: custom_commands = [] - python_code = '; '.join([ + python_code = '\n'.join([ "import torch, torchvision", - "boxes = torch.tensor([[0., 1., 2., 3.]]).to('cuda')", - "scores = torch.randn(1).to('cuda')", - "print(torchvision.ops.nms(boxes, scores, 0.5))", + "if torch.cuda.device_count():", + " boxes = torch.tensor([[0., 1., 2., 3.]]).to('cuda')", + " scores = torch.randn(1).to('cuda')", + " print(torchvision.ops.nms(boxes, scores, 0.5))", ]) custom_commands.append('python -c "%s"' % python_code) custom_paths = { diff --git a/easybuild/easyblocks/t/tornado.py b/easybuild/easyblocks/t/tornado.py index 98a1c59705..5d1de12dcb 100644 --- a/easybuild/easyblocks/t/tornado.py +++ b/easybuild/easyblocks/t/tornado.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/totalview.py b/easybuild/easyblocks/t/totalview.py index 2cd8234d03..3ef4bc7c1f 100644 --- a/easybuild/easyblocks/t/totalview.py +++ b/easybuild/easyblocks/t/totalview.py @@ -1,8 +1,8 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA -# Copyright:: Copyright 2016-2023 Forschungszentrum Juelich +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2016-2024 Forschungszentrum Juelich # Authors:: Fotis Georgatos # Authors:: Damian Alvarez # License:: MIT/GPL diff --git a/easybuild/easyblocks/t/trilinos.py b/easybuild/easyblocks/t/trilinos.py index 51ed37e9cc..0231184a60 100644 --- a/easybuild/easyblocks/t/trilinos.py +++ b/easybuild/easyblocks/t/trilinos.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/t/trinity.py b/easybuild/easyblocks/t/trinity.py index 72cf9e454b..149a16e3a2 100644 --- a/easybuild/easyblocks/t/trinity.py +++ b/easybuild/easyblocks/t/trinity.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/u/ucx_plugins.py b/easybuild/easyblocks/u/ucx_plugins.py index a00512c48c..d6a8227202 100644 --- a/easybuild/easyblocks/u/ucx_plugins.py +++ b/easybuild/easyblocks/u/ucx_plugins.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/u/ufc.py b/easybuild/easyblocks/u/ufc.py index 361409dff7..cbf087b08a 100644 --- a/easybuild/easyblocks/u/ufc.py +++ b/easybuild/easyblocks/u/ufc.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/v/velvet.py b/easybuild/easyblocks/v/velvet.py index c79f6ff995..553037277c 100644 --- a/easybuild/easyblocks/v/velvet.py +++ b/easybuild/easyblocks/v/velvet.py @@ -1,7 +1,7 @@ ## # This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild # -# Copyright:: Copyright 2012-2023 Uni.Lu/LCSB, NTUA +# Copyright:: Copyright 2012-2024 Uni.Lu/LCSB, NTUA # Authors:: Cedric Laczny , Fotis Georgatos , Kenneth Hoste # License:: MIT/GPL # $Id$ diff --git a/easybuild/easyblocks/v/vep.py b/easybuild/easyblocks/v/vep.py index c339abbe0a..bea0d80a8b 100644 --- a/easybuild/easyblocks/v/vep.py +++ b/easybuild/easyblocks/v/vep.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -30,6 +30,7 @@ import easybuild.tools.environment as env from easybuild.easyblocks.perl import get_major_perl_version from easybuild.framework.easyblock import EasyBlock +from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import print_warning from easybuild.tools.filetools import apply_regex_substitutions from easybuild.tools.modules import get_software_version, get_software_root @@ -48,6 +49,15 @@ def __init__(self, *args, **kwargs): self.api_mods_subdir = os.path.join('modules', 'api') + @staticmethod + def extra_options(extra_vars=None): + """Extra easyconfig parameters specific to VEP easyblock.""" + extra_vars = EasyBlock.extra_options(extra_vars) + extra_vars.update({ + 'species': ['all', "Comma-separated list of species to pass to INSTALL.pl", CUSTOM], + }) + return extra_vars + def configure_step(self): """No custom configuration procedure for VEP.""" pass @@ -97,8 +107,8 @@ def install_step(self): # l: Bio::DB::HTS, should be provided via EasyBuild # p: plugins '--AUTO af', - # install all species - '--SPECIES all', + # install selected species + '--SPECIES %s' % self.cfg['species'], # don't update VEP during installation '--NO_UPDATE', # location to install Perl API modules into diff --git a/easybuild/easyblocks/v/vmd.py b/easybuild/easyblocks/v/vmd.py index 3c122bd2e0..e85bebfe10 100644 --- a/easybuild/easyblocks/v/vmd.py +++ b/easybuild/easyblocks/v/vmd.py @@ -1,6 +1,6 @@ ## -# Copyright 2009-2023 Ghent University -# Copyright 2015-2023 Stanford University +# Copyright 2009-2024 Ghent University +# Copyright 2015-2024 Stanford University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/v/vsc_tools.py b/easybuild/easyblocks/v/vsc_tools.py index 83611fdf73..17f91ad204 100644 --- a/easybuild/easyblocks/v/vsc_tools.py +++ b/easybuild/easyblocks/v/vsc_tools.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/v/vtune.py b/easybuild/easyblocks/v/vtune.py index 5459f38b00..88507df149 100644 --- a/easybuild/easyblocks/v/vtune.py +++ b/easybuild/easyblocks/v/vtune.py @@ -1,5 +1,5 @@ # # -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/w/wien2k.py b/easybuild/easyblocks/w/wien2k.py index 32430c4f21..26a50cb4d6 100644 --- a/easybuild/easyblocks/w/wien2k.py +++ b/easybuild/easyblocks/w/wien2k.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -248,6 +248,9 @@ def configure_step(self): libxcquestion4 = 'Please enter the lib-directory of your LIBXC-installation (usually lib or lib64)!:' libxcquestion5 = 'LIBXC (usually not needed, ONLY for experts who want to play with different DFT options. ' libxcquestion5 += 'It must have been installed before)? (y,N):' + libxcquestion6 = 'Would you like to use LIBXC (needed ONLY for self-consistent gKS mGGA calculations, ' + libxcquestion6 += 'for the stress tensor and experts who want to play with different DFT options. ' + libxcquestion6 += 'It must have been installed before)? (y,N):' if libxcroot: qanda.update({ @@ -256,11 +259,13 @@ def configure_step(self): libxcquestion3: libxcroot, libxcquestion4: 'lib', libxcquestion5: 'y', + libxcquestion6: 'y', }) else: qanda.update({ libxcquestion1: 'N', libxcquestion5: 'N', + libxcquestion6: 'N', }) if LooseVersion(self.version) >= LooseVersion("17"): diff --git a/easybuild/easyblocks/w/wps.py b/easybuild/easyblocks/w/wps.py index 4dba12ac02..31ec379a58 100644 --- a/easybuild/easyblocks/w/wps.py +++ b/easybuild/easyblocks/w/wps.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/w/wrf.py b/easybuild/easyblocks/w/wrf.py index a21eabd12c..3c9c76f18e 100644 --- a/easybuild/easyblocks/w/wrf.py +++ b/easybuild/easyblocks/w/wrf.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/w/wrf_fire.py b/easybuild/easyblocks/w/wrf_fire.py index ce5ea7d82a..740b33581e 100644 --- a/easybuild/easyblocks/w/wrf_fire.py +++ b/easybuild/easyblocks/w/wrf_fire.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/w/wxpython.py b/easybuild/easyblocks/w/wxpython.py index 524b90a6a8..4df68fc0a9 100644 --- a/easybuild/easyblocks/w/wxpython.py +++ b/easybuild/easyblocks/w/wxpython.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/x/xalt.py b/easybuild/easyblocks/x/xalt.py index e5e4f07f45..28a4e0d294 100644 --- a/easybuild/easyblocks/x/xalt.py +++ b/easybuild/easyblocks/x/xalt.py @@ -1,5 +1,5 @@ ## -# Copyright 2020-2023 NVIDIA +# Copyright 2020-2024 NVIDIA # # This file is triple-licensed under GPLv2 (see below), MIT, and # BSD three-clause licenses. diff --git a/easybuild/easyblocks/x/xcrysden.py b/easybuild/easyblocks/x/xcrysden.py index 2a2c9891f9..eb13ef7593 100644 --- a/easybuild/easyblocks/x/xcrysden.py +++ b/easybuild/easyblocks/x/xcrysden.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/x/xmipp.py b/easybuild/easyblocks/x/xmipp.py index 3043a4c93a..9a0035907e 100644 --- a/easybuild/easyblocks/x/xmipp.py +++ b/easybuild/easyblocks/x/xmipp.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/easybuild/easyblocks/x/xml.py b/easybuild/easyblocks/x/xml.py index 14216fa364..bfca761060 100644 --- a/easybuild/easyblocks/x/xml.py +++ b/easybuild/easyblocks/x/xml.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/setup.py b/setup.py index 5162b2fe3c..f917516a64 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/__init__.py b/test/__init__.py index 01ba03af45..8ab7c0ed70 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,5 +1,5 @@ ## -# Copyright 2009-2023 Ghent University +# Copyright 2009-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/easyblocks/easyblock_specific.py b/test/easyblocks/easyblock_specific.py index d9e90408ee..e17822318e 100644 --- a/test/easyblocks/easyblock_specific.py +++ b/test/easyblocks/easyblock_specific.py @@ -1,5 +1,5 @@ ## -# Copyright 2019-2023 Ghent University +# Copyright 2019-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/easyblocks/general.py b/test/easyblocks/general.py index 25b3ccba40..fdae324a1b 100644 --- a/test/easyblocks/general.py +++ b/test/easyblocks/general.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/easyblocks/init_easyblocks.py b/test/easyblocks/init_easyblocks.py index 9a53f4b898..35089902d6 100644 --- a/test/easyblocks/init_easyblocks.py +++ b/test/easyblocks/init_easyblocks.py @@ -1,5 +1,5 @@ ## -# Copyright 2013-2023 Ghent University +# Copyright 2013-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), @@ -109,6 +109,14 @@ def check_extra_options_format(extra_options): for key in extra_options.keys(): self.assertTrue(isinstance(extra_options[key], list)) self.assertTrue(len(extra_options[key]), 3) + # make sure that easyconfig parameter names do not include characters that are not allowed, + # like dashes, to ensure that they can be defined as variables in the easyconfig file + try: + res = compile("%s = 1" % key, '', 'exec') + except SyntaxError: + raise SyntaxError("Invalid easyconfig parameter name: %s" % key) + + self.assertTrue(res.co_names, (key, )) class_regex = re.compile(r"^class (.*)\(.*", re.M) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index 1fac194147..6e37946c3a 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -1,5 +1,5 @@ ## -# Copyright 2015-2023 Ghent University +# Copyright 2015-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), diff --git a/test/easyblocks/suite.py b/test/easyblocks/suite.py index 3af803f312..17dc886ea8 100644 --- a/test/easyblocks/suite.py +++ b/test/easyblocks/suite.py @@ -1,6 +1,6 @@ #!/usr/bin/python ## -# Copyright 2012-2023 Ghent University +# Copyright 2012-2024 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),