From 2576d8d7677edc5c3473fb5af903591884bf7780 Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Thu, 17 Sep 2020 10:04:21 -0500 Subject: [PATCH] Update libbeagle (#18703) This PR fixes a couple of things with the libbeagle package. - libbeagle can only be built for one GPU type. Add a test for that. - version 2 had the arch statement in libhmsbeagle/GPU/kernels/Makefile.am but version 3 has it in configure.ac. Put the variant specified value in configure.ac for consistency. --- .../repos/builtin/packages/libbeagle/package.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/libbeagle/package.py b/var/spack/repos/builtin/packages/libbeagle/package.py index 968dcc00e4c..a3ad61d3634 100644 --- a/var/spack/repos/builtin/packages/libbeagle/package.py +++ b/var/spack/repos/builtin/packages/libbeagle/package.py @@ -29,16 +29,24 @@ class Libbeagle(AutotoolsPackage, CudaPackage): def patch(self): # update cuda architecture if necessary if '+cuda' in self.spec: - arch = self.spec.variants['cuda_arch'].value + cuda_arch = self.spec.variants['cuda_arch'].value archflag = '' - if arch[0] != 'none': - archflag = '-arch=%s' % arch[0] + if cuda_arch != 'none': + if len(cuda_arch) > 1: + raise InstallError( + 'libbeagle only supports compilation for a single GPU' + 'type.' + ) + archflag = '-arch compute_{0}'.format(cuda_arch[0]) - filter_file('-arch compute_13', archflag, + filter_file('-arch compute_13', '', 'libhmsbeagle/GPU/kernels/Makefile.am', string=True) + filter_file(r'(NVCCFLAGS="-O3).*(")', + r'\1 {0}\2'.format(archflag), 'configure.ac') + # point CUDA_LIBS to libcuda.so filter_file('-L$with_cuda/lib', '-L$with_cuda/lib64/stubs', 'configure.ac', string=True)