Skip to content

Commit 33cb8c9

Browse files
authored
Fix an issue with using the environment variable MACHTYPE which is not always defined (#40733)
* Fix an issue reported here: #36154 (comment) * [@spackbot] updating style on behalf of v-dobrev
1 parent 6511d3d commit 33cb8c9

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

var/spack/repos/builtin/packages/butterflypack/package.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
55

6+
from platform import machine
7+
68
from spack.package import *
79

810

@@ -74,7 +76,7 @@ def cmake_args(self):
7476
args.append("-Denable_openmp=%s" % ("ON" if "+openmp" in spec else "OFF"))
7577
if "%cce" in spec:
7678
# Assume the proper Cray CCE module (cce) is loaded:
77-
craylibs_path = env["CRAYLIBS_" + env["MACHTYPE"].capitalize()]
79+
craylibs_path = env["CRAYLIBS_" + machine().upper()]
7880
env.setdefault("LDFLAGS", "")
7981
env["LDFLAGS"] += " -Wl,-rpath," + craylibs_path
8082

var/spack/repos/builtin/packages/strumpack/package.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
55

6+
from platform import machine
7+
68
from spack.package import *
79
from spack.util.environment import set_env
810

@@ -173,7 +175,7 @@ def cmake_args(self):
173175

174176
if "%cce" in spec:
175177
# Assume the proper Cray CCE module (cce) is loaded:
176-
craylibs_path = env["CRAYLIBS_" + env["MACHTYPE"].capitalize()]
178+
craylibs_path = env["CRAYLIBS_" + machine().upper()]
177179
env.setdefault("LDFLAGS", "")
178180
env["LDFLAGS"] += " -Wl,-rpath," + craylibs_path
179181

0 commit comments

Comments
 (0)