From 105caa729709ab8ebfac65a26da03861353bbd1a Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 12 Aug 2020 18:15:59 -0700 Subject: Axom + Conduit updates (#17863) * Loosen Axom's variants, add shared variant for axom, fix clang/xlf rpath'ing problem on blueos * Fix flake8 * Add main branch to list of known git branches --- var/spack/repos/builtin/packages/axom/package.py | 26 ++++++++++++++++------ .../repos/builtin/packages/conduit/package.py | 11 ++++++--- 2 files changed, 27 insertions(+), 10 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index a4e954711a..2bb6500cf1 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -51,7 +51,7 @@ class Axom(CMakePackage, CudaPackage): homepage = "https://github.com/LLNL/axom" git = "https://github.com/LLNL/axom.git" - version('master', branch='master', submodules=True) + version('main', branch='main', submodules=True) version('develop', branch='develop', submodules=True) version('0.3.3', tag='v0.3.3', submodules="True") version('0.3.2', tag='v0.3.2', submodules="True") @@ -65,6 +65,8 @@ class Axom(CMakePackage, CudaPackage): # ----------------------------------------------------------------------- # Variants # ----------------------------------------------------------------------- + variant('shared', default=True, + description='Enable build of shared libraries') variant('debug', default=False, description='Build debug instead of optimized version') @@ -96,12 +98,10 @@ class Axom(CMakePackage, CudaPackage): depends_on("mpi", when="+mpi") # Libraries - depends_on("conduit~shared+python", when="+python") - depends_on("conduit~shared~python", when="~python") - depends_on("conduit~shared+python+hdf5", when="+hdf5+python") - depends_on("conduit~shared+python~hdf5", when="~hdf5+python") - depends_on("conduit~shared~python+hdf5", when="+hdf5~python") - depends_on("conduit~shared~python~hdf5", when="~hdf5~python") + depends_on("conduit+python", when="+python") + depends_on("conduit~python", when="~python") + depends_on("conduit+hdf5", when="+hdf5") + depends_on("conduit~hdf5", when="~hdf5") # HDF5 needs to be the same as Conduit's depends_on("hdf5@1.8.19:1.8.999~mpi~cxx~shared~fortran", when="+hdf5") @@ -471,6 +471,11 @@ class Axom(CMakePackage, CudaPackage): linker_flags = "${BLT_EXE_LINKER_FLAGS} -Wl,-rpath," + libdir cfg.write(cmake_cache_entry("BLT_EXE_LINKER_FLAGS", linker_flags, description)) + if "+shared" in spec: + linker_flags = "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath," \ + + libdir + cfg.write(cmake_cache_entry("CMAKE_SHARED_LINKER_FLAGS", + linker_flags, description)) if "+cuda" in spec: cfg.write("#------------------{0}\n".format("-" * 60)) @@ -530,10 +535,17 @@ class Axom(CMakePackage, CudaPackage): options = [] options.extend(['-C', host_config_path]) + if self.run_tests is False: options.append('-DENABLE_TESTS=OFF') else: options.append('-DENABLE_TESTS=ON') + + if "+shared" in spec: + options.append('-DBUILD_SHARED_LIBS=ON') + else: + options.append('-DBUILD_SHARED_LIBS=OFF') + return options @run_after('install') diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index 55515de9fb..8aae3db8b2 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -408,7 +408,7 @@ class Conduit(Package): cfg.write(cmake_cache_entry("CMAKE_Fortran_COMPILER_ID", "XL")) - if 'xl@coral' in os.getenv('SPACK_COMPILER_SPEC', ""): + if (f_compiler is not None) and ("xlf" in f_compiler): # Fix missing std linker flag in xlc compiler flags = "-WF,-C! -qxlf2003=polymorphic" cfg.write(cmake_cache_entry("BLT_FORTRAN_FLAGS", @@ -416,10 +416,15 @@ class Conduit(Package): # Grab lib directory for the current fortran compiler libdir = os.path.join(os.path.dirname( os.path.dirname(f_compiler)), "lib") - flags = "${BLT_EXE_LINKER_FLAGS} -lstdc++ " - flags += "-Wl,-rpath,{0} -Wl,-rpath,{0}64".format(libdir) + rpaths = "-Wl,-rpath,{0} -Wl,-rpath,{0}64".format(libdir) + + flags = "${BLT_EXE_LINKER_FLAGS} -lstdc++ " + rpaths cfg.write(cmake_cache_entry("BLT_EXE_LINKER_FLAGS", flags)) + if "+shared" in spec: + flags = "${CMAKE_SHARED_LINKER_FLAGS} " + rpaths + cfg.write(cmake_cache_entry( + "CMAKE_SHARED_LINKER_FLAGS", flags)) ####################### # Python -- cgit v1.2.3-70-g09d2