LBANN: add explicit variant for shared builds (#40808)
This commit is contained in:
parent
afa2a2566e
commit
d05dc8a468
@ -156,6 +156,9 @@ class Lbann(CachedCMakePackage, CudaPackage, ROCmPackage):
|
|||||||
variant("asan", default=False, description="Build with support for address-sanitizer")
|
variant("asan", default=False, description="Build with support for address-sanitizer")
|
||||||
variant("unit_tests", default=False, description="Support for unit testing")
|
variant("unit_tests", default=False, description="Support for unit testing")
|
||||||
variant("caliper", default=False, description="Support for instrumentation with caliper")
|
variant("caliper", default=False, description="Support for instrumentation with caliper")
|
||||||
|
variant(
|
||||||
|
"shared", default=True, sticky=True, description="Enables the build of shared libraries"
|
||||||
|
)
|
||||||
|
|
||||||
# LBANN benefits from high performance linkers, but passing these in as command
|
# LBANN benefits from high performance linkers, but passing these in as command
|
||||||
# line options forces the linker flags to unnecessarily propagate to all
|
# line options forces the linker flags to unnecessarily propagate to all
|
||||||
@ -241,6 +244,8 @@ class Lbann(CachedCMakePackage, CudaPackage, ROCmPackage):
|
|||||||
depends_on("dihydrogen@:0.0,0.2:", when="@:0.90,0.102: +dihydrogen")
|
depends_on("dihydrogen@:0.0,0.2:", when="@:0.90,0.102: +dihydrogen")
|
||||||
conflicts("~dihydrogen", when="+distconv")
|
conflicts("~dihydrogen", when="+distconv")
|
||||||
|
|
||||||
|
depends_on("hdf5+mpi", when="+distconv")
|
||||||
|
|
||||||
for arch in CudaPackage.cuda_arch_values:
|
for arch in CudaPackage.cuda_arch_values:
|
||||||
depends_on("hydrogen cuda_arch=%s" % arch, when="+cuda cuda_arch=%s" % arch)
|
depends_on("hydrogen cuda_arch=%s" % arch, when="+cuda cuda_arch=%s" % arch)
|
||||||
depends_on("aluminum cuda_arch=%s" % arch, when="+al +cuda cuda_arch=%s" % arch)
|
depends_on("aluminum cuda_arch=%s" % arch, when="+al +cuda cuda_arch=%s" % arch)
|
||||||
@ -343,6 +348,11 @@ def _get_sys_type(self, spec):
|
|||||||
sys_type = env["SYS_TYPE"]
|
sys_type = env["SYS_TYPE"]
|
||||||
return sys_type
|
return sys_type
|
||||||
|
|
||||||
|
@property
|
||||||
|
def libs(self):
|
||||||
|
shared = True if "+shared" in self.spec else False
|
||||||
|
return find_libraries("liblbann", root=self.prefix, shared=shared, recursive=True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cache_name(self):
|
def cache_name(self):
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
@ -360,6 +370,7 @@ def initconfig_compiler_entries(self):
|
|||||||
spec = self.spec
|
spec = self.spec
|
||||||
entries = super().initconfig_compiler_entries()
|
entries = super().initconfig_compiler_entries()
|
||||||
entries.append(cmake_cache_string("CMAKE_CXX_STANDARD", "17"))
|
entries.append(cmake_cache_string("CMAKE_CXX_STANDARD", "17"))
|
||||||
|
entries.append(cmake_cache_option("BUILD_SHARED_LIBS", "+shared" in spec))
|
||||||
if not spec.satisfies("^cmake@3.23.0"):
|
if not spec.satisfies("^cmake@3.23.0"):
|
||||||
# There is a bug with using Ninja generator in this version
|
# There is a bug with using Ninja generator in this version
|
||||||
# of CMake
|
# of CMake
|
||||||
|
Loading…
Reference in New Issue
Block a user