summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Stanley <molecuul@users.noreply.github.com>2019-02-26 18:50:08 -0600
committerPeter Scheibel <scheibel1@llnl.gov>2019-02-26 18:50:08 -0600
commitdf4b77f1202fa69576cfe37b9d19d656aa40707c (patch)
tree17bf87dbc30c4d7e76ed5c4f1da014cc86ce2460
parent0adf1b540581b175092c56e490ab71158e4d92dd (diff)
downloadspack-df4b77f1202fa69576cfe37b9d19d656aa40707c.tar.gz
spack-df4b77f1202fa69576cfe37b9d19d656aa40707c.tar.bz2
spack-df4b77f1202fa69576cfe37b9d19d656aa40707c.tar.xz
spack-df4b77f1202fa69576cfe37b9d19d656aa40707c.zip
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)
-rw-r--r--var/spack/repos/builtin/packages/libbeagle/package.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/libbeagle/package.py b/var/spack/repos/builtin/packages/libbeagle/package.py
index 61e2ae26fa..6e5d99a7e5 100644
--- a/var/spack/repos/builtin/packages/libbeagle/package.py
+++ b/var/spack/repos/builtin/packages/libbeagle/package.py
@@ -6,7 +6,7 @@
from spack import *
-class Libbeagle(AutotoolsPackage):
+class Libbeagle(AutotoolsPackage, CudaPackage):
"""Beagle performs genotype calling, genotype phasing, imputation of
ungenotyped markers, and identity-by-descent segment detection."""
@@ -24,6 +24,33 @@ class Libbeagle(AutotoolsPackage):
depends_on('pkgconfig', 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):
url = "https://github.com/beagle-dev/beagle-lib/archive/beagle_release_{0}.tar.gz"
return url.format(version.underscored)