Skip to content

Commit 4f80519

Browse files
authored
Add bin/compiler to PATH for intel-oneapi-compilers (#1922)
In spack-ext/lib/jcsda-emc/spack-stack/stack/meta_modules.py: for intel-oneapi-compilers, attempt to add subdirectory compiler of bin to PATH, and test in CI. This will have no effect on Cray systems using the Cray compiler wrappers, but that's fine. Cray systems have their own, Cray-generated compiler modules anyway.
1 parent 3236931 commit 4f80519

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,8 @@ jobs:
239239
module load ewok-env
240240
module load soca-env
241241
module list
242+
243+
# https://github.com/JCSDA/spack-stack/issues/1903
244+
module show stack-intel-oneapi-compilers/2024.2.0
245+
which llvm-ar
246+
llvm-ar --version

.github/workflows/ubuntu-ci-x86_64-oneapi.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,8 @@ jobs:
239239
module load ewok-env
240240
module load soca-env
241241
module list
242+
243+
# https://github.com/JCSDA/spack-stack/issues/1903
244+
module show stack-intel-oneapi-compilers/2024.2.0
245+
which llvm-ar
246+
llvm-ar --version

spack-ext/lib/jcsda-emc/spack-stack/stack/meta_modules.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def custom_sort_key(entry):
399399
logging.debug(" ... ... CC : {}".format(substitutes["CC"]))
400400
logging.debug(" ... ... CXX : {}".format(substitutes["CXX"]))
401401
logging.debug(" ... ... F77 : {}".format(substitutes["F77"]))
402-
logging.debug(" ... ... FC' : {}".format(substitutes["FC"]))
402+
logging.debug(" ... ... FC : {}".format(substitutes["FC"]))
403403

404404
# Compiler flags; names are lowercase in spack
405405
if "flags" in compiler.extra_attributes.keys():
@@ -422,6 +422,17 @@ def custom_sort_key(entry):
422422
env_name,
423423
env_values
424424
)
425+
# https://github.com/JCSDA/spack-stack/issues/1903
426+
# Attempt to locate directory "compiler" in the same directory where
427+
# "icx" resides. If found, add it to PATH in the compiler module
428+
if compiler.name=="intel-oneapi-compilers":
429+
path_to_icx = os.path.dirname(substitutes["CC"])
430+
if os.path.isdir(os.path.join(path_to_icx, "compiler")):
431+
substitutes["ENVVARS"] += prepend_path_command(
432+
module_choice,
433+
"PATH",
434+
os.path.join(path_to_icx, "compiler"),
435+
)
425436
substitutes["ENVVARS"] = substitutes["ENVVARS"].rstrip("\n")
426437
logging.debug(" ... ... ENVVARS : {}".format(substitutes["ENVVARS"]))
427438

0 commit comments

Comments
 (0)