From cd27611d2f601a04aab1bed10fd2d728ef20c24e Mon Sep 17 00:00:00 2001 From: Ted Stern Date: Thu, 1 Jun 2023 13:01:43 -0700 Subject: Adding libpsm3 package (#37444) * Adding libpsm3 package * Make changes suggested by flake8 * Make one more flake8-suggested change, blank line after 'import os' * Change to standard header to pass flake8 tests * Update doc string, remove unnecessary comments * Reviewer-recommende changes * Alphabetize variants * Use helper functions * Change quotes to pass spack style check --- .../repos/builtin/packages/libpsm3/package.py | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 var/spack/repos/builtin/packages/libpsm3/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/libpsm3/package.py b/var/spack/repos/builtin/packages/libpsm3/package.py new file mode 100644 index 0000000000..620777fc17 --- /dev/null +++ b/var/spack/repos/builtin/packages/libpsm3/package.py @@ -0,0 +1,60 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import os + +from spack.package import * + + +class Libpsm3(AutotoolsPackage): + """PSM3 provider for the PSM3 OFI provider""" + + homepage = "https://ofiwg.github.io/libfabric/v1.12.0/man/fi_psm3.7.html" + url = "https://github.com/intel/eth-psm3-fi/archive/refs/tags/v11.4.1.0.tar.gz" + git = "https://github.com/intel/eth-psm3-fi.git" + + version( + "11.4.1.0", + sha256="272adb9ec10edf709bfcfccc6b6e9296d25d892c36b845ad577caeb82b70c9ac", + preferred=True, + ) + + variant("atomics", default=True, description="Enable atomics") + variant("debug", default=False, description="Enable debugging") + variant("sockets", default=True, description="Enable PSM3 sockets") + variant("verbs", default=False, description="Enable PSM3 verbs") + + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("numactl") + depends_on("uuid") + + maintainers("dodecatheon", "douglasjacobsen") + + def configure_args(self): + config_args = [] + config_args.extend(self.enable_or_disable("atomics")) + config_args.extend(self.enable_or_disable("debug")) + config_args += self.enable_or_disable("psm3-sockets", variant="sockets") + config_args += self.enable_or_disable("psm3-verbs", variant="verbs") + return config_args + + def build(self, spec, prefix): + make() + + def install(self, spec, prefix): + install_tree("src/.libs", prefix.lib) + os.unlink("%s/libpsm3-fi.la" % prefix.lib) + install("src/libpsm3-fi.la", prefix.lib) + + def setup_run_environment(self, env): + env.prepend_path("FI_PROVIDER_PATH", self.prefix.lib) + env.set("FI_PROVIDER", "psm3") + env.set("PSM3_ALLOW_ROUTERS", "1") + if "+sockets" in self.spec and "~verbs" in self.spec: + env.set("PSM3_HAL", "sockets") + env.set("FI_PSM3_NAME_SERVER", "1") + if "+debug" in self.spec: + env.set("PSM3_IDENTIFY", "1") -- cgit v1.2.3-70-g09d2