lammps: fix build with kokkos (#16390)
This commit is contained in:
parent
6c24142ebd
commit
cfb307b8e7
@ -172,6 +172,8 @@ class Kokkos(CMakePackage, CudaPackage):
|
|||||||
conflicts("+cuda", when="std=17")
|
conflicts("+cuda", when="std=17")
|
||||||
conflicts("+cuda", when="std=20")
|
conflicts("+cuda", when="std=20")
|
||||||
|
|
||||||
|
variant('shared', default=True, description='Build shared libraries')
|
||||||
|
|
||||||
def append_args(self, cmake_prefix, cmake_options, spack_options):
|
def append_args(self, cmake_prefix, cmake_options, spack_options):
|
||||||
for opt in cmake_options:
|
for opt in cmake_options:
|
||||||
enablestr = "+%s" % opt
|
enablestr = "+%s" % opt
|
||||||
@ -242,4 +244,6 @@ def cmake_args(self):
|
|||||||
options.append("-DKokkos_CXX_STANDARD=%s" %
|
options.append("-DKokkos_CXX_STANDARD=%s" %
|
||||||
self.spec.variants["std"].value)
|
self.spec.variants["std"].value)
|
||||||
|
|
||||||
|
options.append('-DBUILD_SHARED_LIBS=%s' % ('+shared' in self.spec))
|
||||||
|
|
||||||
return options
|
return options
|
||||||
|
@ -55,12 +55,13 @@ def url_for_version(self, version):
|
|||||||
vdate.strftime("%d%b%Y").lstrip('0'))
|
vdate.strftime("%d%b%Y").lstrip('0'))
|
||||||
|
|
||||||
supported_packages = ['asphere', 'body', 'class2', 'colloid', 'compress',
|
supported_packages = ['asphere', 'body', 'class2', 'colloid', 'compress',
|
||||||
'coreshell', 'dipole', 'granular', 'kspace', 'latte',
|
'coreshell', 'dipole', 'granular', 'kspace',
|
||||||
'manybody', 'mc', 'meam', 'misc', 'molecule',
|
'kokkos', 'latte', 'manybody', 'mc', 'meam', 'misc',
|
||||||
'mpiio', 'peri', 'poems', 'python', 'qeq',
|
'molecule', 'mpiio', 'peri', 'poems', 'python',
|
||||||
'replica', 'rigid', 'shock', 'snap', 'spin', 'srd',
|
'qeq', 'replica', 'rigid', 'shock', 'snap', 'spin',
|
||||||
'user-atc', 'user-h5md', 'user-lb', 'user-misc',
|
'srd', 'user-atc', 'user-h5md', 'user-lb',
|
||||||
'user-netcdf', 'user-omp', 'user-reaxc', 'voronoi']
|
'user-misc', 'user-netcdf', 'user-omp', 'user-reaxc',
|
||||||
|
'voronoi']
|
||||||
|
|
||||||
for pkg in supported_packages:
|
for pkg in supported_packages:
|
||||||
variant(pkg, default=False,
|
variant(pkg, default=False,
|
||||||
@ -69,8 +70,6 @@ def url_for_version(self, version):
|
|||||||
description='Build the liblammps in addition to the executable')
|
description='Build the liblammps in addition to the executable')
|
||||||
variant('mpi', default=True,
|
variant('mpi', default=True,
|
||||||
description='Build with mpi')
|
description='Build with mpi')
|
||||||
variant('kokkos', default=False,
|
|
||||||
description='Build with Kokkos accelerated styles')
|
|
||||||
variant('jpeg', default=True,
|
variant('jpeg', default=True,
|
||||||
description='Build with jpeg support')
|
description='Build with jpeg support')
|
||||||
variant('png', default=True,
|
variant('png', default=True,
|
||||||
@ -106,7 +105,7 @@ def url_for_version(self, version):
|
|||||||
depends_on('jpeg', when='+jpeg')
|
depends_on('jpeg', when='+jpeg')
|
||||||
depends_on('libpng', when='+png')
|
depends_on('libpng', when='+png')
|
||||||
depends_on('ffmpeg', when='+ffmpeg')
|
depends_on('ffmpeg', when='+ffmpeg')
|
||||||
depends_on('kokkos-legacy', when='+kokkos')
|
depends_on('kokkos+deprecated_code+shared@3.0', when='@20200303+kokkos')
|
||||||
|
|
||||||
conflicts('+cuda', when='+opencl')
|
conflicts('+cuda', when='+opencl')
|
||||||
conflicts('+body', when='+poems@:20180628')
|
conflicts('+body', when='+poems@:20180628')
|
||||||
@ -117,7 +116,8 @@ def url_for_version(self, version):
|
|||||||
conflicts('+user-misc', when='~manybody')
|
conflicts('+user-misc', when='~manybody')
|
||||||
conflicts('+user-phonon', when='~kspace')
|
conflicts('+user-phonon', when='~kspace')
|
||||||
conflicts('+user-misc', when='~manybody')
|
conflicts('+user-misc', when='~manybody')
|
||||||
conflicts('%gcc@9:', when='+openmp')
|
conflicts('%gcc@9:', when='@:20200303+openmp')
|
||||||
|
conflicts('+kokkos', when='@:20200227')
|
||||||
|
|
||||||
patch("lib.patch", when="@20170901")
|
patch("lib.patch", when="@20170901")
|
||||||
patch("660.patch", when="@20170922")
|
patch("660.patch", when="@20170922")
|
||||||
@ -176,5 +176,7 @@ def cmake_args(self):
|
|||||||
args.append('{0}=OFF'.format(opt))
|
args.append('{0}=OFF'.format(opt))
|
||||||
if '+kspace' in spec:
|
if '+kspace' in spec:
|
||||||
args.append('-DFFT=FFTW3')
|
args.append('-DFFT=FFTW3')
|
||||||
|
if '+kokkos' in spec:
|
||||||
|
args.append('-DEXTERNAL_KOKKOS=ON')
|
||||||
|
|
||||||
return args
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user