Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stackinator/etc/Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ store:
touch $@

# Because Spack doesn't know how to find compilers, we help it by getting the bin folder of gcc, clang, nvc given a install prefix
compiler_bin_dirs = $$(find $(1) '(' -name gcc -o -name clang -o -name nvc ')' -path '*/bin/*' '(' -type f -o -type l ')' -exec dirname {} +)
compiler_bin_dirs = $$(find $(1) '(' -name gcc -o -name clang -o -name nvc -o -name icx ')' -path '*/bin/*' '(' -type f -o -type l ')' -exec dirname {} +)
13 changes: 13 additions & 0 deletions stackinator/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,10 @@ def generate_environment_specs(self, raw):
# Which will compile the upstream MPI with nvfortran, as well as downstream dependendencies.
if config["prefer"] is None:
compiler = config["compiler"][0]
# spack uses a different name for the intel oneapi compilers
# than the package that installs them.
if compiler == "intel-oneapi-compilers":
compiler = "oneapi"
config["prefer"] = [
f"%[when=%c] c={compiler} %[when=%cxx] cxx={compiler} %[when=%fortran] fortran={compiler}"
]
Expand Down Expand Up @@ -477,6 +481,15 @@ def generate_compiler_specs(self, raw):
llvm_amdgpu["exclude_from_cache"] = cache_exclude
compilers["llvm-amdgpu"] = llvm_amdgpu

if raw["intel-oneapi-compilers"] is not None:
oneapi = {}
oneapi_version = raw["intel-oneapi-compilers"]["version"]
oneapi["packages"] = False
oneapi["specs"] = [f"intel-oneapi-compilers@{oneapi_version}"]

oneapi["exclude_from_cache"] = cache_exclude
compilers["intel-oneapi-compilers"] = oneapi

self.compilers = compilers

# The path of the default configuration for the target system/cluster
Expand Down
16 changes: 16 additions & 0 deletions stackinator/schema/compilers.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@
}
],
"default": null
},
"intel-oneapi-compilers": {
"oneOf": [
{
"type": "object",
"properties": {
"version": {"type": "string"}
},
"additionalProperties": false,
"required": ["version"]
},
{
"type": "null"
}
],
"default": null
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion stackinator/schema/environments.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"type": "array",
"items": {
"type": "string",
"enum": ["gcc", "nvhpc", "llvm", "llvm-amdgpu"]
"enum": ["gcc", "nvhpc", "llvm", "llvm-amdgpu", "intel-oneapi-compilers"]
}
},
"specs": {
Expand Down
12 changes: 12 additions & 0 deletions stackinator/templates/Makefile.compilers
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ llvm-amdgpu/packages.yaml: gcc/generated/env
$(SPACK) compiler find --scope=user $(call compiler_bin_dirs, $$($(SPACK_HELPER) -e ./gcc find --explicit --format '{prefix}' {{ compilers.get('llvm-amdgpu').requires }}))
{% endif %}

{% if compilers.get('intel-oneapi-compilers') %}
intel-oneapi-compilers/packages.yaml: gcc/generated/env
$(SPACK) compiler find --scope=user $(call compiler_bin_dirs, $$($(SPACK_HELPER) -e ./gcc find --explicit --format '{prefix}' {{ compilers.get('intel-oneapi-compilers').requires }}))
{% endif %}

{% if compilers.nvhpc %}
nvhpc/packages.yaml: gcc/generated/env
$(SPACK) compiler find --scope=user $(call compiler_bin_dirs, $$($(SPACK_HELPER) -e ./gcc find --explicit --format '{prefix}' {{ compilers.nvhpc.requires }}))
{% endif %}



include ../Make.inc

# GNU Make isn't very smart about dependencies across included Makefiles, so we
Expand All @@ -77,6 +83,12 @@ include llvm-amdgpu/Makefile
endif
{% endif %}

{% if compilers.get('intel-oneapi-compilers') %}
ifneq (,$(wildcard gcc/Makefile))
include intel-oneapi-compilers/Makefile
endif
{% endif %}

{% if compilers.nvhpc %}
ifneq (,$(wildcard gcc/Makefile))
include nvhpc/Makefile
Expand Down
4 changes: 2 additions & 2 deletions stackinator/templates/Makefile.generate-config
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ CONFIG_DIR = $(STORE)/config
MODULE_DIR = $(BUILD_ROOT)/modules

# These will be the prefixes of the GCCs, LLVMs and NVHPCs in the respective environments.
ALL_COMPILER_PREFIXES ={% for compiler in all_compilers %} $$($(SPACK_HELPER) -e ../compilers/{{ compiler }} find --explicit --format='{prefix}' gcc llvm llvm-amdgpu nvhpc){% endfor %}
ALL_COMPILER_PREFIXES ={% for compiler in all_compilers %} $$($(SPACK_HELPER) -e ../compilers/{{ compiler }} find --explicit --format='{prefix}' gcc llvm llvm-amdgpu nvhpc intel-oneapi){% endfor %}


COMPILER_PREFIXES ={% for compiler in release_compilers %} $$($(SPACK_HELPER) -e ../compilers/{{ compiler }} find --explicit --format='{prefix}' gcc llvm llvm-amdgpu nvhpc){% endfor %}
COMPILER_PREFIXES ={% for compiler in release_compilers %} $$($(SPACK_HELPER) -e ../compilers/{{ compiler }} find --explicit --format='{prefix}' gcc llvm llvm-amdgpu nvhpc intel-oneapi){% endfor %}


all: $(CONFIG_DIR)/upstreams.yaml $(CONFIG_DIR)/packages.yaml $(CONFIG_DIR)/repos.yaml{% if modules %} $(MODULE_DIR)/upstreams.yaml $(MODULE_DIR)/compilers.yaml{% endif %}
Expand Down
13 changes: 13 additions & 0 deletions stackinator/templates/compilers.intel-oneapi-compilers.spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
spack:
include:
- packages.yaml
- config.yaml
specs:
{% for spec in config.specs %}
- {{ spec }}
{% endfor %}
view: false
concretizer:
unify: when_possible
reuse: false

Loading