Skip to content

Commit 1c7b67e

Browse files
authored
Merge pull request #2654 from smoors/20220117170952_new_pr_namd
update NAMD easyblock to allow non-system csh
2 parents 6200e8f + cd949a4 commit 1c7b67e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

easybuild/easyblocks/n/namd.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ def extract_step(self):
8686
srcdir = extract_file(self.charm_tarballs[0], os.getcwd(), change_into_dir=False)
8787
change_dir(srcdir)
8888

89+
def patch_step(self, *args, **kwargs):
90+
"""Patch scripts to avoid using hardcoded /bin/csh."""
91+
super(EB_NAMD, self).patch_step(*args, **kwargs)
92+
93+
self.charm_dir = self.charm_tarballs[0][:-4]
94+
95+
charm_config = os.path.join(self.charm_dir, 'src', 'scripts', 'configure')
96+
apply_regex_substitutions(charm_config, [(r'SHELL=/bin/csh', 'SHELL=$(which csh)')])
97+
98+
for csh_script in [os.path.join('plugins', 'import_tree'), os.path.join('psfgen', 'import_tree'),
99+
os.path.join(self.charm_dir, 'src', 'QuickThreads', 'time', 'raw')]:
100+
if os.path.exists(csh_script):
101+
apply_regex_substitutions(csh_script, [(r'^#!\s*/bin/csh\s*$', '#!/usr/bin/env csh')])
102+
89103
def configure_step(self):
90104
"""Custom configure step for NAMD, we build charm++ first (if required)."""
91105

0 commit comments

Comments
 (0)