From 31c66378c6f43c991344dd853181d0d7f3bdd19f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 1 Apr 2016 15:48:12 -0400 Subject: [PATCH] [SCons] Fix Cantera.mak when blas_lapack_dir is empty Previously, if no library directory needed to be specified for BLAS/LAPACK, the link line would end up containing '-L -llapack -lblas' which is interpreted as adding the directory '-llapack' to the linker search path. --- platform/posix/Cantera.mak.in | 2 +- platform/posix/SConscript | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/posix/Cantera.mak.in b/platform/posix/Cantera.mak.in index 25ae07b2c..8075f0142 100644 --- a/platform/posix/Cantera.mak.in +++ b/platform/posix/Cantera.mak.in @@ -63,7 +63,7 @@ CANTERA_SUNDIALS_LIBS=@mak_sundials_libdir@ @mak_sundials_libs@ # BLAS LAPACK LINKAGE ############################################################################### -CANTERA_BLAS_LAPACK_LIBS=-L@blas_lapack_dir@ @mak_blas_lapack_libs@ +CANTERA_BLAS_LAPACK_LIBS=@mak_blas_lapack_libs@ ############################################################################### # COMBINATIONS OF INCLUDES AND LIBS diff --git a/platform/posix/SConscript b/platform/posix/SConscript index 4e910d169..9d529cc5c 100644 --- a/platform/posix/SConscript +++ b/platform/posix/SConscript @@ -65,7 +65,12 @@ else: localenv['mak_boost_include'] = '' # Handle BLAS/LAPACK linkage -localenv['mak_blas_lapack_libs'] = ' '.join('-l%s' % s for s in localenv['blas_lapack_libs']) +blas_lapack_libs = ' '.join('-l%s' % s for s in localenv['blas_lapack_libs']) +if localenv['blas_lapack_dir']: + localenv['mak_blas_lapack_libs'] = '-L{} {}'.format(localenv['blas_lapack_dir'], + blas_lapack_libs) +else: + localenv['mak_blas_lapack_libs'] = blas_lapack_libs if 'Accelerate' in localenv['FRAMEWORKS']: localenv['mak_blas_lapack_libs'] += ' -framework Accelerate'