summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeselin Dobrev <v-dobrev@users.noreply.github.com>2023-10-30 01:36:02 -0700
committerGitHub <noreply@github.com>2023-10-30 09:36:02 +0100
commit33cb8c988f3fd9afb364b403eda3aaaabe130729 (patch)
tree9c19b9a5f939d10ca9825ff0f4eab101ab682447
parent6511d3dfff391093d498e2657a4c6291a6e8b538 (diff)
downloadspack-33cb8c988f3fd9afb364b403eda3aaaabe130729.tar.gz
spack-33cb8c988f3fd9afb364b403eda3aaaabe130729.tar.bz2
spack-33cb8c988f3fd9afb364b403eda3aaaabe130729.tar.xz
spack-33cb8c988f3fd9afb364b403eda3aaaabe130729.zip
Fix an issue with using the environment variable `MACHTYPE` which is not always defined (#40733)
* Fix an issue reported here: https://github.com/spack/spack/pull/36154#issuecomment-1781854894 * [@spackbot] updating style on behalf of v-dobrev
-rw-r--r--var/spack/repos/builtin/packages/butterflypack/package.py4
-rw-r--r--var/spack/repos/builtin/packages/strumpack/package.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/butterflypack/package.py b/var/spack/repos/builtin/packages/butterflypack/package.py
index 848dbcdfeb..c9726a52aa 100644
--- a/var/spack/repos/builtin/packages/butterflypack/package.py
+++ b/var/spack/repos/builtin/packages/butterflypack/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from platform import machine
+
from spack.package import *
@@ -74,7 +76,7 @@ class Butterflypack(CMakePackage):
args.append("-Denable_openmp=%s" % ("ON" if "+openmp" in spec else "OFF"))
if "%cce" in spec:
# Assume the proper Cray CCE module (cce) is loaded:
- craylibs_path = env["CRAYLIBS_" + env["MACHTYPE"].capitalize()]
+ craylibs_path = env["CRAYLIBS_" + machine().upper()]
env.setdefault("LDFLAGS", "")
env["LDFLAGS"] += " -Wl,-rpath," + craylibs_path
diff --git a/var/spack/repos/builtin/packages/strumpack/package.py b/var/spack/repos/builtin/packages/strumpack/package.py
index fce0c4cd17..a82b3784b4 100644
--- a/var/spack/repos/builtin/packages/strumpack/package.py
+++ b/var/spack/repos/builtin/packages/strumpack/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+from platform import machine
+
from spack.package import *
from spack.util.environment import set_env
@@ -173,7 +175,7 @@ class Strumpack(CMakePackage, CudaPackage, ROCmPackage):
if "%cce" in spec:
# Assume the proper Cray CCE module (cce) is loaded:
- craylibs_path = env["CRAYLIBS_" + env["MACHTYPE"].capitalize()]
+ craylibs_path = env["CRAYLIBS_" + machine().upper()]
env.setdefault("LDFLAGS", "")
env["LDFLAGS"] += " -Wl,-rpath," + craylibs_path