Skip to content

Commit

Permalink
sync package.py with upstream spack (#904)
Browse files Browse the repository at this point in the history
* sync package.py with upstream spack

* remove unused files

* update github actions to v4

* fix build flags

---------

Co-authored-by: Anton Kozhevnikov <toxa81@gmail.com>
  • Loading branch information
simonpintarelli and toxa81 authored Oct 19, 2023
1 parent ea581c1 commit 307c890
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 164 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
env:
DEVSPEC: sirius@develop %gcc +python +memory_pool +tests +apps +vdwxc +scalapack +fortran build_type=RelWithDebInfo ^openblas ^mpich
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Configure SIRIUS
run: |
spack spec -I $DEVSPEC
cd ${GITHUB_WORKSPACE}
mkdir build
cd build
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DCREATE_FORTRAN_BINDINGS=1 -DCREATE_PYTHON_MODULE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/sirius_install
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DSIRIUS_CREATE_FORTRAN_BINDINGS=1 -DSIRIUS_CREATE_PYTHON_MODULE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/sirius_install
- name: Build SIRIUS
run: |
cd ${GITHUB_WORKSPACE}/build
Expand Down Expand Up @@ -51,14 +51,14 @@ jobs:
env:
DEVSPEC: sirius@develop %gcc +python +cuda +tests +apps +vdwxc +scalapack +fortran build_type=RelWithDebInfo ^openblas ^mpich
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Configure SIRIUS
run: |
spack spec -I $DEVSPEC
cd ${GITHUB_WORKSPACE}
mkdir build
cd build
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_CUDA=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DCREATE_FORTRAN_BINDINGS=1 -DCREATE_PYTHON_MODULE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
spack --color always build-env $DEVSPEC -- cmake .. -DSIRIUS_USE_SCALAPACK=1 -DSIRIUS_USE_CUDA=1 -DSIRIUS_USE_VDWXC=1 -DBUILD_TESTING=1 -DSIRIUS_CREATE_FORTRAN_BINDINGS=1 -DSIRIUS_CREATE_PYTHON_MODULE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build SIRIUS
run: |
cd ${GITHUB_WORKSPACE}/build
Expand Down
53 changes: 0 additions & 53 deletions spack/packages/sirius/cmake-fix-shared-library-installation.patch

This file was deleted.

25 changes: 0 additions & 25 deletions spack/packages/sirius/link-libraries-fortran.patch

This file was deleted.

90 changes: 33 additions & 57 deletions spack/packages/sirius/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,43 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage):

version("7.4.3", sha256="015679a60a39fa750c5d1bd8fb1ce73945524bef561270d8a171ea2fd4687fec")
version("7.4.0", sha256="f9360a695a1e786d8cb9d6702c82dd95144a530c4fa7e8115791c7d1e92b020b")
version("7.3.2", sha256="a256508de6b344345c295ad8642dbb260c4753cd87cc3dd192605c33542955d7")
version("7.3.1", sha256="8bf9848b8ebf0b43797fd359adf8c84f00822de4eb677e3049f22baa72735e98")
version("7.3.0", sha256="69b5cf356adbe181be6c919032859c4e0160901ff42a885d7e7ea0f38cc772e2")
version(
"7.3.2",
sha256="a256508de6b344345c295ad8642dbb260c4753cd87cc3dd192605c33542955d7",
deprecated=True
)
version(
"7.3.1",
sha256="8bf9848b8ebf0b43797fd359adf8c84f00822de4eb677e3049f22baa72735e98",
deprecated=True
)
version(
"7.3.0",
sha256="69b5cf356adbe181be6c919032859c4e0160901ff42a885d7e7ea0f38cc772e2",
deprecated=True
)
version(
"7.2.7",
sha256="929bf7f131a4847624858b9c4295532c24b0c06f6dcef5453c0dfc33fb78eb03",
deprecated=True
"7.2.7",
sha256="929bf7f131a4847624858b9c4295532c24b0c06f6dcef5453c0dfc33fb78eb03",
deprecated=True,
)
version(
"7.2.6",
sha256="e751fd46cdc7c481ab23b0839d3f27fb00b75dc61dc22a650c92fe8e35336e3a",
deprecated=True
"7.2.6",
sha256="e751fd46cdc7c481ab23b0839d3f27fb00b75dc61dc22a650c92fe8e35336e3a",
deprecated=True,
)
version(
"7.2.5",
sha256="794e03d4da91025f77542d3d593d87a8c74e980394f658a0210a4fd91c011f22",
deprecated=True
"7.2.5",
sha256="794e03d4da91025f77542d3d593d87a8c74e980394f658a0210a4fd91c011f22",
deprecated=True,
)
version(
"7.2.4",
sha256="aeed0e83b80c3a79a9469e7f3fe10d80ad331795e38dbc3c49cb0308e2bd084d",
deprecated=True
"7.2.4",
sha256="aeed0e83b80c3a79a9469e7f3fe10d80ad331795e38dbc3c49cb0308e2bd084d",
deprecated=True,
)
version(
"7.2.3",
sha256="6c10f0e87e50fcc7cdb4d1b2d35e91dba6144de8f111e36c7d08912e5942a906",
deprecated=True
"7.2.3",
sha256="6c10f0e87e50fcc7cdb4d1b2d35e91dba6144de8f111e36c7d08912e5942a906",
deprecated=True,
)
version(
"7.2.1",
sha256="01bf6c9893ff471473e13351ca7fdc2ed6c1f4b1bb7afa151909ea7cd6fa0de7",
deprecated=True
"7.2.1",
sha256="01bf6c9893ff471473e13351ca7fdc2ed6c1f4b1bb7afa151909ea7cd6fa0de7",
deprecated=True,
)
version(
"7.2.0",
sha256="537800459db8a7553d7aa251c19f3a31f911930194b068bc5bca2dfb2c9b71db",
deprecated=True
"7.2.0",
sha256="537800459db8a7553d7aa251c19f3a31f911930194b068bc5bca2dfb2c9b71db",
deprecated=True,
)
version(
"7.0.2",
Expand Down Expand Up @@ -184,22 +172,12 @@ class Sirius(CMakePackage, CudaPackage, ROCmPackage):
depends_on("costa+shared", when="@7.3.2:")

with when("@7.5: +memory_pool"):
depends_on("umpire")
depends_on("umpire~cuda~rocm", when="~cuda~rocm")
depends_on("umpire+cuda~device_alloc", when="+cuda")
depends_on("umpire+rocm~device_alloc", when="+rocm")

patch("mpi_datatypes.patch", when="@:7.2.6")

@property
def libs(self):
libraries = []

libraries += ["libsirius"]

return find_libraries(
libraries, root=self.prefix, shared="+shared" in self.spec, recursive=True
)

def cmake_args(self):
spec = self.spec

Expand All @@ -219,12 +197,12 @@ def cmake_args(self):
self.define_from_variant(cm_label + "CREATE_PYTHON_MODULE", "python"),
self.define_from_variant(cm_label + "USE_CUDA", "cuda"),
self.define_from_variant(cm_label + "USE_ROCM", "rocm"),
self.define_from_variant(cm_label + "BUILD_TESTING", "tests"),
self.define_from_variant(cm_label + "BUILD_APPS", "apps"),
self.define_from_variant(cm_label + "BUILD_SHARED_LIBS", "shared"),
self.define_from_variant(cm_label + "USE_FP32", "single_precision"),
self.define_from_variant(cm_label + "USE_PROFILER", "profiler"),
self.define_from_variant(cm_label + "USE_WANNIER90", "wannier90"),
self.define_from_variant("BUILD_TESTING", "tests"),
]

lapack = spec["lapack"]
Expand Down Expand Up @@ -263,18 +241,16 @@ def cmake_args(self):
args.append(self.define(cm_label + "ELPA_INCLUDE_DIR", elpa_incdir))

if "+cuda" in spec:
cuda_arch = self.spec.variants["cuda_arch"].value
cuda_arch = spec.variants["cuda_arch"].value
if cuda_arch[0] != "none":
args += [self.define("CMAKE_CUDA_ARCHITECTURES", cuda_arch)]
# Make SIRIUS handle it
if "@:7.4.3" in spec:
args.append(self.define("CMAKE_CUDA_ARCH", ";".join(cuda_arch)))
else:
args.append(self.define("CMAKE_CUDA_ARCHITECTURES", ";".join(cuda_arch)))

if "+rocm" in spec:
archs = ",".join(self.spec.variants["amdgpu_target"].value)
args.extend(
[
self.define("HIP_ROOT_DIR", spec["hip"].prefix),
self.define("HIP_HCC_FLAGS", "--amdgpu-target={0}".format(archs)),
self.define("HIP_CXX_COMPILER", self.spec["hip"].hipcc),
]
)
args.extend([self.define("CMAKE_HIP_ARCHITECTURES", archs)])

return args
25 changes: 0 additions & 25 deletions spack/packages/sirius/strip-spglib-include-subfolder.patch

This file was deleted.

0 comments on commit 307c890

Please sign in to comment.