Skip to content

Commit 6cbbadb

Browse files
Merge pull request #2069 from boegel/cp2k_update
update CP2K easyblock for recent versions (>= 7.0)
2 parents c349034 + 1c9c58c commit 6cbbadb

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

easybuild/easyblocks/c/cp2k.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ def configure_common(self):
409409
options['LIBINTLIB'] = '%s/lib' % libint
410410
options['LIBS'] += ' %s -lstdc++ %s' % (libint_libs, libint_wrapper)
411411

412+
# add Libint include dir to $FCFLAGS
413+
options['FCFLAGS'] += ' -I' + os.path.join(libint, 'include')
414+
412415
else:
413416
# throw a warning, since CP2K without Libint doesn't make much sense
414417
self.log.warning("Libint module not loaded, so building without Libint support")
@@ -618,19 +621,20 @@ def build_step(self):
618621
-build_and_install
619622
"""
620623

621-
makefiles = os.path.join(self.cfg['start_dir'], 'makefiles')
622-
change_dir(makefiles)
624+
if LooseVersion(self.version) < LooseVersion('7.0'):
625+
makefiles = os.path.join(self.cfg['start_dir'], 'makefiles')
626+
change_dir(makefiles)
623627

624-
# modify makefile for parallel build
625-
parallel = self.cfg['parallel']
626-
if parallel:
628+
# modify makefile for parallel build
629+
parallel = self.cfg['parallel']
630+
if parallel:
627631

628-
try:
629-
for line in fileinput.input('Makefile', inplace=1, backup='.orig.patchictce'):
630-
line = re.sub(r"^PMAKE\s*=.*$", "PMAKE\t= $(SMAKE) -j %s" % parallel, line)
631-
sys.stdout.write(line)
632-
except IOError as err:
633-
raise EasyBuildError("Can't modify/write Makefile in %s: %s", makefiles, err)
632+
try:
633+
for line in fileinput.input('Makefile', inplace=1, backup='.orig.patchictce'):
634+
line = re.sub(r"^PMAKE\s*=.*$", "PMAKE\t= $(SMAKE) -j %s" % parallel, line)
635+
sys.stdout.write(line)
636+
except IOError as err:
637+
raise EasyBuildError("Can't modify/write Makefile in %s: %s", makefiles, err)
634638

635639
# update make options with MAKE
636640
self.cfg.update('buildopts', 'MAKE="make -j %s"' % self.cfg['parallel'])

0 commit comments

Comments
 (0)