Skip to content
Snippets Groups Projects
Commit 340eec63 authored by Sebastian Achilles's avatar Sebastian Achilles
Browse files

Merge branch 'CPMD-4.3_MIT-version' into '2023'

CPMD 4.3  MIT license

See merge request software-team/easybuild!2013
parents a8828154 6f0dc8fb
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,8 @@ EasyBuild support for building and installing CPMD, implemented as an easyblock ...@@ -36,7 +36,8 @@ EasyBuild support for building and installing CPMD, implemented as an easyblock
#the pseudo-fix is to remove installdir/obj as postinstallcmds from the easyconfig file #the pseudo-fix is to remove installdir/obj as postinstallcmds from the easyconfig file
#the documentation was missing and is now added in a somewhat weird procedure #the documentation was missing and is now added in a somewhat weird procedure
#to the builddir and subsequently copied to the installdir/doc via postinstallcmds from the easyconfig file #to the builddir and subsequently copied to the installdir/doc via postinstallcmds from the easyconfig file
#the hybrid MPI/OMP version can solely installed through the openmp toolchain option #the hybrid version is installed via prefix_opt = '-omp -DEST=' independent of toolchain options in easyconfig file
#
#the cuda implementation is ignored #the cuda implementation is ignored
# #
...@@ -68,6 +69,7 @@ class EB_CPMD(ConfigureMake): ...@@ -68,6 +69,7 @@ class EB_CPMD(ConfigureMake):
"""Custom easyconfig parameters for CPMD.""" """Custom easyconfig parameters for CPMD."""
extra_vars = { extra_vars = {
'base_configuration': [None, "Base configuration from which to start (file name)", CUSTOM], 'base_configuration': [None, "Base configuration from which to start (file name)", CUSTOM],
'MIT' : [None, "Open-Source Version of CPMD (MIT licence)",CUSTOM],
} }
return ConfigureMake.extra_options(extra_vars) return ConfigureMake.extra_options(extra_vars)
...@@ -89,7 +91,12 @@ class EB_CPMD(ConfigureMake): ...@@ -89,7 +91,12 @@ class EB_CPMD(ConfigureMake):
config_file_candidates = [] config_file_candidates = []
for confdirname in ["configure", "CONFIGURE"]: for confdirname in ["configure", "CONFIGURE"]:
config_file_prefix = os.path.join(self.builddir, "CPMD", confdirname) if self.cfg['MIT']:
cpmdname = 'CPMD-%s' % self.version
else:
cpmdname = 'CPMD'
config_file_prefix = os.path.join(self.builddir, cpmdname , confdirname)
if os.path.isdir(config_file_prefix): if os.path.isdir(config_file_prefix):
break break
else: else:
...@@ -149,6 +156,8 @@ class EB_CPMD(ConfigureMake): ...@@ -149,6 +156,8 @@ class EB_CPMD(ConfigureMake):
(r"^(\s*CC=.*)", r"#\1"), (r"^(\s*CC=.*)", r"#\1"),
(r"^(\s*FC=.*)", r"#\1"), (r"^(\s*FC=.*)", r"#\1"),
(r"^(\s*LD)=.*", r"\1='$(FC)'"), (r"^(\s*LD)=.*", r"\1='$(FC)'"),
(r" -openmp ", r" -qopenmp "),
(r"-mkl=", r"-qmkl="),
]) ])
except IOError as err: except IOError as err:
raise EasyBuildError("Failed to patch %s: %s", selected_base_config, err) raise EasyBuildError("Failed to patch %s: %s", selected_base_config, err)
...@@ -174,8 +183,8 @@ class EB_CPMD(ConfigureMake): ...@@ -174,8 +183,8 @@ class EB_CPMD(ConfigureMake):
options = [self.cfg['configopts']] options = [self.cfg['configopts']]
# enable OpenMP support if desired # enable OpenMP support if desired
if self.toolchain.options.get('openmp', None) and LooseVersion(self.version) >= LooseVersion('4.0'): # if self.toolchain.options.get('openmp', None) and LooseVersion(self.version) >= LooseVersion('4.0'):
options.append("-omp") # options.append("-omp")
# This "option" has to come last as it's the chief argument, coming after # This "option" has to come last as it's the chief argument, coming after
# all flags and so forth. # all flags and so forth.
...@@ -240,11 +249,12 @@ class EB_CPMD(ConfigureMake): ...@@ -240,11 +249,12 @@ class EB_CPMD(ConfigureMake):
if preproc_flag is None: if preproc_flag is None:
preproc_flag = '' preproc_flag = ''
# do not use default='None' for CPPFLAGS
apply_regex_substitutions(makefile, [ apply_regex_substitutions(makefile, [
(r"^(\s*CPPFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('CPPFLAGS'))), (r"^(\s*CPPFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('CPPFLAGS',' '))),
(r"^(\s*CFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('CFLAGS'))), (r"^(\s*CFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('CFLAGS',' '))),
(r"^(\s*FFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('FFLAGS'))), (r"^(\s*FFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('FFLAGS',' '))),
(r"^(\s*LFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('LDFLAGS'))), (r"^(\s*LFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('LDFLAGS',' '))),
# Allow to define own XFLAGS # Allow to define own XFLAGS
(r"# CPPFLAGS =", r"CPPFLAGS +="), (r"# CPPFLAGS =", r"CPPFLAGS +="),
...@@ -259,14 +269,14 @@ class EB_CPMD(ConfigureMake): ...@@ -259,14 +269,14 @@ class EB_CPMD(ConfigureMake):
]) ])
if self.toolchain.options.get('openmp', None): if self.toolchain.options.get('openmp', None):
apply_regex_substitutions(makefile, [ apply_regex_substitutions(makefile, [
(r"^(\s*LFLAGS\s*=.*)", r"\1 {0} {1}".format(os.getenv('LIBLAPACK_MT'), os.getenv('LIBBLAS_MT'))) (r"^(\s*LFLAGS\s*=.*)", r"\1 {0} {1}".format(os.getenv('LIBLAPACK_MT',' '), os.getenv('LIBBLAS_MT',' ')))
]) ])
else: else:
apply_regex_substitutions(makefile, [ apply_regex_substitutions(makefile, [
(r"^(\s*LFLAGS\s*=.*)", r"\1 {0} {1}".format(os.getenv('LIBLAPACK'), os.getenv('LIBBLAS'))) (r"^(\s*LFLAGS\s*=.*)", r"\1 {0} {1}".format(os.getenv('LIBLAPACK',' '), os.getenv('LIBBLAS',' ')))
]) ])
apply_regex_substitutions(makefile, [ apply_regex_substitutions(makefile, [
(r"^(\s*LFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('LIBFFT'))), (r"^(\s*LFLAGS\s*=.*)", r"\1 {0}".format(os.getenv('LIBFFT',' '))),
]) ])
if get_software_root('imkl'): if get_software_root('imkl'):
......
name = 'CPMD'
version = '4.3'
versionsuffix = '_MIT'
homepage = 'https://github.com/CPMD-code'
description = """The CPMD code is a parallelized plane wave / pseudopotential
implementation of Density Functional Theory, particularly designed for
ab-initio molecular dynamics. This is version 4.3 released under MIT licence in January 2023.
"""
toolchain = {'name': 'intel-para', 'version': '2022a'}
toolchainopts = {'usempi': True}
sources = [
{'download_filename': 'archive/refs/tags/%(version)s.tar.gz', 'filename': 'cpmd-4.3MIT.tar.gz'},
'cpmd4.3_manual.pdf',
]
source_urls = [
'https://github.com/CPMD-code/CPMD',
]
patches = [
'cppflags.patch',
'%(namelower)s-v%(version)s-config.patch'
]
checksums = [
'e0290f9da0d255f90a612e60662b14a97ca53003f89073c6af84fa7bc8739f65',
'2bfe01db05df1cb21cc8eae500da92b7744c786beeef25e6b2c86116ffc2e135',
'36c57801d5643c5e07f81ce7d4e973ae2e3100fb61220bccbbe4de3629c20d8c',
'45719bf7ca0c567c9c78b3f23201976fceda565d47fea2d1bc998b72fdc53caa',
]
# the cpmd.py post-cleanup of the results of the configure step
# is rather error-prone
preconfigopts = 'pwd && chmod u+x scripts/configure.sh && '
prefix_opt = '-DEST='
MIT = True
postinstallcmds = [
'rm -rf %(installdir)s/obj',
'mkdir %(installdir)s/doc',
'cp %(builddir)s/cpmd4.3_manual.pdf %(installdir)s/doc'
]
sanity_check_paths = {
'files': ['bin/cpmd.x', 'lib/libcpmd.a'],
'dirs': ['bin', 'lib'],
}
modloadmsg = 'MPI-Version: cpmd.x \n'
moduleclass = 'chem'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment