Skip to content

Commit adf3b83

Browse files
committed
make gcc easyblock aware of module-search-path-headers
1 parent 9926576 commit adf3b83

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

easybuild/easyblocks/g/gcc.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,17 @@ def __init__(self, *args, **kwargs):
203203
self.log.warning('Setting withnvptx to False, since we are building on a RISC-V system')
204204
self.cfg['withnvptx'] = False
205205

206-
# define list of subdirectories in search paths of module load environment
207-
self.module_load_environment.PATH = ['bin']
208-
self.module_load_environment.LD_LIBRARY_PATH = ['lib', 'lib64']
209-
# GCC can find its own headers and libraries but the .so's need to be in LD_LIBRARY_PATH
210-
self.module_load_environment.CPATH = []
211-
self.module_load_environment.LIBRARY_PATH = ['lib', 'lib64'] if get_cpu_family() == RISCV else []
206+
# GCC can find its own headers and libraries in most cases, but we had
207+
# cases where paths top libraries needed to be set explicitly
208+
# see: https://github.com/easybuilders/easybuild-easyblocks/pull/3256
209+
# Therefore, remove paths from header search paths but keep paths in LIBRARY_PATH
210+
for header_search_path in self.module_load_environment.alias_vars('HEADERS'):
211+
try:
212+
delattr(self.module_load_environment, header_search_path)
213+
except AttributeError:
214+
pass
215+
else:
216+
self.log.debug(f"Removing ${header_search_path} from module file of {self.name}")
212217

213218
def create_dir(self, dirname):
214219
"""

0 commit comments

Comments
 (0)