[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.
This commit is contained in:
Ray Speth 2013-12-18 17:45:25 +00:00
parent 28dbcf072e
commit a8e884d34e

View file

@ -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."""