-
Notifications
You must be signed in to change notification settings - Fork 49
CMake support #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
CMake support #664
Changes from 31 commits
6ebb776
c55efe0
6c6f4f7
fc3b8ee
1118207
c368d4b
951e3e4
8e67194
b73dfe1
98199b0
5047e04
93763c0
4db12bb
78872c4
fd711ab
6175e3e
ff69683
2d5dd9e
efff931
401a04f
52d838d
55499ce
2cc3684
5d13bb9
c480936
689ba66
62629c3
f930705
0ecb09d
5013a82
e09b7ab
07f9d45
c3a770d
677116f
972d54e
0f835c7
f27f6ba
a840e58
1a94df9
089ae99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,5 +9,5 @@ | |
| variables: | ||
| UENV_NAME: tmlqcd | ||
| UENV_VERSION: experimental | ||
| UENV_TAG: v0.0.6 | ||
|
|
||
| UENV_TAG: v0.0.7 | ||
| UENV_VERSION: v1 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| gcc: | ||
| version: "14.2" | ||
| version: "14.3" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,27 +2,34 @@ | |
| # | ||
| # SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
|
||
| from spack_repo.builtin.build_systems.autotools import AutotoolsPackage | ||
| from spack_repo.builtin.build_systems import cmake | ||
| from spack_repo.builtin.build_systems.cmake import CMakePackage, generator | ||
|
|
||
|
|
||
| from spack.package import * | ||
|
|
||
| class Lemonio(AutotoolsPackage): | ||
|
|
||
| class Lemonio(CMakePackage): | ||
| """LEMON: Lightweight Parallel I/O library for Lattice QCD.""" | ||
|
|
||
| homepage = "https://github.com/etmc/lemon" | ||
| git = "https://github.com/etmc/lemon.git" | ||
| git = "https://github.com/etmc/lemon.git" | ||
| license("GPL-3.0-or-later") | ||
|
|
||
| version('master', branch='master') | ||
| version("master", branch="master") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd add the release tags (https://github.com/etmc/lemon/tags) as versions and we should tag a new one.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can tag a specific commit. |
||
| variant("shared", default=False, description="Build shared library") | ||
| depends_on("libtool", type="build", when="@master build_system=cmake") | ||
| depends_on("cmake@3.28:", type="build", when="@master build_system=cmake") | ||
|
|
||
| depends_on("mpi") | ||
|
|
||
| depends_on("autoconf", type="build", when="@master build_system=autotools") | ||
| depends_on("automake", type="build", when="@master build_system=autotools") | ||
| depends_on("libtool", type="build", when="@master build_system=autotools") | ||
| generator("ninja") | ||
|
|
||
| depends_on('mpi') | ||
|
|
||
| def configure_args(self): | ||
| args = [] | ||
| args.append('CC={0}'.format(self.spec['mpi'].mpicc)) | ||
| class CMakeBuilder(cmake.CMakeBuilder): | ||
| def cmake_args(self): | ||
| spec = self.spec | ||
| args = [ | ||
| self.define_from_variant("DBUILD_SHARED_LIBS", "shared"), | ||
| ] | ||
| return args | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| # Copyright Spack Project Developers. See COPYRIGHT file for details. | ||
| # | ||
| # SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||
|
|
||
| from spack_repo.builtin.build_systems import cmake | ||
| from spack_repo.builtin.build_systems.cmake import CMakePackage, generator | ||
| from spack_repo.builtin.build_systems.rocm import ROCmPackage | ||
| from spack_repo.builtin.build_systems.cuda import CudaPackage | ||
|
|
||
| from spack.package import * | ||
|
|
||
|
|
||
| class Tmlqcd(CMakePackage, CudaPackage, ROCmPackage): | ||
| """Base class for building tmlQCD.""" | ||
|
|
||
| homepage = "https://www.itkp.uni-bonn.de/~urbach/software.html" | ||
| url = "https://github.com/etmc/tmLQCD/archive/refs/tags/rel-5-1-6.tar.gz" | ||
| git = "https://github.com/etmc/tmLQCD.git" | ||
| license("GPL-3.0-or-later") | ||
|
|
||
| maintainers("mtaillefumier") | ||
| version("master", branch="master") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here; add release tags as versions.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with you that if we were to distribute this file we would need a tag if the package is included in This file is ignored in practice as we build tmLQCD by hand. I only included it so that we have it in the main repository. |
||
|
|
||
| variant("lemon", default=False, description="Enable the lemon backend") | ||
| variant("mpi", default=True, description="Enable mpi support") | ||
| variant("DDalphaAMG", default=False, description="Enable DAlphaAMG support") | ||
| variant("openmp", default=True, description="Enable OpenMP") | ||
| variant("fftw", default=True, description="Enable FFTW interface") | ||
| variant( | ||
| "persistent_mpi", | ||
| default=True, | ||
| description="Enable persistent mpi calls for spinor and gauge fields", | ||
| when="+mpi", | ||
| ) | ||
| variant( | ||
| "nonblocking_mpi", | ||
| default=True, | ||
| description="Enable non-blocking mpi calls for spinor and gauge fields", | ||
| when="+mpi", | ||
| ) | ||
| variant("fixedvolume", default=True, description="Enable fixed volume at compile time") | ||
| variant( | ||
| "alignment", | ||
| default="auto", | ||
| values=("none", "auto", "16", "32", "64"), | ||
| description="Automatically or expliclty align arrays", | ||
| ) | ||
| variant("gauge_copy", default=True, description="Enable gauge field copy") | ||
| variant("half_spinor", default=True, description="Use a Dirac operator with half-spinor") | ||
| variant("shared", default=False, description="Enable shared library") | ||
| variant("shmem", default=False, description="Use shmem API") | ||
| variant("quda", default=True, description="Enable the QUDA library", when="+cuda") | ||
| variant("quda", default=True, description="Enable the QUDA library", when="+rocm") | ||
| variant( | ||
| "QPhiX", default=False, description="Enable the QPhiX library for Intel Xeon and Xeon Phis" | ||
| ) | ||
| variant( | ||
| "mpi_dimensions", | ||
| default="4", | ||
| values=("1", "2", "3", "4", "x", "xy", "xyz"), | ||
| description="number of dimensions the mpi processes are distributed. the default is parallelization over all four dimensions txyz", | ||
| when="+mpi", | ||
| ) | ||
|
|
||
| generator("ninja") | ||
|
|
||
| # language dependencies | ||
| depends_on("c", type="build") | ||
| depends_on("cxx", type="build") | ||
| depends_on("fortran", type="build") | ||
|
|
||
| # conflicts | ||
| conflicts("+cuda", when="cuda_arch=none") | ||
| conflicts("+rocm", when="amdgpu_target=none") | ||
|
|
||
mtaillefumier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # hard dependencies | ||
| depends_on("c-lime") | ||
| depends_on("blas") | ||
| depends_on("lapack") | ||
| depends_on("pkgconfig", type="build") | ||
|
|
||
| # dependencies | ||
| depends_on("mpi", when="+mpi") | ||
| depends_on("lemon-io", when="+lemon") | ||
|
|
||
| with when("+quda"): | ||
| depends_on( | ||
| "quda+twisted_mass+twisted_clover+clover+ndeg_twisted_clover+ndeg_twisted_mass+wilson+qdp+staggered+usqcd+multigrid" | ||
| ) | ||
|
|
||
| depends_on("quda+mpi", when="+mpi") | ||
| depends_on("quda+cuda", when="+cuda") | ||
| depends_on("quda+rocm", when="+rocm") | ||
| depends_on("quda+nvshmem", when="+shmem") | ||
mtaillefumier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| depends_on("fftw-api@3", when="+fftw") | ||
|
|
||
|
|
||
| class CMakeBuilder(cmake.CMakeBuilder): | ||
| def cmake_args(self): | ||
| spec = self.spec | ||
| args = [ | ||
| self.define_from_variant("DBUILD_SHARED_LIBS", "shared"), | ||
| self.define_from_variant("TM_USE_LEMON", "lemon"), | ||
| self.define_from_variant("TM_USE_MPI", "mpi"), | ||
| self.define_from_variant("TM_USE_QUDA", "quda"), | ||
| self.define_from_variant("TM_USE_CUDA", "cuda"), | ||
| self.define_from_variant("TM_USE_HIP", "cuda"), | ||
| self.define_from_variant("TM_USE_FFTW", "fftw"), | ||
| self.define_from_variant("TM_FIXEDVOLUME", "fixed_volume"), | ||
| self.define_from_variant("TM_USE_OMP", "openmp"), | ||
| self.define_from_variant("TM_USE_SHMEM", "shmem"), | ||
| self.define_from_variant("TM_USE_GAUGE_COPY", "gauge_copy"), | ||
| self.define_from_variant("TM_USE_HALFSPINOR", "half_spinor"), | ||
| ] | ||
| return args | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| repo: | ||
| namespace: apps | ||
| api: v2.2 |
Uh oh!
There was an error while loading. Please reload this page.