From 166d673f9b3e612fe7c45c1e33a087721e1b4c76 Mon Sep 17 00:00:00 2001 From: WilleBell Date: Fri, 13 Sep 2024 17:53:54 +0200 Subject: [PATCH 1/3] adding easyconfigs: DFTB+-24.1-foss-2023a.eb, libmbd-0.12.6-foss-2023a.eb, ELSI-2.11.0-foss-2023a-PEXSI.eb, NTPoly-3.1.0-foss-2023a.eb and patches: ELSI-2.11.0_bison_3.8_compat.patch --- .../d/DFTB+/DFTB+-24.1-foss-2023a.eb | 93 +++++++++++++++++++ .../e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb | 43 +++++++++ .../e/ELSI/ELSI-2.11.0_bison_3.8_compat.patch | 14 +++ .../l/libmbd/libmbd-0.12.6-foss-2023a.eb | 59 ++++++++++++ .../n/NTPoly/NTPoly-3.1.0-foss-2023a.eb | 28 ++++++ 5 files changed, 237 insertions(+) create mode 100644 easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb create mode 100644 easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb create mode 100644 easybuild/easyconfigs/e/ELSI/ELSI-2.11.0_bison_3.8_compat.patch create mode 100644 easybuild/easyconfigs/l/libmbd/libmbd-0.12.6-foss-2023a.eb create mode 100644 easybuild/easyconfigs/n/NTPoly/NTPoly-3.1.0-foss-2023a.eb diff --git a/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb b/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb new file mode 100644 index 00000000000..c1e713bfa0d --- /dev/null +++ b/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb @@ -0,0 +1,93 @@ +easyblock = 'CMakeMake' + +name = 'DFTB+' +version = '24.1' + +homepage = 'https://www.dftb-plus.info' +description = """DFTB+ is a fast and efficient versatile quantum mechanical simulation package. +It is based on the Density Functional Tight Binding (DFTB) method, containing +almost all of the useful extensions which have been developed for the DFTB +framework so far. Using DFTB+ you can carry out quantum mechanical simulations +like with ab-initio density functional theory based packages, but in an +approximate way gaining typically around two order of magnitude in speed.""" + +toolchain = {'name': 'foss', 'version': '2023a'} +toolchainopts = {'usempi': True, 'openmp': True, 'pic': True} + +_external_dir = '%%(builddir)s/dftbplus-%%(version)s/external/%s/origin/' +_external_extract = 'mkdir -p %s && tar -C %s' % (_external_dir, _external_dir) +_external_extract += ' --strip-components=1 -xzf %%s' + +source_urls = ['https://github.com/dftbplus/dftbplus/releases/download/%(version)s'] +sources = [ + 'dftbplus-%(version)s.tar.xz', + { + # Slater-Koster (slakos) data for testing + 'source_urls': ['https://github.com/dftbplus/testparams/archive'], + 'download_filename': 'fbe3d62127d86bd8e49ad25a1e5793e6a095e8e7.tar.gz', + 'filename': 'slakos-data-%(version)s.tar.gz', + 'extract_cmd': _external_extract % ('slakos', 'slakos'), + }, + { + # GBSA (gbsa) data for testing + 'source_urls': ['https://github.com/grimme-lab/gbsa-parameters/archive'], + 'download_filename': '6836c4d997e4135e418cfbe273c96b1a3adb13e2.tar.gz', + 'filename': 'gbsa-data-%(version)s.tar.gz', + 'extract_cmd': _external_extract % ('gbsa', 'gbsa'), + }, +] +checksums = [ + {'dftbplus-24.1.tar.xz': '3bc405d1ab834b6b145ca671fb44565ec50a6f576e9e18e7a1ae2c613a311321'}, + {'slakos-data-24.1.tar.gz': '78a0494c2ff9216d6a9199ba07d632b18b809e0198f43905c044b5748bde488d'}, + {'gbsa-data-24.1.tar.gz': 'd464f9f7b1883d1353b433d0c7eae2f5606af092d9b51d38e9ed15e072610a79'}, +] + +builddependencies = [ + ('CMake', '3.26.3'), + ('pkgconf', '1.9.5'), + ('git', '2.41.0', '-nodocs'), +] + +dependencies = [ + ('Python', '3.11.3'), + ('SciPy-bundle', '2023.07'), + ('DFTD4', '3.7.0'), + ('ELSI', '2.11.0', '-PEXSI'), + ('libmbd', '0.12.6'), +] + +# Prefer dependencies from EB than bundled sources +configopts = '-DHYBRID_CONFIG_METHODS="Find;Submodule;Fetch" ' +configopts += '-DWITH_MPI=1 -DWITH_OMP=1 -DWITH_SDFTD3=1 -DWITH_ELSI=1 -DWITH_MBD=1 -DWITH_UNIT_TESTS=1 ' +configopts += '-DBUILD_SHARED_LIBS=1 -DWITH_API=1 -DWITH_PYTHON=0 ' # Python bindings installed as extension +configopts += '-DSCALAPACK_LIBRARY="$LIBSCALAPACK" ' + +runtest = 'test' + +exts_defaultclass = 'PythonPackage' +exts_default_options = { + 'download_dep_fail': True, + 'use_pip': True, + 'runtest': False, +} +exts_list = [ + ('dptools', version, { + 'source_tmpl': 'dftbplus-%(version)s.tar.xz', + 'source_urls': ['https://github.com/dftbplus/dftbplus/releases/download/%(version)s'], + 'start_dir': 'tools/dptools', + 'checksums': ['3bc405d1ab834b6b145ca671fb44565ec50a6f576e9e18e7a1ae2c613a311321'], + }), +] + +sanity_check_paths = { + 'files': ['bin/' + x for x in ['dftb+', 'dp_bands', 'dp_dos', 'gen2cif', 'gen2xyz', 'makecube', + 'modes', 'repeatgen', 'straingen', 'waveplot', 'xyz2gen']] + + ['lib/libdftbplus.%s' % SHLIB_EXT, 'lib/libmpifx.%s' % SHLIB_EXT], + 'dirs': ['include/dftbplus', 'lib/cmake', 'lib/pkgconfig', 'lib/python%(pyshortver)s/site-packages'] +} + +sanity_check_commands = ["python -c 'import dptools'"] + +modextrapaths = {'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages'} + +moduleclass = 'phys' diff --git a/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb new file mode 100644 index 00000000000..1ac711b9cf5 --- /dev/null +++ b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb @@ -0,0 +1,43 @@ +name = 'ELSI' +version = '2.11.0' +versionsuffix = '-PEXSI' + +homepage = 'https://wordpress.elsi-interchange.org/' +description = """ELSI provides and enhances scalable, open-source software library solutions for + electronic structure calculations in materials science, condensed matter physics, chemistry, and many other fields. + ELSI focuses on methods that solve or circumvent eigenvalue problems in electronic structure theory. + The ELSI infrastructure should also be useful for other challenging eigenvalue problems. +""" + +toolchain = {'name': 'foss', 'version': '2023a'} +toolchainopts = {'usempi': True, 'pic': True, 'cstd': 'c++11', 'extra_fflags': '-fallow-argument-mismatch'} + +source_urls = ['https://gitlab.com/elsi_project/elsi_interface/-/archive/v2.11.0/'] +sources = ['elsi_interface-v%(version)s.tar.gz'] +patches = [ + 'ELSI-2.11.0_bison_3.8_compat.patch', +] +checksums = [ + {'elsi_interface-v2.11.0.tar.gz': '2e6929827ed9c99a32381ed9da40482e862c28608d59d4f27db7dcbcaed1520d'}, + {'ELSI-2.11.0_bison_3.8_compat.patch': 'a1284f5c0f442129610aa0fb463cc2b54450e3511a2fd6c871fadc21a16e9504'}, +] + +builddependencies = [ + ('flex', '2.6.4'), + ('Bison', '3.8.2'), + ('CMake', '3.26.3'), +] + +dependencies = [ + ('ELPA', '2023.05.001'), + ('NTPoly', '3.1.0'), +] + +abs_path_compilers = True +build_internal_pexsi = True + +configopts = '-DENABLE_BSEPACK=ON ' + +runtest = True + +moduleclass = 'math' diff --git a/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0_bison_3.8_compat.patch b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0_bison_3.8_compat.patch new file mode 100644 index 00000000000..255ed4a5575 --- /dev/null +++ b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0_bison_3.8_compat.patch @@ -0,0 +1,14 @@ +Make it compatible with Bison 3.7 +Author: Åke Sandgren, 20211020 +Update: Cintia Willemyns (Vrije Universiteit Brussel) +--- elsi_interface-v2.11.0.orig/external/SCOTCH/CMakeLists.txt 2024-09-10 19:01:11.447551000 +0200 ++++ elsi_interface-v2.11.0/external/SCOTCH/CMakeLists.txt 2024-09-10 19:08:44.913993743 +0200 +@@ -56,7 +56,7 @@ + COMMAND mv ${PROJECT_BINARY_DIR}/generated/tmp2.c ${PROJECT_BINARY_DIR}/generated/parser_yy.c + # Versions of bison > 2.X insert a '#include tmp2.h' in tmp2.c. A simple 'mv' will not work. + # The file needs to remain in the directory with the old name. Hence the 'cp' +- COMMAND cp ${PROJECT_BINARY_DIR}/generated/tmp2.h ${PROJECT_BINARY_DIR}/generated/parser_ly.h ++ COMMAND ln -s ${PROJECT_BINARY_DIR}/generated/tmp2.h ${PROJECT_BINARY_DIR}/generated/parser_ly.h + COMMAND flex -Pscotchyy -o${PROJECT_BINARY_DIR}/generated/tmp1.c ${SCOTCH_DIR}/parser_ll.l + COMMAND mv ${PROJECT_BINARY_DIR}/generated/tmp1.c ${PROJECT_BINARY_DIR}/generated/parser_ll.c + DEPENDS ${SCOTCH_DIR}/parser_yy.y ${SCOTCH_DIR}/parser_ll.l ${SCOTCH_DIR}/parser_yy.h ${SCOTCH_DIR}/parser_ll.h diff --git a/easybuild/easyconfigs/l/libmbd/libmbd-0.12.6-foss-2023a.eb b/easybuild/easyconfigs/l/libmbd/libmbd-0.12.6-foss-2023a.eb new file mode 100644 index 00000000000..260ecb98ddb --- /dev/null +++ b/easybuild/easyconfigs/l/libmbd/libmbd-0.12.6-foss-2023a.eb @@ -0,0 +1,59 @@ +easyblock = 'CMakeMake' + +name = 'libmbd' +version = '0.12.6' + +homepage = 'https://libmbd.github.io/index.html' +description = """ +Libmbd implements the many-body dispersion (MBD) method in several programming languages and frameworks: + + - The Fortran implementation is the reference, most advanced implementation, with support for analytical + gradients and distributed parallelism, and additional functionality beyond the MBD method itself. + It provides a low-level and a high-level Fortran API, as well as a C API. Furthermore, Python bindings + to the C API are provided. + - The Python/Numpy implementation is intended for prototyping, and as a high-level language reference. + - The Python/Tensorflow implementation is an experiment that should enable rapid prototyping of machine + learning applications with MBD. + +The Python-based implementations as well as Python bindings to the Libmbd C API are accessible from the +Python package called Pymbd. +""" + +toolchain = {'name': 'foss', 'version': '2023a'} +toolchainopts = {'usempi': True, 'pic': True} + +github_account = 'libmbd' +source_urls = [GITHUB_SOURCE] +sources = ['%(version)s.tar.gz'] +checksums = ['9f8154b6b2f57e78a8e33d3b315a244185e8e5ecb03661a469808af7512e761e'] + +builddependencies = [ + ('CMake', '3.26.3'), + ('pkgconf', '1.9.5'), +] + +dependencies = [ + ('Python', '3.11.3'), + ('SciPy-bundle', '2023.07'), + ('ELSI', '2.11.0', '-PEXSI'), +] + +# build scripts expect either a git repo or a defined version string in a file +_versiontag_file = '%(builddir)s/%(name)s-%(version)s/cmake/LibmbdVersionTag.cmake' +preconfigopts = "echo 'set(VERSION_TAG \"%%(version)s\")' > %s && " % _versiontag_file + +configopts = "-DENABLE_SCALAPACK_MPI=ON -DENABLE_ELSI=ON " +configopts += "-DMPIEXEC_MAX_NUMPROCS=1 " # number of procs in the tests + +# make sure that built libraries (libmbd.so) in build directory are picked when running tests +# this is required when RPATH linking is used +pretestopts = "export LD_LIBRARY_PATH=%(builddir)s/easybuild_obj:$LD_LIBRARY_PATH && " + +runtest = 'test' + +sanity_check_paths = { + 'files': ['lib/libmbd.%s' % SHLIB_EXT, 'include/mbd/mbd.h', 'include/mbd/mbd.mod'], + 'dirs': ['lib/cmake/mbd'], +} + +moduleclass = 'phys' diff --git a/easybuild/easyconfigs/n/NTPoly/NTPoly-3.1.0-foss-2023a.eb b/easybuild/easyconfigs/n/NTPoly/NTPoly-3.1.0-foss-2023a.eb new file mode 100644 index 00000000000..8f7a531ce0e --- /dev/null +++ b/easybuild/easyconfigs/n/NTPoly/NTPoly-3.1.0-foss-2023a.eb @@ -0,0 +1,28 @@ +easyblock = 'CMakeMake' + +name = 'NTPoly' +version = '3.1.0' + +homepage = 'https://github.com/william-dawson/NTPoly' +description = """is a massively parallel library for computing the functions of sparse, symmetric matrices based on +polynomial expansions. For sufficiently sparse matrices, most of the matrix functions +in NTPoly can be computed in linear time.""" + +toolchain = {'name': 'foss', 'version': '2023a'} +toolchainopts = {'openmp': False, 'usempi': True} + +source_urls = ['https://github.com/william-dawson/NTPoly/archive/ntpoly-v%(version)s'] +sources = [SOURCELOWER_TAR_GZ] +checksums = ['71cd6827f20c68e384555dbcfc85422d0690e21d21d7b5d4f7375544a2755271'] + +builddependencies = [('CMake', '3.26.3')] + +build_shared_libs = True + +sanity_check_paths = { + 'files': ['include/%s.mod' % x for x in ['datatypesmodule', 'densitymatrixsolversmodule']] + + ['lib64/libNTPoly.%s' % SHLIB_EXT, 'lib/libNTPoly.%s' % SHLIB_EXT], + 'dirs': [] +} + +moduleclass = 'math' From 95d84e1426f1a98bca00bb48160d2672e21ce7d9 Mon Sep 17 00:00:00 2001 From: WilleBell Date: Fri, 13 Sep 2024 18:59:48 +0200 Subject: [PATCH 2/3] fix dftd4 name --- easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb b/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb index c1e713bfa0d..c862fcea552 100644 --- a/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb +++ b/easybuild/easyconfigs/d/DFTB+/DFTB+-24.1-foss-2023a.eb @@ -51,7 +51,7 @@ builddependencies = [ dependencies = [ ('Python', '3.11.3'), ('SciPy-bundle', '2023.07'), - ('DFTD4', '3.7.0'), + ('dftd4', '3.7.0'), ('ELSI', '2.11.0', '-PEXSI'), ('libmbd', '0.12.6'), ] From 1cfab50d0fa131df4d5108c42cce656c99a1ad78 Mon Sep 17 00:00:00 2001 From: WilleBell Date: Tue, 17 Sep 2024 17:14:30 +0200 Subject: [PATCH 3/3] Avoid test-suite fail for ELSI --- easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb index 1ac711b9cf5..a1be84f6de9 100644 --- a/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb +++ b/easybuild/easyconfigs/e/ELSI/ELSI-2.11.0-foss-2023a-PEXSI.eb @@ -38,6 +38,10 @@ build_internal_pexsi = True configopts = '-DENABLE_BSEPACK=ON ' +# Tests use 4 MPI ranks, they require a minimum of 4 cores +# Map each MPI process to a single CPU core to avoid tests fails +pretestopts = "export OMPI_MCA_rmaps_base_mapping_policy=slot:PE=1 && " + runtest = True moduleclass = 'math'