Skip to content

Commit a7746eb

Browse files
committed
nvhpc support - not connected to gcc properly
1 parent b3409ba commit a7746eb

File tree

5 files changed

+40
-45
lines changed

5 files changed

+40
-45
lines changed

stackinator/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313

1414

1515
def generate_logfile_name(name=""):
16-
idstr = f"{time.localtime()}{os.getpid}{platform.uname()}"
17-
return f"log{name}_{hashlib.md5(idstr.encode('utf-8')).hexdigest()}"
16+
#idstr = f"{time.localtime()}{os.getpid}{platform.uname()}"
17+
#return f"log{name}_{hashlib.md5(idstr.encode('utf-8')).hexdigest()}"
18+
return f"stackinator_log"
1819

1920

2021
def configure_logging(logfile):

stackinator/recipe.py

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -406,28 +406,34 @@ def generate_compiler_specs(self, raw):
406406
# "external": [ "perl", "m4", "autoconf", "automake", "libtool", "gawk", "python", "texinfo", "gawk", ],
407407
# }
408408

409-
if isinstance(raw["gcc"]["specs"], str):
410-
gcc["specs"] = raw["gcc"]["specs"] + " +bootstrap"
411-
elif isinstance(raw["gcc"]["specs"], list):
412-
gcc["specs"] = list(map(lambda x: x + " +bootstrap", raw["gcc"]["specs"]))
409+
gcc["specs"] = [raw["gcc"]["spec"] + " +bootstrap"]
413410

414411
gcc["exclude_from_cache"] = ["cuda", "nvhpc", "perl"]
415412
compilers["gcc"] = gcc
416413

417-
if raw["llvm"] is not None:
418-
llvm = {}
419-
llvm["packages"] = False
420-
llvm["specs"] = []
421-
for spec in raw["llvm"]["specs"]:
422-
if spec.startswith("nvhpc"):
423-
llvm["specs"].append(f"{spec}~mpi~blas~lapack")
424-
425-
if spec.startswith("llvm"):
426-
llvm["specs"].append(f"{spec} +clang targets=x86 ~gold ^ninja@kitware")
427-
428-
llvm["requires"] = raw["llvm"]["requires"]
429-
llvm["exclude_from_cache"] = ["cuda", "nvhpc", "perl"]
430-
compilers["llvm"] = llvm
414+
# TODO: fix up using gcc as an upstream of nvhpc
415+
if raw["nvhpc"] is not None:
416+
nvhpc = {}
417+
nvhpc["packags"] = False
418+
nvhpc["specs"] = [raw["nvhpc"]["spec"] + " ~mpi~blas~lapack"]
419+
420+
nvhpc["exclude_from_cache"] = ["cuda", "nvhpc", "perl"]
421+
compilers["nvhpc"] = nvhpc
422+
423+
# if raw["llvm"] is not None:
424+
# llvm = {}
425+
# llvm["packages"] = False
426+
# llvm["specs"] = []
427+
# for spec in raw["llvm"]["specs"]:
428+
# if spec.startswith("nvhpc"):
429+
# llvm["specs"].append(f"{spec}~mpi~blas~lapack")
430+
#
431+
# if spec.startswith("llvm"):
432+
# llvm["specs"].append(f"{spec} +clang targets=x86 ~gold ^ninja@kitware")
433+
#
434+
# llvm["requires"] = raw["llvm"]["requires"]
435+
# llvm["exclude_from_cache"] = ["cuda", "nvhpc", "perl"]
436+
# compilers["llvm"] = llvm
431437

432438
self.compilers = compilers
433439

stackinator/schema/compilers.json

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,29 @@
99
"type": "string",
1010
"pattern": "^gcc@\\d{1,2}(\\.\\d{1}(\\.\\d{1})?)?$"
1111
},
12-
"gcc_version_spec_list": {
13-
"type": "array",
14-
"items": {"$ref": "#/defs/gcc_version_spec"},
15-
"minItems": 1
16-
},
17-
"llvm_version_spec": {
18-
"type": "string",
19-
"pattern": "^llvm@\\d{1,2}(\\.\\d{1}(\\.\\d{1})?)?$"
20-
},
2112
"nvhpc_version_spec": {
2213
"type": "string",
2314
"pattern": "^nvhpc@\\d{2}(\\.\\d{1,2})?$"
24-
},
25-
"llvm_version_spec_list": {
26-
"type": "array",
27-
"items": {
28-
"anyOf": [
29-
{"$ref": "#/defs/llvm_version_spec"},
30-
{"$ref": "#/defs/nvhpc_version_spec"}
31-
]
32-
},
33-
"minItems": 1
3415
}
3516
},
3617
"properties": {
3718
"gcc": {
3819
"type": "object",
3920
"properties": {
40-
"specs": {"$ref": "#/defs/gcc_version_spec_list"}
21+
"spec": {"$ref": "#/defs/gcc_version_spec"}
4122
},
4223
"additionalProperties": false,
43-
"required": ["specs"]
24+
"required": ["spec"]
4425
},
45-
"llvm": {
26+
"nvhpc": {
4627
"oneOf": [
4728
{
4829
"type": "object",
4930
"properties": {
50-
"requires": {"$ref": "#/defs/gcc_version_spec"},
51-
"specs": {"$ref": "#/defs/llvm_version_spec_list"}
31+
"spec": {"$ref": "#/defs/nvhpc_version_spec"}
5232
},
5333
"additionalProperties": false,
54-
"required": ["requires", "specs"]
34+
"required": ["spec"]
5535
},
5636
{
5737
"type": "null"

stackinator/schema/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"type" : "object",
1717
"additionalProperties": false,
1818
"properties" : {
19+
"required": ["repo", "commit", "packages"],
1920
"repo": {
2021
"type": "string"
2122
},
@@ -29,6 +30,7 @@
2930
"packages" : {
3031
"type" : "object",
3132
"additionalProperties": false,
33+
"required": ["repo", "commit"],
3234
"properties" : {
3335
"repo": {
3436
"type": "string"

stackinator/templates/Makefile.compilers

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,11 @@ include llvm/Makefile
6161
endif
6262
{% endif %}
6363

64+
{% if compilers.nvhpc %}
65+
ifneq (,$(wildcard gcc/Makefile))
66+
include nvhpc/Makefile
67+
endif
68+
{% endif %}
69+
6470

6571
endif

0 commit comments

Comments
 (0)