Skip to content

Commit 929ba84

Browse files
authored
libfabric: Add variants for supported sanitizers (spack#2487)
1 parent 91e1177 commit 929ba84

File tree

1 file changed

+16
-0
lines changed
  • repos/spack_repo/builtin/packages/libfabric

1 file changed

+16
-0
lines changed

repos/spack_repo/builtin/packages/libfabric/package.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ class Libfabric(AutotoolsPackage, CudaPackage, ROCmPackage):
114114
variant("level_zero", default=False, description="Enable Level Zero support")
115115
variant("gdrcopy", default=False, when="@1.12: +cuda", description="Enable gdrcopy support")
116116

117+
variant("asan", default=False, when="@1.12:", description="Enable AddressSanitizer (ASan)")
118+
variant("lsan", default=False, when="@1.20:", description="Enable LeakSanitizer (LSan)")
119+
variant("tsan", default=False, when="@1.20:", description="Enable ThreadSanitizer (TSan)")
120+
variant(
121+
"ubsan",
122+
default=False,
123+
when="@1.20:",
124+
description="Enable UndefinedBehaviorSanitizer (UBSan)",
125+
)
126+
117127
# Backporting from main for versions 2.3.x
118128
# The CXI provider hardcodes CXIP_FI_VERSION to FI_VERSION(2, 2).
119129
# Make it match the libfabric we're building
@@ -170,6 +180,8 @@ class Libfabric(AutotoolsPackage, CudaPackage, ROCmPackage):
170180
"set by OPX, resulting in undefined behavior.",
171181
)
172182

183+
conflicts("+asan +tsan")
184+
173185
flag_handler = build_system_flags
174186

175187
@classmethod
@@ -219,6 +231,10 @@ def autoreconf(self, spec, prefix):
219231
def configure_args(self):
220232
args = [
221233
*self.enable_or_disable("debug"),
234+
*self.enable_or_disable("asan"),
235+
*self.enable_or_disable("lsan"),
236+
*self.enable_or_disable("tsan"),
237+
*self.enable_or_disable("ubsan"),
222238
*self.with_or_without("uring"),
223239
*self.with_or_without("cuda", activation_value="prefix"),
224240
*self.with_or_without("ze", variant="level_zero"),

0 commit comments

Comments
 (0)