From a8e884d34ece9f704fd2edee4c197503ca9d79c7 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 18 Dec 2013 17:45:25 +0000 Subject: [PATCH] [SCons] Check for incompabible BLAS/LAPACK when building Matlab toolbox Matlab's practice of substituting an "8 byte integer" BLAS/LAPACK library for the "4 byte integer" BLAS/LAPACK libraries that Cantera is designed to use causes Cantera to crash. This can only be avoided by statically linking Cantera to BLAS and LAPACK, e.g. by using the BLAS/LAPACK implementations included with Cantera. Since the Matlab toolbox itself needs to be a shared library, it is not usually possible to link statically link it with vendor-provided BLAS/LAPACK libraries, since they are not compiled with the appropriate options, i.e. '-fPIC'. Resolves Issue 34. --- SConstruct | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SConstruct b/SConstruct index 501ae7652..17216f94e 100644 --- a/SConstruct +++ b/SConstruct @@ -974,6 +974,14 @@ if env['matlab_toolbox'] == 'y': print """ERROR: Unable to build the Matlab toolbox because 'matlab_path' has not been set.""" sys.exit(1) + if env['blas_lapack_libs']: + print ('ERROR: The Matlab toolbox is incompatible with external BLAS ' + 'and LAPACK libraries. Unset blas_lapack_libs (e.g. "scons ' + 'build blas_lapack_libs=") in order to build the Matlab ' + 'toolbox, or set matlab_toolbox=n to use the specified BLAS/' + 'LAPACK libraries and skip building the Matlab toolbox.') + sys.exit(1) + if not (os.path.isdir(matPath) and os.path.isdir(pjoin(matPath, 'extern'))): print """ERROR: Path set for 'matlab_path' is not correct."""