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
This commit is contained in:
Chris White 2020-08-12 18:15:59 -07:00 committed by GitHub
parent fa216e5f15
commit 105caa7297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 11 deletions

View File

@ -40,7 +40,7 @@
VALID_VERSION = r'[A-Za-z0-9_.-]'
# Infinity-like versions. The order in the list implies the comparison rules
infinity_versions = ['develop', 'master', 'head', 'trunk']
infinity_versions = ['develop', 'main', 'master', 'head', 'trunk']
def int_if_int(string):

View File

@ -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 @@ def hostconfig(self, spec, prefix):
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 @@ def cmake_args(self):
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')

View File

@ -408,7 +408,7 @@ def create_host_config(self, spec, prefix, py_site_pkgs_dir=None):
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 @@ def create_host_config(self, spec, prefix, py_site_pkgs_dir=None):
# 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