diff options
-rw-r--r-- | var/spack/repos/builtin/packages/axom/package.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index 6381989c4b..b97a5985d2 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -274,15 +274,20 @@ class Axom(CachedCMakePackage, CudaPackage): # Fix for working around CMake adding implicit link directories # returned by the BlueOS compilers to link executables with # non-system default stdlib - _gcc_prefix = "/usr/tce/packages/gcc/gcc-4.9.3/lib64" - if os.path.exists(_gcc_prefix): - _gcc_prefix2 = pjoin( - _gcc_prefix, - "gcc/powerpc64le-unknown-linux-gnu/4.9.3") - _link_dirs = "{0};{1}".format(_gcc_prefix, _gcc_prefix2) + _roots = ["/usr/tce/packages/gcc/gcc-4.9.3", + "/usr/tce/packages/gcc/gcc-4.9.3/gnu"] + _subdirs = ["lib64", + "lib64/gcc/powerpc64le-unknown-linux-gnu/4.9.3"] + _existing_paths = [] + for root in _roots: + for subdir in _subdirs: + _curr_path = pjoin(root, subdir) + if os.path.exists(_curr_path): + _existing_paths.append(_curr_path) + if _existing_paths: entries.append(cmake_cache_string( "BLT_CMAKE_IMPLICIT_LINK_DIRECTORIES_EXCLUDE", - _link_dirs)) + ";".join(_existing_paths))) return entries |