diff options
author | Danny Taller <66029857+dtaller@users.noreply.github.com> | 2020-10-09 15:25:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-09 15:25:06 -0700 |
commit | 012b4279b6285235a24a7b7b2fe37854a6d5957d (patch) | |
tree | b82c6f78bbd1451324af068a5957875c8a5754da | |
parent | 9a46ee00850e9d4a332b1549ab2926707ff0ccfb (diff) | |
download | spack-012b4279b6285235a24a7b7b2fe37854a6d5957d.tar.gz spack-012b4279b6285235a24a7b7b2fe37854a6d5957d.tar.bz2 spack-012b4279b6285235a24a7b7b2fe37854a6d5957d.tar.xz spack-012b4279b6285235a24a7b7b2fe37854a6d5957d.zip |
camp: new package (#19235)
-rw-r--r-- | var/spack/repos/builtin/packages/camp/package.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/camp/package.py b/var/spack/repos/builtin/packages/camp/package.py new file mode 100644 index 0000000000..e2b33a172d --- /dev/null +++ b/var/spack/repos/builtin/packages/camp/package.py @@ -0,0 +1,44 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Camp(CMakePackage, CudaPackage): + """ + Compiler agnostic metaprogramming library providing concepts, + type operations and tuples for C++ and cuda + """ + + homepage = "https://github.com/LLNL/camp" + git = "https://github.com/LLNL/camp.git" + + version('master', branch='master', submodules='True') + version('0.1.0', url='https://github.com/LLNL/camp/archive/v0.1.0.tar.gz') + + depends_on('cmake@3.8:', type='build') + depends_on('cmake@3.9:', type='build', when="+cuda") + + def cmake_args(self): + spec = self.spec + + options = [] + + if '+cuda' in spec: + options.extend([ + '-DENABLE_CUDA=ON', + '-DCUDA_TOOLKIT_ROOT_DIR=%s' % (spec['cuda'].prefix)]) + + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + options.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0])) + flag = '-arch sm_{0}'.format(cuda_arch[0]) + options.append('-DCMAKE_CUDA_FLAGS:STRING={0}'.format(flag)) + else: + options.append('-DENABLE_CUDA=OFF') + + options.append('-DENABLE_TESTS=ON') + + return options |