[SCons] Restore 'single_library' build option

The 'single_library=y' build option must be retained in order to support
compilation on Windows and OS X.
This commit is contained in:
Ray Speth 2013-10-04 16:22:55 +00:00
parent 5fff5ce99f
commit e1074722c5
3 changed files with 47 additions and 41 deletions

View file

@ -1342,34 +1342,32 @@ if env['use_sundials'] == 'y':
linkSharedLibs.extend(('sundials_cvodes', 'sundials_ida', 'sundials_nvecserial'))
else:
env['sundials_libs'] = []
linkLibs.extend(['cvode'])
linkSharedLibs.extend(['cvode_shared'])
if not env['single_library']:
linkLibs.extend(['cvode'])
linkSharedLibs.extend(['cvode_shared'])
#print 'linkLibs = ', linkLibs
linkLibs.append('ctmath')
linkSharedLibs.append('ctmath_shared')
if not env['single_library']:
linkLibs.append('ctmath')
linkSharedLibs.append('ctmath_shared')
# Add execstream to the link line
linkLibs.append('execstream')
linkSharedLibs.append('execstream_shared')
#print 'linklibs' , linkLibs
#print env.Dump()
#exit (0)
linkLibs.append('execstream')
linkSharedLibs.append('execstream_shared')
# Add lapack and blas to the link line
# If there is a special blas and lapack add that in
if env['blas_lapack_libs']:
linkLibs.extend(env['blas_lapack_libs'])
linkSharedLibs.extend(env['blas_lapack_libs'])
else:
elif not env['single_library']:
linkLibs.extend(('ctlapack', 'ctblas'))
linkSharedLibs.extend(('ctlapack_shared', 'ctblas_shared'))
if not env['build_with_f2c']:
linkLibs.extend(env['FORTRANSYSLIBS'])
linkSharedLibs.append(env['FORTRANSYSLIBS'])
else:
elif not env['single_library']:
# Add the f2c library when f2c is requested
linkLibs.append('ctf2c')
linkSharedLibs.append('ctf2c_shared')

View file

@ -115,38 +115,42 @@ for subdir, extensions, prepFunction in libs:
localenv = prepFunction(env)
libName = 'ct' + subdir
if libName == 'ctf2c_blas':
libName = 'ctblas'
if libName == 'ctf2c_lapack':
libName = 'ctlapack'
if libName == 'ctf2c_math':
libName = 'ctmath'
if libName == 'ctcvode/source':
libName = 'cvode'
if libName == 'ctlibexecstream':
libName = 'execstream'
if libName == 'ctf2c_libs':
libName = 'ctf2c'
if localenv['renamed_shared_libraries']:
sharedLibName = libName + '_shared'
if localenv['single_library']:
objects = localenv.SharedObject(mglob(localenv, subdir, *extensions))
libraryTargets.extend(objects)
else:
sharedLibName = libName
libName = 'ct' + subdir
if libName == 'ctf2c_blas':
libName = 'ctblas'
if libName == 'ctf2c_lapack':
libName = 'ctlapack'
if libName == 'ctf2c_math':
libName = 'ctmath'
if libName == 'ctcvode/source':
libName = 'cvode'
if libName == 'ctlibexecstream':
libName = 'execstream'
if libName == 'ctf2c_libs':
libName = 'ctf2c'
if env['VERBOSE']:
print "INFO 2:", subdir, ' with ', extensions
print " libName = ", libName, " sharedLibName = ", sharedLibName
if localenv['renamed_shared_libraries']:
sharedLibName = libName + '_shared'
else:
sharedLibName = libName
objects = localenv.SharedObject(mglob(localenv, subdir, *extensions))
if env['VERBOSE']:
print "INFO 2:", subdir, ' with ', extensions
print " libName = ", libName, " sharedLibName = ", sharedLibName
# Build the static library
lib = build(localenv.StaticLibrary(pjoin('..', 'lib', libName), objects))
install('$inst_libdir', lib)
objects = localenv.SharedObject(mglob(localenv, subdir, *extensions))
# Build the shared library
liby = build(localenv.SharedLibrary(pjoin('..', 'lib', sharedLibName), objects))
install('$inst_libdir', liby)
# Build the static library
lib = build(localenv.StaticLibrary(pjoin('..', 'lib', libName), objects))
install('$inst_libdir', lib)
# Build the shared library
liby = build(localenv.SharedLibrary(pjoin('..', 'lib', sharedLibName), objects))
install('$inst_libdir', liby)
# Google Test: Used internally for Cantera unit tests. Optionally, the headers
# and compiled library can be installed alongside Cantera using the scons

View file

@ -37,7 +37,8 @@ pc_incdirs = []
pc_cflags = []
localenv['mak_corelibs'] = '-lcantera'
localenv['mak_corelibs'] += ' -lctmath -lexecstream'
if not env['single_library']:
localenv['mak_corelibs'] += ' -lctmath -lexecstream'
localenv['mak_extra_includes'] = ['-I%s' % s for s in localenv['extra_inc_dirs']]
pc_incdirs.extend(localenv['extra_inc_dirs'])
@ -85,10 +86,13 @@ localenv['mak_have_blas_lapack_dir'] = '1' if localenv['blas_lapack_dir'] else '
if localenv['blas_lapack_dir']:
localenv['mak_blas_lapack_libs'] = ' '.join('-l%s' % s for s in localenv['blas_lapack_libs'])
else:
elif not env['single_library']:
localenv['mak_blas_lapack_libs'] = ('-L' + '$(CANTERA_INSTALL_ROOT)/lib' + ' -lctlapack -lctblas')
localenv['mak_blas_lapack_libs_dep'] = ( '$' + '(CANTERA_INSTALL_ROOT)' + '/lib' + 'ctlapack' + '.a' + ' $(CANTERA_INSTALL_ROOT)/lib/libctblas.a')
print 'blas = ', localenv['mak_blas_lapack_libs_dep']
else:
localenv['mak_blas_lapack_libs'] = ''
localenv['mak_blas_lapack_libs_dep'] = ''
if 'Accelerate' in localenv['FRAMEWORKS']:
localenv['mak_blas_lapack_libs'] += ' -framework Accelerate'