From 7f847c38776c0e3457651984001900c2eff3227f Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 13 Jun 2015 23:29:58 -0400 Subject: [PATCH] [SCons] Miscellaneous cleanup of SConstruct/SConscript files --- SConstruct | 11 ++++------- ext/SConscript | 22 ++++------------------ platform/posix/SConscript | 2 -- src/SConscript | 5 ++--- test_problems/SConscript | 14 +------------- 5 files changed, 11 insertions(+), 43 deletions(-) diff --git a/SConstruct b/SConstruct index 9964e1af9..6388b85e7 100644 --- a/SConstruct +++ b/SConstruct @@ -578,7 +578,7 @@ config_options = [ will be renamed to have a "_shared" extension added to their base name. If not, the base names will be the same as the static libraries. In some cases this simplifies subsequent linking environments with - static libaries and avoids a bug with using valgrind with + static libraries and avoids a bug with using valgrind with the -static linking flag.""", True), EnumVariable( @@ -858,8 +858,8 @@ if env['HAS_SUNDIALS'] and env['use_sundials'] != 'n': env['has_sundials_lapack'] = conf.CheckDeclaration('SUNDIALS_BLAS_LAPACK', '#include "sundials/sundials_config.h"', 'C++') - #In the case where a user is trying to link Cantera to an exteral BLAS/LAPACK - #library, but Sundials was configured without this support, print a Warning. + # In the case where a user is trying to link Cantera to an external BLAS/LAPACK + # library, but Sundials was configured without this support, print a Warning. if not env['has_sundials_lapack'] and not env['BUILD_BLAS_LAPACK']: print ('WARNING: External BLAS/LAPACK has been specified for Cantera ' 'but Sundials was built without this support.') @@ -1346,9 +1346,6 @@ for xml in mglob(env, 'data/inputs', 'xml'): build(env.Command(dest, xml.path, Copy('$TARGET', '$SOURCE'))) if addInstallActions: - if env['VERBOSE']: - print 'INFO 2: addInstallActions script started' - # Put headers in place headerBase = 'include/cantera' install(env.RecursiveInstall, '$inst_incdir', 'include/cantera') @@ -1414,7 +1411,7 @@ linkSharedLibs.extend(env['boost_libs']) # Store the list of needed static link libraries in the environment env['cantera_libs'] = linkLibs env['cantera_shared_libs'] = linkSharedLibs -if env['renamed_shared_libraries'] == False : +if not env['renamed_shared_libraries']: env['cantera_shared_libs'] = linkLibs # Add targets from the SConscript files in the various subdirectories diff --git a/ext/SConscript b/ext/SConscript index 760a10980..7b524f45e 100644 --- a/ext/SConscript +++ b/ext/SConscript @@ -3,7 +3,6 @@ from buildutils import * Import('env', 'build', 'install', 'libraryTargets') localenv = env.Clone() - def prep_default(env): localenv = env.Clone() @@ -48,11 +47,8 @@ def prep_gtest(env): CPPDEFINES={'GTEST_HAS_PTHREAD': 0}) return localenv -# libs is a list of length 3 -# 0 subdir for execution -# 1 file extension -# 2 function pointer -# (subdir, (file extensions), prepfunction) + +# each element of libs is: (subdir, (file extensions), prepfunction) libs = [('libexecstream', ['cpp'], prep_default)] if env['build_with_f2c']: @@ -85,22 +81,12 @@ else: if env['use_sundials'] == 'n': libs.append(('cvode/source', ['c'], prep_sundials)) - for subdir, extensions, prepFunction in libs: - - if env['VERBOSE']: - print 'INFO 2: Prep the environment for ', subdir, - print ' with extensions ', extensions, - print ' by calling func ', prepFunction.__name__ - localenv = prepFunction(env) - objects = localenv.SharedObject(mglob(localenv, subdir, *extensions)) libraryTargets.extend(objects) -# Google Test: Used internally for Cantera unit tests. Optionally, the headers -# and compiled library can be installed alongside Cantera using the scons -# option 'install_gtest=y'. +# Google Test: Used internally for Cantera unit tests. localenv = prep_gtest(env) gtest = build(localenv.Library('../lib/gtest', - source=['gtest/src/gtest-all.cc'])) + source=['gtest/src/gtest-all.cc'])) diff --git a/platform/posix/SConscript b/platform/posix/SConscript index 01cf9bc1a..52c2746f2 100644 --- a/platform/posix/SConscript +++ b/platform/posix/SConscript @@ -101,9 +101,7 @@ if not localenv['build_with_f2c']: else: localenv['mak_syslibs'] = '' -print 'making Cantera.mak' mak = build(localenv.SubstFile('Cantera.mak', 'Cantera.mak.in')) -print 'posted making Cantera.mak' install('$inst_incdir', mak) # Generate cantera.pc for use with pkg-config diff --git a/src/SConscript b/src/SConscript index 0d1f3b766..2c1f2e57b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -66,10 +66,9 @@ if localenv['OS'] in ('Darwin', 'Windows', 'Cygwin'): localenv.Append(LIBS=localenv['boost_libs'], LIBPATH=localenv['boost_lib_dir']) -# Build the Cantera shared library using the correct name +# Build the Cantera shared library if localenv['layout'] != 'debian': - # Define the name according to the environmental variable - if localenv['renamed_shared_libraries'] == True: + if localenv['renamed_shared_libraries']: sharedName = '../lib/cantera_shared' else: sharedName = '../lib/cantera' diff --git a/test_problems/SConscript b/test_problems/SConscript index d0869964d..5a860fb6b 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -5,7 +5,7 @@ localenv = env.Clone() localenv.Prepend(CPPPATH=['#include', '#src', 'shared']) localenv.Append(CCFLAGS=env['warning_flags']) -# Turn of optimization to speed up compilation +# Turn off optimization to speed up compilation ccflags = localenv['CCFLAGS'] for optimize_flag in ('-O3', '-O2', '/O2'): if optimize_flag in ccflags: @@ -61,7 +61,6 @@ class Test(object): self.artifacts = [self.artifacts] self.comparisons = kwargs.get('comparisons') or () self.tolerance = kwargs.get('tolerance') or 1e-5 # error tolerance for CSV comparison - # self.tolerance = kwargs.get('tolerance') or 1e-7 # error tolerance for CSV comparison self.threshold = kwargs.get('threshold') or 1e-14 # error threshold for CSV comparison # ignore lines starting with specified strings when comparing output files @@ -268,7 +267,6 @@ if haveConverters: Test('negA-cti', 'negATest', negA, 'negATest_blessed.out', options='noxNeg.cti', artifacts=negA_name) -#CompileAndTest('pecosTransport', 'PecosTransport', 'pecosTransport', 'output_blessed.txt') CompileAndTest('pureFluid', 'pureFluidTest', 'testPureWater', 'output_blessed.txt') if haveConverters: CompileAndTest('rankine_democxx', 'rankine_democxx', 'rankine', 'output_blessed.txt') @@ -277,16 +275,6 @@ CompileAndTest('simpleTransport', 'simpleTransport', 'simpleTransport', 'output_blessed.txt') CompileAndTest('stoichSolidKinetics', 'stoichSolidKinetics', 'stoichSolidKinetics', 'output_blessed.txt') -# CompileAndTest('statmech_test', 'statmech_test', -# 'statmech_test', 'output_blessed.txt') -# CompileAndTest('statmech_properties', 'statmech_properties', -# 'statmech_properties', 'output_blessed.txt') -# CompileAndTest('statmech_test_poly', 'statmech_test_poly', -# 'statmech_test_poly', 'output_blessed.txt') -# CompileAndTest('statmech_transport', 'statmech_transport', -# 'statmech_transport', 'output_blessed.txt') -# CompileAndTest('statmech_test_Fe', 'statmech', -# 'statmech_test_Fe', 'output_blessed.txt') CompileAndTest('surfkin', 'surfkin', 'surfdemo', 'output_blessed.txt') CompileAndTest('surfSolver', 'surfSolverTest', 'surfaceSolver', None, arguments='haca2.xml',