52 |
else: |
else: |
53 |
print "Options file is", options_file |
print "Options file is", options_file |
54 |
|
|
55 |
# Load options file and command-line arguments |
#Does our scons support the newer Variables class or do we need to use Options? |
56 |
opts = Options(options_file, ARGUMENTS) |
|
57 |
|
try: |
58 |
|
dummyvar=Variables |
59 |
|
opts = Variables(options_file, ARGUMENTS) |
60 |
|
adder = opts.AddVariables |
61 |
|
except: |
62 |
|
opts = Options(options_file, ARGUMENTS) |
63 |
|
adder = opts.AddOptions |
64 |
|
BoolVariable = BoolOption |
65 |
|
|
66 |
############ Load build options ################################ |
############ Load build options ################################ |
67 |
|
|
68 |
opts.AddOptions( |
adder( |
69 |
|
#opts.AddOptions( |
70 |
# Where to install esys stuff |
# Where to install esys stuff |
71 |
('prefix', 'where everything will be installed', Dir('#.').abspath), |
('prefix', 'where everything will be installed', Dir('#.').abspath), |
72 |
('incinstall', 'where the esys headers will be installed', os.path.join(Dir('#.').abspath,'include')), |
('incinstall', 'where the esys headers will be installed', os.path.join(Dir('#.').abspath,'include')), |
74 |
('libinstall', 'where the esys libraries will be installed', os.path.join(prefix,'lib')), |
('libinstall', 'where the esys libraries will be installed', os.path.join(prefix,'lib')), |
75 |
('pyinstall', 'where the esys python modules will be installed', os.path.join(prefix,'esys')), |
('pyinstall', 'where the esys python modules will be installed', os.path.join(prefix,'esys')), |
76 |
# Compilation options |
# Compilation options |
77 |
BoolOption('dodebug', 'For backwards compatibility', 'no'), |
BoolVariable('dodebug', 'For backwards compatibility', 'no'), |
78 |
BoolOption('usedebug', 'Do you want a debug build?', 'no'), |
BoolVariable('usedebug', 'Do you want a debug build?', 'no'), |
79 |
BoolOption('usevtk', 'Do you want to use VTK?', 'yes'), |
BoolVariable('usevtk', 'Do you want to use VTK?', 'yes'), |
80 |
('options_file', 'File of paths/options. Default: scons/<hostname>_options.py', options_file), |
('options_file', 'File of paths/options. Default: scons/<hostname>_options.py', options_file), |
81 |
('win_cc_name', 'windows C compiler name if needed', 'msvc'), |
('win_cc_name', 'windows C compiler name if needed', 'msvc'), |
82 |
# The strings -DDEFAULT_ get replaced by scons/<hostname>_options.py or by defaults below |
# The strings -DDEFAULT_ get replaced by scons/<hostname>_options.py or by defaults below |
90 |
('ld_extra', 'Extra linker flags', ''), |
('ld_extra', 'Extra linker flags', ''), |
91 |
('sys_libs', 'System libraries to link with', []), |
('sys_libs', 'System libraries to link with', []), |
92 |
('ar_flags', 'Static library archiver flags to use', ''), |
('ar_flags', 'Static library archiver flags to use', ''), |
93 |
BoolOption('useopenmp', 'Compile parallel version using OpenMP', 'no'), |
BoolVariable('useopenmp', 'Compile parallel version using OpenMP', 'no'), |
94 |
BoolOption('usepedantic', 'Compile with -pedantic if using gcc', 'no'), |
BoolVariable('usepedantic', 'Compile with -pedantic if using gcc', 'no'), |
95 |
BoolOption('usewarnings','Compile with warnings as errors if using gcc','yes'), |
BoolVariable('usewarnings','Compile with warnings as errors if using gcc','yes'), |
96 |
('forcelazy','for testing use only - set the default value for autolazy','leave_alone'), |
('forcelazy','for testing use only - set the default value for autolazy','leave_alone'), |
97 |
# Python |
# Python |
98 |
('python_path', 'Path to Python includes', '/usr/include/'+python_version), |
('python_path', 'Path to Python includes', '/usr/include/'+python_version), |
104 |
('boost_lib_path', 'Path to Boost libs', usr_lib), |
('boost_lib_path', 'Path to Boost libs', usr_lib), |
105 |
('boost_libs', 'Boost libraries to link with', ['boost_python']), |
('boost_libs', 'Boost libraries to link with', ['boost_python']), |
106 |
# NetCDF |
# NetCDF |
107 |
BoolOption('usenetcdf', 'switch on/off the usage of netCDF', 'yes'), |
BoolVariable('usenetcdf', 'switch on/off the usage of netCDF', 'yes'), |
108 |
('netCDF_path', 'Path to netCDF includes', '/usr/include'), |
('netCDF_path', 'Path to netCDF includes', '/usr/include'), |
109 |
('netCDF_lib_path', 'Path to netCDF libs', usr_lib), |
('netCDF_lib_path', 'Path to netCDF libs', usr_lib), |
110 |
('netCDF_libs', 'netCDF C++ libraries to link with', ['netcdf_c++', 'netcdf']), |
('netCDF_libs', 'netCDF C++ libraries to link with', ['netcdf_c++', 'netcdf']), |
111 |
# MPI |
# MPI |
112 |
BoolOption('useMPI', 'For backwards compatibility', 'no'), |
BoolVariable('useMPI', 'For backwards compatibility', 'no'), |
113 |
BoolOption('usempi', 'Compile parallel version using MPI', 'no'), |
BoolVariable('usempi', 'Compile parallel version using MPI', 'no'), |
114 |
('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'), |
('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'), |
115 |
('mpi_path', 'Path to MPI includes', '/usr/include'), |
('mpi_path', 'Path to MPI includes', '/usr/include'), |
116 |
('mpi_run', 'mpirun name' , 'mpiexec -np 1'), |
('mpi_run', 'mpirun name' , 'mpiexec -np 1'), |
118 |
('mpi_libs', 'MPI libraries to link with (needs to be shared!)', ['mpich' , 'pthread', 'rt']), |
('mpi_libs', 'MPI libraries to link with (needs to be shared!)', ['mpich' , 'pthread', 'rt']), |
119 |
('mpi_flavour','Type of MPI execution environment','none'), |
('mpi_flavour','Type of MPI execution environment','none'), |
120 |
# ParMETIS |
# ParMETIS |
121 |
BoolOption('useparmetis', 'Compile parallel version using ParMETIS', 'yes'), |
BoolVariable('useparmetis', 'Compile parallel version using ParMETIS', 'yes'), |
122 |
('parmetis_path', 'Path to ParMETIS includes', '/usr/include'), |
('parmetis_path', 'Path to ParMETIS includes', '/usr/include'), |
123 |
('parmetis_lib_path', 'Path to ParMETIS library', usr_lib), |
('parmetis_lib_path', 'Path to ParMETIS library', usr_lib), |
124 |
('parmetis_libs', 'ParMETIS library to link with', ['parmetis', 'metis']), |
('parmetis_libs', 'ParMETIS library to link with', ['parmetis', 'metis']), |
125 |
# PAPI |
# PAPI |
126 |
BoolOption('usepapi', 'switch on/off the usage of PAPI', 'no'), |
BoolVariable('usepapi', 'switch on/off the usage of PAPI', 'no'), |
127 |
('papi_path', 'Path to PAPI includes', '/usr/include'), |
('papi_path', 'Path to PAPI includes', '/usr/include'), |
128 |
('papi_lib_path', 'Path to PAPI libs', usr_lib), |
('papi_lib_path', 'Path to PAPI libs', usr_lib), |
129 |
('papi_libs', 'PAPI libraries to link with', ['papi']), |
('papi_libs', 'PAPI libraries to link with', ['papi']), |
130 |
BoolOption('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', False), |
BoolVariable('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', False), |
131 |
# MKL |
# MKL |
132 |
BoolOption('usemkl', 'switch on/off the usage of MKL', 'no'), |
BoolVariable('usemkl', 'switch on/off the usage of MKL', 'no'), |
133 |
('mkl_path', 'Path to MKL includes', '/sw/sdev/cmkl/10.0.2.18/include'), |
('mkl_path', 'Path to MKL includes', '/sw/sdev/cmkl/10.0.2.18/include'), |
134 |
('mkl_lib_path', 'Path to MKL libs', '/sw/sdev/cmkl/10.0.2.18/lib/em64t'), |
('mkl_lib_path', 'Path to MKL libs', '/sw/sdev/cmkl/10.0.2.18/lib/em64t'), |
135 |
('mkl_libs', 'MKL libraries to link with', ['mkl_solver', 'mkl_em64t', 'guide', 'pthread']), |
('mkl_libs', 'MKL libraries to link with', ['mkl_solver', 'mkl_em64t', 'guide', 'pthread']), |
136 |
# UMFPACK |
# UMFPACK |
137 |
BoolOption('useumfpack', 'switch on/off the usage of UMFPACK', 'no'), |
BoolVariable('useumfpack', 'switch on/off the usage of UMFPACK', 'no'), |
138 |
('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'), |
('ufc_path', 'Path to UFconfig includes', '/usr/include/suitesparse'), |
139 |
('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'), |
('umf_path', 'Path to UMFPACK includes', '/usr/include/suitesparse'), |
140 |
('umf_lib_path', 'Path to UMFPACK libs', usr_lib), |
('umf_lib_path', 'Path to UMFPACK libs', usr_lib), |
141 |
('umf_libs', 'UMFPACK libraries to link with', ['umfpack']), |
('umf_libs', 'UMFPACK libraries to link with', ['umfpack']), |
142 |
# Silo |
# Silo |
143 |
BoolOption('usesilo', 'switch on/off the usage of Silo', 'yes'), |
BoolVariable('usesilo', 'switch on/off the usage of Silo', 'yes'), |
144 |
('silo_path', 'Path to Silo includes', '/usr/include'), |
('silo_path', 'Path to Silo includes', '/usr/include'), |
145 |
('silo_lib_path', 'Path to Silo libs', usr_lib), |
('silo_lib_path', 'Path to Silo libs', usr_lib), |
146 |
('silo_libs', 'Silo libraries to link with', ['siloh5', 'hdf5']), |
('silo_libs', 'Silo libraries to link with', ['siloh5', 'hdf5']), |