Skip to content

Commit 63cea59

Browse files
make sure the top level fujitsu library dir is found by the rpath wrapper
1 parent 558487e commit 63cea59

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

easybuild/toolchains/compiler/fujitsu.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,22 @@
2929
3030
:author: Miguel Dias Costa (National University of Singapore)
3131
"""
32+
import os
33+
34+
import easybuild.tools.environment as env
3235
import easybuild.tools.systemtools as systemtools
3336
from easybuild.tools.toolchain.compiler import Compiler, DEFAULT_OPT_LEVEL
3437

3538
TC_CONSTANT_FUJITSU = 'Fujitsu'
39+
TC_CONSTANT_MODULE_NAME = 'lang'
40+
TC_CONSTANT_MODULE_VAR = 'FJSVXTCLANGA'
3641

3742

3843
class FujitsuCompiler(Compiler):
3944
"""Generic support for using Fujitsu compiler drivers."""
4045
TOOLCHAIN_FAMILY = TC_CONSTANT_FUJITSU
4146

42-
# compiler module name is lang (with version e.g. tcsds-1.2.31)
43-
COMPILER_MODULE_NAME = ['lang']
47+
COMPILER_MODULE_NAME = [TC_CONSTANT_MODULE_NAME]
4448
COMPILER_FAMILY = TC_CONSTANT_FUJITSU
4549

4650
# make sure fcc is always called in clang compatibility mode
@@ -82,6 +86,14 @@ class FujitsuCompiler(Compiler):
8286
(systemtools.AARCH64, systemtools.ARM): '-mcpu=generic -mtune=generic',
8387
}
8488

89+
def prepare(self, *args, **kwargs):
90+
super(FujitsuCompiler, self).prepare(*args, **kwargs)
91+
92+
# make sure the fujitsu module libraries are found (and added to rpath by wrapper)
93+
libdir = os.path.join(os.getenv(TC_CONSTANT_MODULE_VAR), 'lib64')
94+
self.log.debug("Adding %s to $LIBRARY_PATH" % libdir)
95+
env.setvar('LIBRARY_PATH', os.pathsep.join([os.getenv('LIBRARY_PATH'), libdir]))
96+
8597
def _set_compiler_vars(self):
8698
super(FujitsuCompiler, self)._set_compiler_vars()
8799

easybuild/toolchains/linalg/fujitsussl.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@
2929
"""
3030
import os
3131

32-
32+
from easybuild.toolchains.compiler.fujitsu import TC_CONSTANT_MODULE_NAME, TC_CONSTANT_MODULE_VAR
3333
from easybuild.tools.build_log import EasyBuildError
3434
from easybuild.tools.toolchain.constants import COMPILER_FLAGS
3535
from easybuild.tools.toolchain.linalg import LinAlg
3636

37-
3837
FUJITSU_SSL_MODULE_NAME = None
3938
TC_CONSTANT_FUJITSU_SSL = 'FujitsuSSL'
4039

@@ -43,7 +42,7 @@ class FujitsuSSL(LinAlg):
4342
"""Support for Fujitsu's SSL library, which provides BLAS/LAPACK support."""
4443
# BLAS/LAPACK support
4544
# via lang/tcsds module
46-
BLAS_MODULE_NAME = ['lang']
45+
BLAS_MODULE_NAME = [TC_CONSTANT_MODULE_NAME]
4746

4847
# no need to specify libraries nor includes, only the compiler flags below
4948
BLAS_LIB = ['']
@@ -71,9 +70,8 @@ class FujitsuSSL(LinAlg):
7170

7271
def _get_software_root(self, name):
7372
"""Get install prefix for specified software name; special treatment for Fujitsu modules."""
74-
if name == 'lang':
75-
# Fujitsu-provided module
76-
env_var = 'FJSVXTCLANGA'
73+
if name == TC_CONSTANT_MODULE_NAME:
74+
env_var = TC_CONSTANT_MODULE_VAR
7775
root = os.getenv(env_var)
7876
if root is None:
7977
raise EasyBuildError("Failed to determine install prefix for %s via $%s", name, env_var)

0 commit comments

Comments
 (0)