libbeagle package: add cuda support (#10650)
libbeagle compiles against CUDA by default but no there is no mention of it in the package recipe. This PR adds explicit cuda paths and variants, and fixes the target architecture as well (for those who don't have compute_13)
This commit is contained in:
parent
0adf1b5405
commit
df4b77f120
@ -6,7 +6,7 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Libbeagle(AutotoolsPackage):
|
class Libbeagle(AutotoolsPackage, CudaPackage):
|
||||||
"""Beagle performs genotype calling, genotype phasing, imputation of
|
"""Beagle performs genotype calling, genotype phasing, imputation of
|
||||||
ungenotyped markers, and identity-by-descent segment detection."""
|
ungenotyped markers, and identity-by-descent segment detection."""
|
||||||
|
|
||||||
@ -24,6 +24,33 @@ class Libbeagle(AutotoolsPackage):
|
|||||||
depends_on('pkgconfig', type='build')
|
depends_on('pkgconfig', type='build')
|
||||||
depends_on('java', type='build')
|
depends_on('java', type='build')
|
||||||
|
|
||||||
|
def patch(self):
|
||||||
|
# update cuda architecture if necessary
|
||||||
|
if '+cuda' in self.spec:
|
||||||
|
arch = self.spec.variants['cuda_arch'].value
|
||||||
|
archflag = ''
|
||||||
|
|
||||||
|
if arch[0] != 'none':
|
||||||
|
archflag = '-arch=%s' % arch[0]
|
||||||
|
|
||||||
|
filter_file('-arch compute_13', archflag,
|
||||||
|
'libhmsbeagle/GPU/kernels/Makefile.am',
|
||||||
|
string=True)
|
||||||
|
|
||||||
|
# point CUDA_LIBS to libcuda.so
|
||||||
|
filter_file('-L$with_cuda/lib', '-L$with_cuda/lib64/stubs',
|
||||||
|
'configure.ac', string=True)
|
||||||
|
|
||||||
|
def configure_args(self):
|
||||||
|
args = []
|
||||||
|
|
||||||
|
if '+cuda' in self.spec:
|
||||||
|
args.append('--with-cuda=%s' % spec['cuda'].prefix)
|
||||||
|
else:
|
||||||
|
args.append('--without-cuda')
|
||||||
|
|
||||||
|
return args
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
url = "https://github.com/beagle-dev/beagle-lib/archive/beagle_release_{0}.tar.gz"
|
url = "https://github.com/beagle-dev/beagle-lib/archive/beagle_release_{0}.tar.gz"
|
||||||
return url.format(version.underscored)
|
return url.format(version.underscored)
|
||||||
|
Loading…
Reference in New Issue
Block a user