Skip to content

Commit

Permalink
gcc: Only create and sanity-check symlinks for actualy built languages
Browse files Browse the repository at this point in the history
  • Loading branch information
bertwesarg committed May 22, 2024
1 parent cbb9ece commit 0212e43
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions easybuild/easyblocks/g/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,16 @@
DEFAULT_LANGUAGES = ['c', 'c++', 'fortran']
# Additional symlinks to create for compiler commands
COMP_CMD_SYMLINKS = {
'cc': 'gcc',
'c++': 'g++',
'f77': 'gfortran',
'f95': 'gfortran',
'c': {
'cc': 'gcc'
},
'c++': {
'c++': 'g++'
},
'fortran': {
'f77': 'gfortran',
'f95': 'gfortran',
}
}

RECREATE_INCLUDE_FIXED_SCRIPT_TMPL = """#!/bin/bash
Expand Down Expand Up @@ -907,8 +913,8 @@ def post_install_step(self, *args, **kwargs):

# Add symlinks for cc/c++/f77/f95.
bindir = os.path.join(self.installdir, 'bin')
for key in COMP_CMD_SYMLINKS:
src = COMP_CMD_SYMLINKS[key]
languages = self.cfg['languages'] or DEFAULT_LANGUAGES
for key, src in [x for l in languages & COMP_CMD_SYMLINKS.keys() for x in COMP_CMD_SYMLINKS[l].items()]:
target = os.path.join(bindir, key)
if os.path.exists(target):
self.log.info("'%s' already exists in %s, not replacing it with symlink to '%s'",
Expand Down Expand Up @@ -1103,7 +1109,7 @@ def sanity_check_step(self):
common_infix = os.path.join('gcc', config_name_subdir, self.version)
libexec_files = [tuple([os.path.join(d, common_infix, x) for d in libdirs]) for x in libexec_files]

old_cmds = [os.path.join('bin', x) for x in COMP_CMD_SYMLINKS.keys()]
old_cmds = [os.path.join('bin', x) for l in languages & COMP_CMD_SYMLINKS.keys() for x in COMP_CMD_SYMLINKS[l]]

custom_paths = {
'files': bin_files + lib_files + libexec_files + old_cmds,
Expand Down

0 comments on commit 0212e43

Please sign in to comment.