spack/var/spack/repos/builtin/packages/accfft/package.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.6 KiB
Python
Raw Normal View History

# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
2018-02-24 06:29:12 +08:00
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
2018-02-24 06:29:12 +08:00
class Accfft(CMakePackage, CudaPackage):
"""AccFFT extends existing FFT libraries for CUDA-enabled
Graphics Processing Units (GPUs) to distributed memory clusters
"""
homepage = "http://accfft.org"
git = "https://github.com/amirgholami/accfft.git"
2018-02-24 06:29:12 +08:00
license("GPL-2.0-only")
version("develop", branch="master")
2018-02-24 06:29:12 +08:00
depends_on("cxx", type="build") # generated
2018-02-24 06:29:12 +08:00
variant("pnetcdf", default=True, description="Add support for parallel NetCDF")
variant("shared", default=True, description="Enables the build of shared libraries")
# See: http://accfft.org/articles/install/#installing-dependencies
depends_on("fftw precision=float,double ~mpi+openmp")
2018-02-24 06:29:12 +08:00
depends_on("parallel-netcdf", when="+pnetcdf")
2019-11-28 00:15:22 +08:00
# fix error [-Wc++11-narrowing]
patch("fix_narrowing_error.patch")
2018-02-24 06:29:12 +08:00
parallel = False
def cmake_args(self):
spec = self.spec
args = [
self.define("FFTW_ROOT", spec["fftw"].prefix),
self.define("FFTW_USE_STATIC_LIBS", "false"),
self.define("BUILD_GPU", str(spec.satisfies("+cuda")).lower()),
self.define("BUILD_SHARED", str(spec.satisfies("+shared")).lower()),
2018-02-24 06:29:12 +08:00
]
if spec.satisfies("+cuda"):
2018-02-24 06:29:12 +08:00
cuda_arch = [x for x in spec.variants["cuda_arch"].value if x]
if cuda_arch:
args.append(f"-DCUDA_NVCC_FLAGS={' '.join(self.cuda_flags(cuda_arch))}")
2018-02-24 06:29:12 +08:00
return args