forked from spack/spack
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
160 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ class Touchdetector(CMakePackage): | |
|
||
version("develop", branch="main") | ||
version("7.0.1", tag="v7.0.1") | ||
version("7.0.0", tag="v7.0.0") | ||
version("6.0.3", tag="6.0.3") | ||
|
||
variant("caliper", default=True, description="Enables profiling with Caliper") | ||
variant("asan", default=False, description="Enables AdressSanitizer") | ||
|
@@ -35,61 +33,33 @@ class Touchdetector(CMakePackage): | |
|
||
depends_on("benchmark", when="+benchmark") | ||
depends_on("[email protected]:+mpi", when="+caliper") | ||
depends_on("catch2@2", when="@6") | ||
depends_on("catch2@3", when="@7:") | ||
depends_on("catch2@3") | ||
depends_on("eigen") | ||
depends_on("fmt@:5.999 cxxstd=20") | ||
depends_on("intel-oneapi-tbb") | ||
depends_on("[email protected]: cxxstd=20") | ||
depends_on("[email protected]:", when="@7:") | ||
depends_on("[email protected]:", when="@:6.0.3") | ||
depends_on("[email protected]:") | ||
depends_on("nlohmann-json") | ||
depends_on("pugixml", when="@4.5:6") | ||
depends_on("random123", when="@5.3.3:") | ||
depends_on("range-v3@:0.10", when="@5.3.3:") | ||
depends_on("yaml-cpp", when="@7:") | ||
depends_on("random123") | ||
depends_on("range-v3@:0.10") | ||
depends_on("yaml-cpp") | ||
|
||
depends_on("mvapich2", when="[email protected]:") | ||
depends_on("mvapich2", when="[email protected]:") | ||
|
||
depends_on("highfive+mpi", when="@7:") | ||
|
||
def patch(self): | ||
if self.spec.satisfies("@5.6.1"): | ||
filter_file( | ||
r"(int messageLength) = -1;$", | ||
r"\1 = 0;", | ||
"touchdetector/DistributedTouchDetector.cxx", | ||
) | ||
depends_on("highfive+mpi") | ||
|
||
def cmake_args(self): | ||
args = [] | ||
|
||
if self.spec.satisfies("@:5.6.1"): | ||
args += [ | ||
self.define("CMAKE_C_COMPILER", self.spec["mpi"].mpicc), | ||
self.define("CMAKE_CXX_COMPILER", self.spec["mpi"].mpicxx), | ||
] | ||
|
||
if self.spec.satisfies("@5.7.0:"): | ||
use_tests = self.spec.satisfies("@develop") or "+test" in self.spec | ||
args += [ | ||
self.define_from_variant("ENABLE_CALIPER", "caliper"), | ||
self.define_from_variant("ENABLE_ASAN", "asan"), | ||
self.define_from_variant("ENABLE_UBSAN", "ubsan"), | ||
self.define_from_variant("ENABLE_BENCHMARKS", "benchmark"), | ||
self.define("ENABLE_TESTS", use_tests), | ||
] | ||
|
||
if "+clang-tidy" in self.spec: | ||
self.args.append(self.define("CMAKE_CXX_CLANG_TIDY", "clang-tidy")) | ||
use_tests = self.spec.satisfies("@develop") or "+test" in self.spec | ||
args = [ | ||
self.define_from_variant("ENABLE_CALIPER", "caliper"), | ||
self.define_from_variant("ENABLE_ASAN", "asan"), | ||
self.define_from_variant("ENABLE_UBSAN", "ubsan"), | ||
self.define_from_variant("ENABLE_BENCHMARKS", "benchmark"), | ||
self.define("ENABLE_TESTS", use_tests), | ||
] | ||
|
||
if "+clang-tidy" in self.spec: | ||
self.args.append(self.define("CMAKE_CXX_CLANG_TIDY", "clang-tidy")) | ||
|
||
return args | ||
|
||
def setup_build_environment(self, env): | ||
# The default CMAKE_PREFIX_PATH may not contain the necessary symlink to the TBB | ||
# CMake glue, set it ourselves. | ||
# | ||
# This conditional needs to be removed in 2023 with a new deployment. | ||
if "tbb" in self.spec and hasattr(self.spec["tbb"].package, "component_prefix"): | ||
env.prepend_path("CMAKE_PREFIX_PATH", self.spec["tbb"].package.component_prefix) |