summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-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)