From bce2accb69eea21ba88d7bf768d421b9cd0b023b Mon Sep 17 00:00:00 2001 From: eklee15 Date: Tue, 28 Feb 2017 14:26:49 -0500 Subject: xl support for suite-sparse (#3226) * xl support for suite-sparse * make_args.extend([ 'CFLAGS={0}'.format(self.compiler.pic_flag), 'FFLAGS={0}'.format(self.compiler.pic_flag) ]) --- .../repos/builtin/packages/suite-sparse/package.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index aa22e1ecce..740e490b5a 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -35,8 +35,8 @@ class SuiteSparse(Package): version('4.5.3', '8ec57324585df3c6483ad7f556afccbd') version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319') - variant('tbb', default=True, description='Build with Intel TBB') - variant('fpic', default=True, description='Build position independent code (required to link with shared libraries)') + variant('tbb', default=False, description='Build with Intel TBB') + variant('pic', default=True, description='Build position independent code (required to link with shared libraries)') depends_on('blas') depends_on('lapack') @@ -46,7 +46,7 @@ class SuiteSparse(Package): # flags does not seem to be used, which leads to linking errors on Linux. depends_on('tbb', when='@4.5.3:+tbb') - patch('tbb_453.patch', when='@4.5.3') + patch('tbb_453.patch', when='@4.5.3:+tbb') def install(self, spec, prefix): # The build system of SuiteSparse is quite old-fashioned. @@ -60,9 +60,9 @@ class SuiteSparse(Package): # inject Spack compiler wrappers make_args.extend([ 'AUTOCC=no', - 'CC=cc', - 'CXX=c++', - 'F77=f77', + 'CC=%s' % self.compiler.cc, + 'CXX=%s' % self.compiler.cxx, + 'F77=%s' % self.compiler.f77, 'CUDA_ROOT =', 'GPU_BLAS_PATH =', 'GPU_CONFIG =', @@ -76,8 +76,14 @@ class SuiteSparse(Package): 'NVCC = echo', 'NVCCFLAGS =', ]) - if '+fpic' in spec: - make_args.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC']) + if '+pic' in spec: + make_args.extend([ + 'CFLAGS={0}'.format(self.compiler.pic_flag), + 'FFLAGS={0}'.format(self.compiler.pic_flag) + ]) + + if '%xl' in spec or '%xl_r' in spec: + make_args.extend(['CFLAGS+=-DBLAS_NO_UNDERSCORE']) # use Spack's metis in CHOLMOD/Partition module, # otherwise internal Metis will be compiled -- cgit v1.2.3-60-g2f50