Skip to content

Commit 44562f9

Browse files
authored
Merge pull request #1508 from LLNL/task/white238/pull_in_spack_changes
Changes from Spack repo
2 parents ac26fe5 + 1910475 commit 44562f9

File tree

9 files changed

+97
-64
lines changed

9 files changed

+97
-64
lines changed

.uberenv_config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"package_final_phase": "initconfig",
55
"package_source_dir": "../..",
66
"spack_url": "https://github.com/spack/spack.git",
7-
"spack_commit": "cade66d842a894075938bc5528475d9fcd8bd559",
7+
"spack_commit": "82358642aa54ce7fb37e6b19dc20e6740c62bff7",
88
"spack_configs_path": "scripts/spack/configs",
99
"spack_packages_path": ["scripts/spack/radiuss-spack-configs/packages", "scripts/spack/packages"],
1010
"spack_concretizer": "clingo",

scripts/spack/configs/blueos_3_ppc64le_ib_p9/spack.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ spack:
217217
externals:
218218
219219
prefix: /usr
220+
git:
221+
buildable: false
222+
externals:
223+
224+
prefix: /usr/tce/packages/git/git-2.45.0
220225
gmake:
221226
buildable: false
222227
externals:
@@ -345,14 +350,16 @@ spack:
345350
version: [2.24.0]
346351
mfem:
347352
require: "@4.6.0"
353+
opencascade:
354+
require: "@7.8.1+data_exchange~draw"
355+
py-jsonschema:
356+
require: "@:4.17" #Anything after this requires py-rpds which requires rust and adds 40 minutes
348357
raja:
349358
require: "@2024.07.0~shared~examples~exercises"
350359
scr:
351360
require: "@3.0.1~shared~tests~examples"
352361
umpire:
353362
require: "@2024.07.0~shared~examples~werror"
354-
opencascade:
355-
require: "@7.8.1+data_exchange~draw"
356363

357364
# Globally lock in versions of Devtools
358365
cmake:

scripts/spack/configs/toss_4_x86_64_ib/spack.yaml

+16-2
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ spack:
205205
externals:
206206
207207
prefix: /usr
208+
git:
209+
buildable: false
210+
externals:
211+
212+
prefix: /collab/usr/global/tools/tce4/opt/git-2.45.0
208213
gmake:
209214
buildable: false
210215
externals:
@@ -276,6 +281,11 @@ spack:
276281
externals:
277282
278283
prefix: /usr
284+
slurm:
285+
buildable: false
286+
externals:
287+
288+
prefix: /usr
279289
swig:
280290
buildable: false
281291
externals:
@@ -312,14 +322,18 @@ spack:
312322
version: [2.24.0]
313323
mfem:
314324
require: "@4.6.0"
325+
opencascade:
326+
require: "@7.8.1+data_exchange~draw"
327+
py-jsonschema:
328+
require: "@:4.17" #Anything after this requires py-rpds which requires rust and adds 40 minutes
315329
raja:
316330
require: "@2024.07.0~shared~examples~exercises"
317331
scr:
318332
require: "@3.0.1~shared~tests~examples"
319333
umpire:
320334
require: "@2024.07.0~shared~examples~werror"
321-
opencascade:
322-
require: "@7.8.1+data_exchange~draw"
335+
libyogrt:
336+
require: "scheduler=slurm"
323337

324338
# Lock in versions of Devtools
325339
cmake:

scripts/spack/configs/toss_4_x86_64_ib_cray/spack.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,11 @@ spack:
354354
externals:
355355
356356
prefix: /usr
357+
git:
358+
buildable: false
359+
externals:
360+
361+
prefix: /collab/usr/global/tools/tce4/opt/git-2.45.0
357362
gmake:
358363
buildable: false
359364
externals:
@@ -486,6 +491,8 @@ spack:
486491
version: [2.24.0]
487492
mfem:
488493
require: "@4.6.0"
494+
py-jsonschema:
495+
require: "@:4.17" #Anything after this requires py-rpds which requires rust and adds 40 minutes
489496
raja:
490497
require: "@2024.07.0~shared~examples~exercises"
491498
scr:

scripts/spack/packages/axom/package.py

+57-52
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
2-
# Spack Project Developers. See the top-level COPYRIGHT file for details.
1+
# Copyright Spack Project Developers. See COPYRIGHT file for details.
32
#
43
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
54

6-
import glob
75
import os
86
import shutil
97
import socket
@@ -41,10 +39,14 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
4139
git = "https://github.com/LLNL/axom.git"
4240
tags = ["radiuss"]
4341

42+
test_requires_compiler = True
43+
4444
license("BSD-3-Clause")
4545

4646
version("main", branch="main")
4747
version("develop", branch="develop")
48+
version("0.10.1", tag="v0.10.1", commit="6626ee1c5668176fb64dd9a52dec3e8596b3ba6b")
49+
version("0.10.0", tag="v0.10.0", commit="ea853a34a834415ea75f824160fc44cba9a0755d")
4850
version("0.9.0", tag="v0.9.0", commit="5f531595d941d16fa3b8583bfc347a845d9feb6d")
4951
version("0.8.1", tag="v0.8.1", commit="0da8a5b1be596887158ac2fcd321524ba5259e15")
5052
version("0.8.0", tag="v0.8.0", commit="71fab3262eb7e1aa44a04c21d072b77f06362f7b")
@@ -59,6 +61,10 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage):
5961
version("0.3.0", tag="v0.3.0", commit="20068ccab4b4f70055918b4f17960ec3ed6dbce8")
6062
version("0.2.9", tag="v0.2.9", commit="9e9a54ede3326817c05f35922738516e43b5ec3d")
6163

64+
depends_on("c", type="build")
65+
depends_on("cxx", type="build")
66+
depends_on("fortran", type="build", when="+fortran")
67+
6268
# https://github.com/spack/spack/issues/31829
6369
patch("examples-oneapi.patch", when="@0.6.1 +examples %oneapi")
6470

@@ -250,11 +256,11 @@ def cache_name(self):
250256
# Are we on a LLNL system then strip node number
251257
hostname = hostname.rstrip("1234567890")
252258
special_case = ""
253-
if "+cuda" in self.spec:
259+
if self.spec.satisfies("+cuda"):
254260
special_case += "_cuda"
255-
if "~fortran" in self.spec:
261+
if self.spec.satisfies("~fortran"):
256262
special_case += "_nofortran"
257-
if "+rocm" in self.spec:
263+
if self.spec.satisfies("+rocm"):
258264
special_case += "_hip"
259265
return "{0}-{1}-{2}@{3}{4}.cmake".format(
260266
hostname,
@@ -268,7 +274,7 @@ def initconfig_compiler_entries(self):
268274
spec = self.spec
269275
entries = super().initconfig_compiler_entries()
270276

271-
if "+fortran" in spec:
277+
if spec.satisfies("+fortran"):
272278
entries.append(cmake_cache_option("ENABLE_FORTRAN", True))
273279
if self.is_fortran_compiler("gfortran") and "clang" in self.compiler.cxx:
274280
libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.cxx)), "lib")
@@ -285,7 +291,7 @@ def initconfig_compiler_entries(self):
285291
else:
286292
entries.append(cmake_cache_option("ENABLE_FORTRAN", False))
287293

288-
if "+cpp14" in spec and spec.satisfies("@:0.6.1"):
294+
if spec.satisfies("+cpp14") and spec.satisfies("@:0.6.1"):
289295
entries.append(cmake_cache_string("BLT_CXX_STD", "c++14", ""))
290296

291297
# Add optimization flag workaround for builds with cray compiler
@@ -298,7 +304,7 @@ def initconfig_hardware_entries(self):
298304
spec = self.spec
299305
entries = super().initconfig_hardware_entries()
300306

301-
if "+cuda" in spec:
307+
if spec.satisfies("+cuda"):
302308
entries.append(cmake_cache_option("ENABLE_CUDA", True))
303309
entries.append(cmake_cache_option("CMAKE_CUDA_SEPARABLE_COMPILATION", True))
304310

@@ -311,7 +317,7 @@ def initconfig_hardware_entries(self):
311317

312318
if spec.satisfies("^blt@:0.5.1"):
313319
# This is handled internally by BLT now
314-
if "+cpp14" in spec:
320+
if spec.satisfies("+cpp14"):
315321
cudaflags += " -std=c++14"
316322
else:
317323
cudaflags += " -std=c++11"
@@ -320,7 +326,7 @@ def initconfig_hardware_entries(self):
320326
entries.append("# nvcc does not like gtest's 'pthreads' flag\n")
321327
entries.append(cmake_cache_option("gtest_disable_pthreads", True))
322328

323-
if "+rocm" in spec:
329+
if spec.satisfies("+rocm"):
324330
entries.append("#------------------{0}\n".format("-" * 60))
325331
entries.append("# Axom ROCm specifics\n")
326332
entries.append("#------------------{0}\n\n".format("-" * 60))
@@ -335,22 +341,26 @@ def initconfig_hardware_entries(self):
335341
# Recommended MPI flags
336342
hip_link_flags += "-lxpmem "
337343
hip_link_flags += "-L/opt/cray/pe/mpich/{0}/gtl/lib ".format(spec["mpi"].version)
338-
hip_link_flags += "-Wl,-rpath,/opt/cray/pe/mpich/{0}/gtl/lib ".format(spec["mpi"].version)
344+
hip_link_flags += "-Wl,-rpath,/opt/cray/pe/mpich/{0}/gtl/lib ".format(
345+
spec["mpi"].version
346+
)
339347
hip_link_flags += "-lmpi_gtl_hsa "
340348

341349
# Fixes for mpi for rocm until wrapper paths are fixed
342350
# These flags are already part of the wrapped compilers on TOSS4 systems
343-
if "+fortran" in spec and self.is_fortran_compiler("amdflang"):
351+
if spec.satisfies("+fortran") and self.is_fortran_compiler("amdflang"):
344352
hip_link_flags += "-Wl,--disable-new-dtags "
345353

346354
if spec.satisfies("^[email protected]:"):
347-
hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format(rocm_root)
355+
hip_link_flags += "-L{0}/lib/llvm/lib -Wl,-rpath,{0}/lib/llvm/lib ".format(
356+
rocm_root
357+
)
348358
else:
349359
hip_link_flags += "-L{0}/llvm/lib -Wl,-rpath,{0}/llvm/lib ".format(rocm_root)
350360
hip_link_flags += "-lpgmath -lflang -lflangrti -lompstub "
351361

352362
# Remove extra link library for crayftn
353-
if "+fortran" in spec and self.is_fortran_compiler("crayftn"):
363+
if spec.satisfies("+fortran") and self.is_fortran_compiler("crayftn"):
354364
entries.append(
355365
cmake_cache_string("BLT_CMAKE_IMPLICIT_LINK_LIBRARIES_EXCLUDE", "unwind")
356366
)
@@ -374,7 +384,7 @@ def initconfig_hardware_entries(self):
374384
)
375385
)
376386

377-
if "+fortran" in spec and self.is_fortran_compiler("xlf"):
387+
if spec.satisfies("+fortran") and self.is_fortran_compiler("xlf"):
378388
# Grab lib directory for the current fortran compiler
379389
libdir = pjoin(os.path.dirname(os.path.dirname(self.compiler.fc)), "lib")
380390
description = (
@@ -385,7 +395,7 @@ def initconfig_hardware_entries(self):
385395

386396
entries.append(cmake_cache_string("BLT_EXE_LINKER_FLAGS", linker_flags, description))
387397

388-
if "+shared" in spec:
398+
if spec.satisfies("+shared"):
389399
linker_flags = "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath," + libdir
390400
entries.append(
391401
cmake_cache_string("CMAKE_SHARED_LINKER_FLAGS", linker_flags, description)
@@ -399,9 +409,9 @@ def initconfig_hardware_entries(self):
399409
)
400410

401411
if (
402-
"+openmp" in spec
412+
spec.satisfies("+openmp")
403413
and "clang" in self.compiler.cxx
404-
and "+fortran" in spec
414+
and spec.satisfies("+fortran")
405415
and self.is_fortran_compiler("xlf")
406416
):
407417
openmp_gen_exp = (
@@ -440,7 +450,7 @@ def initconfig_mpi_entries(self):
440450
spec = self.spec
441451
entries = super().initconfig_mpi_entries()
442452

443-
if "+mpi" in spec:
453+
if spec.satisfies("+mpi"):
444454
entries.append(cmake_cache_option("ENABLE_MPI", True))
445455
if spec["mpi"].name == "spectrum-mpi":
446456
entries.append(cmake_cache_string("BLT_MPI_COMMAND_APPEND", "mpibind"))
@@ -491,25 +501,25 @@ def initconfig_package_entries(self):
491501

492502
# optional tpls
493503
for dep in ("c2c", "mfem", "hdf5", "lua", "raja", "umpire", "opencascade"):
494-
if "+%s" % dep in spec:
504+
if spec.satisfies("+%s" % dep):
495505
dep_dir = get_spec_path(spec, dep, path_replacements)
496506
entries.append(cmake_cache_path("%s_DIR" % dep.upper(), dep_dir))
497507
else:
498508
entries.append("# %s not built\n" % dep.upper())
499509

500-
if "+profiling" in spec:
510+
if spec.satisfies("+profiling"):
501511
dep_dir = get_spec_path(spec, "adiak", path_replacements)
502512
entries.append(cmake_cache_path("ADIAK_DIR", dep_dir))
503513

504514
dep_dir = get_spec_path(spec, "caliper", path_replacements)
505515
entries.append(cmake_cache_path("CALIPER_DIR", dep_dir))
506516

507-
if "+umpire" in spec and spec.satisfies("^camp"):
517+
if spec.satisfies("+umpire") and spec.satisfies("^camp"):
508518
dep_dir = get_spec_path(spec, "camp", path_replacements)
509519
entries.append(cmake_cache_path("CAMP_DIR", dep_dir))
510520

511521
# SCR does not export it's targets so we need to pull in its dependencies
512-
if "+scr" in spec:
522+
if spec.satisfies("+scr"):
513523
dep_dir = get_spec_path(spec, "scr", path_replacements)
514524
entries.append(cmake_cache_path("SCR_DIR", dep_dir))
515525

@@ -542,20 +552,20 @@ def initconfig_package_entries(self):
542552
entries.append("#------------------{0}\n".format("-" * 60))
543553

544554
# Add common prefix to path replacement list
545-
if "+devtools" in spec:
555+
if spec.satisfies("+devtools"):
546556
# Grab common devtools root and strip the trailing slash
547557
path1 = os.path.realpath(spec["cppcheck"].prefix)
548558
path2 = os.path.realpath(spec["doxygen"].prefix)
549559
self.find_path_replacement(path1, path2, path_replacements, "DEVTOOLS_ROOT", entries)
550560

551-
if "+devtools" in spec and spec.satisfies("^llvm"):
561+
if spec.satisfies("+devtools") and spec.satisfies("^llvm"):
552562
clang_fmt_path = spec["llvm"].prefix.bin.join("clang-format")
553563
entries.append(cmake_cache_path("CLANGFORMAT_EXECUTABLE", clang_fmt_path))
554564
else:
555565
entries.append("# ClangFormat disabled due to llvm and devtools not in spec\n")
556566
entries.append(cmake_cache_option("ENABLE_CLANGFORMAT", False))
557567

558-
if "+python" in spec or "+devtools" in spec:
568+
if spec.satisfies("+python") or spec.satisfies("+devtools"):
559569
python_path = os.path.realpath(spec["python"].command.path)
560570
for key in path_replacements:
561571
python_path = python_path.replace(key, path_replacements[key])
@@ -601,7 +611,7 @@ def cmake_args(self):
601611
options.append(self.define_from_variant("BUILD_SHARED_LIBS", "shared"))
602612
options.append(self.define_from_variant("AXOM_ENABLE_EXAMPLES", "examples"))
603613
options.append(self.define_from_variant("AXOM_ENABLE_TOOLS", "tools"))
604-
if "+raja" not in self.spec or "+umpire" not in self.spec:
614+
if self.spec.satisfies("~raja") or self.spec.satisfies("+umpire"):
605615
options.append("-DAXOM_ENABLE_MIR:BOOL=OFF")
606616

607617
return options
@@ -623,34 +633,29 @@ def build_test(self):
623633

624634
@run_after("install")
625635
@on_package_attributes(run_tests=True)
626-
def check_install(self):
627-
"""
628-
Checks the spack install of axom using axom's
629-
using-with-cmake example
630-
"""
631-
632-
print("Checking Axom installation...")
633-
spec = self.spec
634-
install_prefix = spec.prefix
635-
example_src_dir = join_path(install_prefix, "examples", "axom", "using-with-cmake")
636-
example_build_dir = join_path(example_src_dir, "build")
637-
print("Checking using-with-cmake example...")
638-
with working_dir(example_build_dir, create=True):
636+
def test_install_using_cmake(self):
637+
"""build example with cmake and run"""
638+
example_src_dir = join_path(self.prefix.examples.axom, "using-with-cmake")
639+
example_stage_dir = "./cmake"
640+
shutil.copytree(example_src_dir, example_stage_dir)
641+
with working_dir(join_path(example_stage_dir, "build"), create=True):
639642
cmake_args = ["-C ../host-config.cmake", example_src_dir]
643+
cmake = self.spec["cmake"].command
640644
cmake(*cmake_args)
641645
make()
642646
example = Executable("./example")
643647
example()
644-
print("Checking using-with-make example...")
645-
example_src_dir = join_path(install_prefix, "examples", "axom", "using-with-make")
646-
example_build_dir = join_path(example_src_dir, "build")
647-
example_files = glob.glob(join_path(example_src_dir, "*"))
648-
with working_dir(example_build_dir, create=True):
649-
for example_file in example_files:
650-
shutil.copy(example_file, ".")
651-
make("AXOM_DIR={0}".format(install_prefix))
648+
make("clean")
649+
650+
@run_after("install")
651+
@on_package_attributes(run_tests=True)
652+
def test_install_using_make(self):
653+
"""build example with make and run"""
654+
example_src_dir = join_path(self.prefix.examples.axom, "using-with-make")
655+
example_stage_dir = "./make"
656+
shutil.copytree(example_src_dir, example_stage_dir)
657+
with working_dir(example_stage_dir, create=True):
658+
make(f"AXOM_DIR={self.prefix}")
652659
example = Executable("./example")
653660
example()
654-
655-
def test_install(self):
656-
self.check_install()
661+
make("clean")

scripts/spack/packages/axomdevtools/package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
55

6-
from spack import *
6+
from spack.package import *
77

88
class Axomdevtools(BundlePackage):
99
"""This is a set of tools necessary for the developers of Axom"""

0 commit comments

Comments
 (0)