20 |
if sys.path.count('scons')==0: sys.path.append('scons') |
if sys.path.count('scons')==0: sys.path.append('scons') |
21 |
import scons_extensions |
import scons_extensions |
22 |
|
|
23 |
|
# We may also need to know where python's site-packages subdirectory lives |
24 |
|
python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
25 |
|
|
26 |
#=============================================================== |
#=============================================================== |
27 |
|
|
28 |
tools_prefix="/usr" |
tools_prefix="/usr" |
31 |
# |
# |
32 |
# get the installation prefix |
# get the installation prefix |
33 |
# |
# |
34 |
prefix = ARGUMENTS.get('prefix', '/usr') |
prefix = ARGUMENTS.get('prefix', sys.prefix ) |
35 |
|
|
36 |
# We may also need to know where python's site-packages subdirectory lives |
# We may also need to know where python's site-packages subdirectory lives |
37 |
python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
|
|
|
38 |
# Install as a standard python package in /usr/lib64 if available, else in /usr/lib |
# Install as a standard python package in /usr/lib64 if available, else in /usr/lib |
39 |
if os.path.isdir( prefix+"/lib64/"+python_version+"/site-packages"): |
if os.path.isdir( prefix+"/lib64/"+python_version+"/site-packages"): |
40 |
sys_dir_packages = prefix+"/lib64/"+python_version+"/site-packages/esys" |
sys_dir_packages = prefix+"/lib64/"+python_version+"/site-packages/esys" |
51 |
dir_examples = os.path.join(source_root,"examples") |
dir_examples = os.path.join(source_root,"examples") |
52 |
dir_libraries = os.path.join(source_root,"lib") |
dir_libraries = os.path.join(source_root,"lib") |
53 |
|
|
54 |
|
print "Source root is : ",source_root |
55 |
print " Default packages local installation: ", dir_packages |
print " Default packages local installation: ", dir_packages |
56 |
print " Default library local installation ", dir_libraries |
print " Default library local installation ", dir_libraries |
57 |
print " Default example local installation: ", dir_examples |
print " Default example local installation: ", dir_examples |
138 |
boost_path_default=os.path.join(tools_prefix,'include') |
boost_path_default=os.path.join(tools_prefix,'include') |
139 |
boost_lib_path_default=os.path.join(tools_prefix,'lib') |
boost_lib_path_default=os.path.join(tools_prefix,'lib') |
140 |
boost_lib_default=['boost_python'] |
boost_lib_default=['boost_python'] |
141 |
|
|
142 |
#========================================================================== |
#========================================================================== |
143 |
# |
# |
144 |
# check if netCDF is installed on the system: |
# check if netCDF is installed on the system: |
145 |
# |
# |
146 |
netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3') |
netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3') |
147 |
netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3') |
netCDF_lib_path_default=os.path.join(tools_prefix,'lib') |
148 |
|
|
149 |
if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default): |
if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default): |
150 |
useNetCDF_default='yes' |
useNetCDF_default='yes' |
157 |
|
|
158 |
#========================================================================== |
#========================================================================== |
159 |
# |
# |
160 |
|
# MPI: |
161 |
|
# |
162 |
|
if IS_WINDOWS_PLATFORM: |
163 |
|
useMPI_default='no' |
164 |
|
mpi_path_default=None |
165 |
|
mpi_lib_path_default=None |
166 |
|
mpi_libs_default=[] |
167 |
|
mpi_run_default=None |
168 |
|
else: |
169 |
|
useMPI_default='no' |
170 |
|
mpi_root='/usr/local' |
171 |
|
mpi_path_default=os.path.join(mpi_root,'include') |
172 |
|
mpi_lib_path_default=os.path.join(mpi_root,'lib') |
173 |
|
mpi_libs_default=[ 'mpich' , 'pthread', 'rt' ] |
174 |
|
mpi_run_default='mpiexec -np 1' |
175 |
|
# |
176 |
|
#========================================================================== |
177 |
|
# |
178 |
# compile: |
# compile: |
179 |
# |
# |
180 |
cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi' |
181 |
cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi' |
182 |
cxx_flags_default='--no-warn -ansi' |
cxx_flags_default='--no-warn -ansi' |
183 |
cxx_flags_debug_default='--no-warn -ansi -DDOASSERT' |
cxx_flags_debug_default='--no-warn -ansi -DDOASSERT' |
184 |
|
|
185 |
#============================================================================================== |
#============================================================================================== |
186 |
# Default options and options help text |
# Default options and options help text |
187 |
# These are defaults and can be overridden using command line arguments or an options file. |
# These are defaults and can be overridden using command line arguments or an options file. |
208 |
('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"), |
('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"), |
209 |
# Compilation options |
# Compilation options |
210 |
BoolOption('dodebug', 'Do you want a debug build?', 'no'), |
BoolOption('dodebug', 'Do you want a debug build?', 'no'), |
211 |
|
BoolOption('bounds_check', 'Do you want extra array bounds checking?', 'no'), |
212 |
('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file), |
('options_file', "Optional file containing preferred options. Ignored if it doesn't exist (default: scons/<hostname>_options.py)", options_file), |
213 |
('cc_defines','C/C++ defines to use', None), |
('cc_defines','C/C++ defines to use', None), |
214 |
('cc_flags','C compiler flags to use (Release build)', cc_flags_default), |
('cc_flags','C compiler flags to use (Release build)', cc_flags_default), |
215 |
('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default), |
('cc_flags_debug', 'C compiler flags to use (Debug build)', cc_flags_debug_default), |
216 |
('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default), |
('cxx_flags', 'C++ compiler flags to use (Release build)', cxx_flags_default), |
217 |
('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default), |
('cxx_flags_debug', 'C++ compiler flags to use (Debug build)', cxx_flags_debug_default), |
218 |
|
('omp_flags', 'OpenMP compiler flags to use (Release build)', ''), |
219 |
|
('omp_flags_debug', 'OpenMP compiler flags to use (Debug build)', ''), |
220 |
('ar_flags', 'Static library archiver flags to use', None), |
('ar_flags', 'Static library archiver flags to use', None), |
221 |
('sys_libs', 'System libraries to link with', None), |
('sys_libs', 'System libraries to link with', None), |
222 |
('tar_flags','flags for zip files','-c -z'), |
('tar_flags','flags for zip files','-c -z'), |
238 |
PathOption('amd_path', 'Path to AMD includes', amd_path_default), |
PathOption('amd_path', 'Path to AMD includes', amd_path_default), |
239 |
PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default), |
PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default), |
240 |
('amd_libs', 'AMD libraries to link with', amd_libs_default), |
('amd_libs', 'AMD libraries to link with', amd_libs_default), |
241 |
|
# TRILINOS |
242 |
|
PathOption('trilinos_path', 'Path to TRILINOS includes', None), |
243 |
|
PathOption('trilinos_lib_path', 'Path to TRILINOS libs', None), |
244 |
|
('trilinos_libs', 'TRILINOS libraries to link with', None), |
245 |
# BLAS |
# BLAS |
246 |
PathOption('blas_path', 'Path to BLAS includes', None), |
PathOption('blas_path', 'Path to BLAS includes', None), |
247 |
PathOption('blas_lib_path', 'Path to BLAS libs', None), |
PathOption('blas_lib_path', 'Path to BLAS libs', None), |
269 |
PathOption('papi_path', 'Path to PAPI includes', None), |
PathOption('papi_path', 'Path to PAPI includes', None), |
270 |
PathOption('papi_lib_path', 'Path to PAPI libs', None), |
PathOption('papi_lib_path', 'Path to PAPI libs', None), |
271 |
('papi_libs', 'PAPI libraries to link with', None), |
('papi_libs', 'PAPI libraries to link with', None), |
272 |
|
('papi_instrument_solver', 'use PAPI in Solver.c to instrument each iteration of the solver', None), |
273 |
# MPI |
# MPI |
274 |
BoolOption('useMPI', 'Compile parallel version using MPI', 'no'), |
BoolOption('useMPI', 'Compile parallel version using MPI', useMPI_default), |
275 |
|
('MPICH_IGNORE_CXX_SEEK', 'name of macro to ignore MPI settings of C++ SEEK macro (for MPICH)' , 'MPICH_IGNORE_CXX_SEEK'), |
276 |
|
PathOption('mpi_path', 'Path to MPI includes', mpi_path_default), |
277 |
|
('mpi_run', 'mpirun name' , mpi_run_default), |
278 |
|
PathOption('mpi_lib_path', 'Path to MPI libs (needs to be added to the LD_LIBRARY_PATH)',mpi_lib_path_default), |
279 |
|
('mpi_libs', 'MPI libraries to link with (needs to be shared!)', mpi_libs_default) |
280 |
) |
) |
281 |
#================================================================================================= |
#================================================================================================= |
282 |
# |
# |
291 |
|
|
292 |
if IS_WINDOWS_PLATFORM: |
if IS_WINDOWS_PLATFORM: |
293 |
env = Environment(tools = ['default', 'msvc'], options = opts) |
env = Environment(tools = ['default', 'msvc'], options = opts) |
294 |
|
#env = Environment(tools = ['default', 'intelc'], options = opts) |
295 |
else: |
else: |
296 |
if os.uname()[4]=='ia64': |
if os.uname()[4]=='ia64': |
297 |
env = Environment(tools = ['default', 'intelc'], options = opts) |
env = Environment(tools = ['default', 'intelc'], options = opts) |
301 |
env = Environment(tools = ['default'], options = opts) |
env = Environment(tools = ['default'], options = opts) |
302 |
Help(opts.GenerateHelpText(env)) |
Help(opts.GenerateHelpText(env)) |
303 |
|
|
304 |
|
if env['bounds_check']: |
305 |
|
env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ]) |
306 |
|
env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ]) |
307 |
|
bounds_check = env['bounds_check'] |
308 |
|
else: |
309 |
|
bounds_check = 0 |
310 |
|
|
311 |
#================================================================================================= |
#================================================================================================= |
312 |
# |
# |
313 |
# Initialise Scons Build Environment |
# Initialise Scons Build Environment |
324 |
omp_num_threads = os.environ['OMP_NUM_THREADS'] |
omp_num_threads = os.environ['OMP_NUM_THREADS'] |
325 |
except KeyError: |
except KeyError: |
326 |
omp_num_threads = 1 |
omp_num_threads = 1 |
327 |
|
env['ENV']['OMP_NUM_THREADS'] = omp_num_threads |
328 |
|
|
329 |
|
try: |
330 |
|
path = os.environ['PATH'] |
331 |
|
env['ENV']['PATH'] = path |
332 |
|
except KeyError: |
333 |
|
omp_num_threads = 1 |
334 |
|
|
335 |
env['ENV']['OMP_NUM_THREADS'] = omp_num_threads |
env['ENV']['OMP_NUM_THREADS'] = omp_num_threads |
336 |
|
|
337 |
|
|
338 |
|
# Copy some variables from the system environment to the build environment |
339 |
try: |
try: |
340 |
env['ENV']['DISPLAY'] = os.environ['DISPLAY'] |
env['ENV']['DISPLAY'] = os.environ['DISPLAY'] |
341 |
env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY'] |
env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY'] |
342 |
|
home_temp = os.environ['HOME'] # MPICH2's mpd needs $HOME to find $HOME/.mpd.conf |
343 |
|
env['ENV']['HOME'] = home_temp |
344 |
except KeyError: |
except KeyError: |
345 |
pass |
pass |
346 |
|
|
352 |
|
|
353 |
try: |
try: |
354 |
tmp = os.environ['LD_LIBRARY_PATH'] |
tmp = os.environ['LD_LIBRARY_PATH'] |
355 |
|
print tmp |
356 |
env['ENV']['LD_LIBRARY_PATH'] = tmp |
env['ENV']['LD_LIBRARY_PATH'] = tmp |
357 |
except KeyError: |
except KeyError: |
358 |
pass |
pass |
383 |
env.PrependENVPath('LD_LIBRARY_PATH', libinstall) |
env.PrependENVPath('LD_LIBRARY_PATH', libinstall) |
384 |
if IS_WINDOWS_PLATFORM : |
if IS_WINDOWS_PLATFORM : |
385 |
env.PrependENVPath('PATH', libinstall) |
env.PrependENVPath('PATH', libinstall) |
386 |
|
env.PrependENVPath('PATH', env['boost_lib_path']) |
387 |
except KeyError: |
except KeyError: |
388 |
libinstall = None |
libinstall = None |
389 |
try: |
try: |
390 |
pyinstall = env['pyinstall'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc |
pyinstall = env['pyinstall'] # all targets will install into pyinstall/esys but PYTHONPATH points at straight pyinstall so you go import esys.escript etc |
391 |
except KeyError: |
except KeyError: |
392 |
pyinstall = None |
pyinstall = None |
393 |
|
|
394 |
|
try: |
395 |
|
cc_defines = env['cc_defines'] |
396 |
|
env.Append(CPPDEFINES = cc_defines) |
397 |
|
except KeyError: |
398 |
|
pass |
399 |
|
try: |
400 |
|
flags = env['ar_flags'] |
401 |
|
env.Append(ARFLAGS = flags) |
402 |
|
except KeyError: |
403 |
|
ar_flags = None |
404 |
|
try: |
405 |
|
sys_libs = env['sys_libs'] |
406 |
|
except KeyError: |
407 |
|
sys_libs = [] |
408 |
|
|
409 |
|
try: |
410 |
|
tar_flags = env['tar_flags'] |
411 |
|
env.Replace(TARFLAGS = tar_flags) |
412 |
|
except KeyError: |
413 |
|
pass |
414 |
|
|
415 |
try: |
try: |
416 |
exinstall = env['exinstall'] |
exinstall = env['exinstall'] |
417 |
except KeyError: |
except KeyError: |
428 |
sys_exinstall = env['sys_exinstall'] |
sys_exinstall = env['sys_exinstall'] |
429 |
except KeyError: |
except KeyError: |
430 |
sys_exinstall = None |
sys_exinstall = None |
431 |
|
|
432 |
|
# ====================== debugging =================================== |
433 |
try: |
try: |
434 |
dodebug = env['dodebug'] |
dodebug = env['dodebug'] |
435 |
except KeyError: |
except KeyError: |
436 |
dodebug = None |
dodebug = None |
437 |
|
|
438 |
|
# === switch on omp =================================================== |
439 |
try: |
try: |
440 |
useMPI = env['useMPI'] |
omp_flags = env['omp_flags'] |
441 |
except KeyError: |
except KeyError: |
442 |
useMPI = None |
omp_flags = '' |
443 |
|
|
444 |
try: |
try: |
445 |
cc_defines = env['cc_defines'] |
omp_flags_debug = env['omp_flags_debug'] |
|
env.Append(CPPDEFINES = cc_defines) |
|
446 |
except KeyError: |
except KeyError: |
447 |
pass |
omp_flags_debug = '' |
448 |
|
|
449 |
|
# ========= use mpi? ===================================================== |
450 |
|
try: |
451 |
|
useMPI = env['useMPI'] |
452 |
|
except KeyError: |
453 |
|
useMPI = None |
454 |
|
# ========= set compiler flags =========================================== |
455 |
|
|
456 |
if dodebug: |
if dodebug: |
|
if useMPI: |
|
457 |
try: |
try: |
458 |
flags = env['cc_flags_debug_MPI'] |
flags = env['cc_flags_debug'] + ' ' + omp_flags_debug |
|
env.Append(CCFLAGS = flags) |
|
|
except KeyError: |
|
|
pass |
|
|
else: |
|
|
try: |
|
|
flags = env['cc_flags_debug'] |
|
459 |
env.Append(CCFLAGS = flags) |
env.Append(CCFLAGS = flags) |
460 |
except KeyError: |
except KeyError: |
461 |
pass |
pass |
462 |
else: |
else: |
|
if useMPI: |
|
|
try: |
|
|
flags = env['cc_flags_MPI'] |
|
|
env.Append(CCFLAGS = flags) |
|
|
except KeyError: |
|
|
pass |
|
|
else: |
|
463 |
try: |
try: |
464 |
flags = env['cc_flags'] |
flags = env['cc_flags'] + ' ' + omp_flags |
465 |
env.Append(CCFLAGS = flags) |
env.Append(CCFLAGS = flags) |
466 |
except KeyError: |
except KeyError: |
467 |
pass |
pass |
468 |
if dodebug: |
if dodebug: |
|
if useMPI: |
|
|
try: |
|
|
flags = env['cxx_flags_debug_MPI'] |
|
|
env.Append(CXXFLAGS = flags) |
|
|
except KeyError: |
|
|
pass |
|
|
else: |
|
469 |
try: |
try: |
470 |
flags = env['cxx_flags_debug'] |
flags = env['cxx_flags_debug'] |
471 |
env.Append(CXXFLAGS = flags) |
env.Append(CXXFLAGS = flags) |
472 |
except KeyError: |
except KeyError: |
473 |
pass |
pass |
474 |
else: |
else: |
|
if useMPI: |
|
|
try: |
|
|
flags = env['cxx_flags_MPI'] |
|
|
env.Append(CXXFLAGS = flags) |
|
|
except KeyError: |
|
|
pass |
|
|
else: |
|
475 |
try: |
try: |
476 |
flags = env['cxx_flags'] |
flags = env['cxx_flags'] |
477 |
env.Append(CXXFLAGS = flags) |
env.Append(CXXFLAGS = flags) |
478 |
except KeyError: |
except KeyError: |
479 |
pass |
pass |
480 |
try: |
try: |
481 |
flags = env['ar_flags'] |
if env['CC'] == 'gcc': env.Append(CCFLAGS = "-pedantic-errors -Wno-long-long") |
482 |
env.Append(ARFLAGS = flags) |
except: |
483 |
except KeyError: |
pass |
|
ar_flags = None |
|
|
try: |
|
|
sys_libs = env['sys_libs'] |
|
|
except KeyError: |
|
|
sys_libs = [] |
|
484 |
|
|
485 |
try: |
# ============= Remember what options were used in the compile ===================================== |
486 |
tar_flags = env['tar_flags'] |
if not IS_WINDOWS_PLATFORM: |
487 |
env.Replace(TARFLAGS = tar_flags) |
env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*") |
488 |
except KeyError: |
if dodebug: env.Execute("touch " + libinstall + "/Compiled.with.debug") |
489 |
pass |
if useMPI: env.Execute("touch " + libinstall + "/Compiled.with.mpi") |
490 |
|
if omp_flags != '': env.Execute("touch " + libinstall + "/Compiled.with.OpenMP") |
491 |
|
if bounds_check: env.Execute("touch " + libinstall + "/Compiled.with.bounds_check") |
492 |
|
|
493 |
try: |
# ============= set mkl (but only of no MPI) ===================================== |
494 |
includes = env['mkl_path'] |
if not useMPI: |
495 |
env.Append(CPPPATH = [includes,]) |
try: |
496 |
except KeyError: |
includes = env['mkl_path'] |
497 |
pass |
env.Append(CPPPATH = [includes,]) |
498 |
|
except KeyError: |
499 |
|
pass |
500 |
|
|
501 |
try: |
try: |
502 |
lib_path = env['mkl_lib_path'] |
lib_path = env['mkl_lib_path'] |
503 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
504 |
except KeyError: |
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
505 |
pass |
except KeyError: |
506 |
|
pass |
507 |
|
|
|
if useMPI: |
|
|
mkl_libs = [] |
|
|
else: |
|
508 |
try: |
try: |
509 |
mkl_libs = env['mkl_libs'] |
mkl_libs = env['mkl_libs'] |
510 |
except KeyError: |
except KeyError: |
511 |
mkl_libs = [] |
mkl_libs = [] |
512 |
|
else: |
513 |
|
mkl_libs = [] |
514 |
|
|
515 |
try: |
# ============= set scsl (but only of no MPI) ===================================== |
516 |
includes = env['scsl_path'] |
if not useMPI: |
517 |
env.Append(CPPPATH = [includes,]) |
try: |
518 |
except KeyError: |
includes = env['scsl_path'] |
519 |
pass |
env.Append(CPPPATH = [includes,]) |
520 |
|
except KeyError: |
521 |
|
pass |
522 |
|
|
523 |
try: |
try: |
524 |
lib_path = env['scsl_lib_path'] |
lib_path = env['scsl_lib_path'] |
525 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
526 |
except KeyError: |
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
527 |
pass |
except KeyError: |
528 |
|
pass |
529 |
|
|
530 |
|
try: |
531 |
|
scsl_libs = env['scsl_libs'] |
532 |
|
except KeyError: |
533 |
|
scsl_libs = [ ] |
534 |
|
|
535 |
if useMPI: |
else: |
536 |
try: |
scsl_libs = [] |
|
scsl_libs = env['scsl_libs_MPI'] |
|
|
except KeyError: |
|
|
scsl_libs = [] |
|
|
else: |
|
|
try: |
|
|
scsl_libs = env['scsl_libs'] |
|
|
except KeyError: |
|
|
scsl_libs = [] |
|
537 |
|
|
538 |
try: |
# ============= set TRILINOS (but only with MPI) ===================================== |
539 |
includes = env['umf_path'] |
if useMPI: |
540 |
env.Append(CPPPATH = [includes,]) |
try: |
541 |
except KeyError: |
includes = env['trilinos_path'] |
542 |
pass |
env.Append(CPPPATH = [includes,]) |
543 |
|
except KeyError: |
544 |
|
pass |
545 |
|
|
546 |
try: |
try: |
547 |
lib_path = env['umf_lib_path'] |
lib_path = env['trilinos_lib_path'] |
548 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
549 |
except KeyError: |
except KeyError: |
550 |
pass |
pass |
551 |
|
|
552 |
if useMPI: |
try: |
553 |
umf_libs = [] |
trilinos_libs = env['trilinos_libs'] |
554 |
|
except KeyError: |
555 |
|
trilinos_libs = [] |
556 |
else: |
else: |
557 |
|
trilinos_libs = [] |
558 |
|
|
559 |
|
|
560 |
|
# ============= set umfpack (but only without MPI) ===================================== |
561 |
|
umf_libs=[ ] |
562 |
|
if not useMPI: |
563 |
|
try: |
564 |
|
includes = env['umf_path'] |
565 |
|
env.Append(CPPPATH = [includes,]) |
566 |
|
except KeyError: |
567 |
|
pass |
568 |
|
|
569 |
|
try: |
570 |
|
lib_path = env['umf_lib_path'] |
571 |
|
env.Append(LIBPATH = [lib_path,]) |
572 |
|
except KeyError: |
573 |
|
pass |
574 |
|
|
575 |
try: |
try: |
576 |
umf_libs = env['umf_libs'] |
umf_libs = env['umf_libs'] |
577 |
|
umf_libs+=umf_libs |
578 |
except KeyError: |
except KeyError: |
579 |
umf_libs = [] |
pass |
580 |
|
|
581 |
try: |
try: |
582 |
includes = env['ufc_path'] |
includes = env['ufc_path'] |
583 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
584 |
except KeyError: |
except KeyError: |
585 |
pass |
pass |
586 |
|
|
587 |
try: |
try: |
588 |
includes = env['amd_path'] |
includes = env['amd_path'] |
589 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
590 |
except KeyError: |
except KeyError: |
591 |
pass |
pass |
592 |
|
|
593 |
try: |
try: |
594 |
lib_path = env['amd_lib_path'] |
lib_path = env['amd_lib_path'] |
595 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
596 |
except KeyError: |
except KeyError: |
597 |
pass |
pass |
598 |
|
|
|
if useMPI: |
|
|
amd_libs = [] |
|
|
else: |
|
599 |
try: |
try: |
600 |
amd_libs = env['amd_libs'] |
amd_libs = env['amd_libs'] |
601 |
|
umf_libs+=amd_libs |
602 |
except KeyError: |
except KeyError: |
603 |
amd_libs = [] |
pass |
604 |
|
|
605 |
|
# ============= set TRILINOS (but only with MPI) ===================================== |
606 |
|
if useMPI: |
607 |
|
try: |
608 |
|
includes = env['trilinos_path'] |
609 |
|
env.Append(CPPPATH = [includes,]) |
610 |
|
except KeyError: |
611 |
|
pass |
612 |
|
|
613 |
|
try: |
614 |
|
lib_path = env['trilinos_lib_path'] |
615 |
|
env.Append(LIBPATH = [lib_path,]) |
616 |
|
except KeyError: |
617 |
|
pass |
618 |
|
|
619 |
|
try: |
620 |
|
trilinos_libs = env['trilinos_libs'] |
621 |
|
except KeyError: |
622 |
|
trilinos_libs = [] |
623 |
|
else: |
624 |
|
trilinos_libs = [] |
625 |
|
|
626 |
|
# ============= set blas ===================================== |
627 |
try: |
try: |
628 |
includes = env['blas_path'] |
includes = env['blas_path'] |
629 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
639 |
try: |
try: |
640 |
blas_libs = env['blas_libs'] |
blas_libs = env['blas_libs'] |
641 |
except KeyError: |
except KeyError: |
642 |
blas_libs = [] |
blas_libs = [ ] |
643 |
|
|
644 |
|
# ========== netcdf ==================================== |
645 |
try: |
try: |
646 |
useNetCDF = env['useNetCDF'] |
useNetCDF = env['useNetCDF'] |
647 |
except KeyError: |
except KeyError: |
648 |
useNetCDF = 'yes' |
useNetCDF = 'yes' |
649 |
pass |
pass |
650 |
|
|
651 |
if useNetCDF == 'yes': |
if useNetCDF == 'yes': |
652 |
try: |
try: |
653 |
netCDF_libs = env['netCDF_libs'] |
netCDF_libs = env['netCDF_libs'] |
665 |
try: |
try: |
666 |
lib_path = env['netCDF_lib_path'] |
lib_path = env['netCDF_lib_path'] |
667 |
env.Append(LIBPATH = [ lib_path, ]) |
env.Append(LIBPATH = [ lib_path, ]) |
668 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
669 |
if IS_WINDOWS_PLATFORM : |
if IS_WINDOWS_PLATFORM : |
670 |
env.PrependENVPath('PATH', lib_path) |
env.PrependENVPath('PATH', lib_path) |
671 |
except KeyError: |
except KeyError: |
674 |
print "Warning: Installation is not configured with netCDF. Some I/O function may not be available." |
print "Warning: Installation is not configured with netCDF. Some I/O function may not be available." |
675 |
netCDF_libs=[ ] |
netCDF_libs=[ ] |
676 |
|
|
677 |
|
# ====================== boost ====================================== |
678 |
try: |
try: |
679 |
includes = env['boost_path'] |
includes = env['boost_path'] |
680 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
683 |
try: |
try: |
684 |
lib_path = env['boost_lib_path'] |
lib_path = env['boost_lib_path'] |
685 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
686 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
687 |
if IS_WINDOWS_PLATFORM : |
if IS_WINDOWS_PLATFORM : |
688 |
env.PrependENVPath('PATH', lib_path) |
env.PrependENVPath('PATH', lib_path) |
689 |
except KeyError: |
except KeyError: |
692 |
boost_lib = env['boost_lib'] |
boost_lib = env['boost_lib'] |
693 |
except KeyError: |
except KeyError: |
694 |
boost_lib = None |
boost_lib = None |
695 |
|
# ====================== python ====================================== |
696 |
try: |
try: |
697 |
includes = env['python_path'] |
includes = env['python_path'] |
698 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
700 |
pass |
pass |
701 |
try: |
try: |
702 |
lib_path = env['python_lib_path'] |
lib_path = env['python_lib_path'] |
703 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
704 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
705 |
except KeyError: |
except KeyError: |
706 |
pass |
pass |
708 |
python_lib = env['python_lib'] |
python_lib = env['python_lib'] |
709 |
except KeyError: |
except KeyError: |
710 |
python_lib = None |
python_lib = None |
711 |
|
# =============== documentation ======================================= |
712 |
try: |
try: |
713 |
doxygen_path = env['doxygen_path'] |
doxygen_path = env['doxygen_path'] |
714 |
except KeyError: |
except KeyError: |
717 |
epydoc_path = env['epydoc_path'] |
epydoc_path = env['epydoc_path'] |
718 |
except KeyError: |
except KeyError: |
719 |
epydoc_path = None |
epydoc_path = None |
720 |
|
# =============== PAPI ======================================= |
721 |
|
try: |
722 |
|
includes = env['papi_path'] |
723 |
|
env.Append(CPPPATH = [includes,]) |
724 |
|
except KeyError: |
725 |
|
pass |
726 |
|
try: |
727 |
|
lib_path = env['papi_lib_path'] |
728 |
|
env.Append(LIBPATH = [lib_path,]) |
729 |
|
except KeyError: |
730 |
|
pass |
731 |
|
try: |
732 |
|
papi_libs = env['papi_libs'] |
733 |
|
except KeyError: |
734 |
|
papi_libs = None |
735 |
|
# ============= set mpi ===================================== |
736 |
|
if useMPI: |
737 |
|
env.Append(CPPDEFINES=['PASO_MPI',]) |
738 |
|
try: |
739 |
|
includes = env['mpi_path'] |
740 |
|
env.Append(CPPPATH = [includes,]) |
741 |
|
except KeyError: |
742 |
|
pass |
743 |
|
try: |
744 |
|
lib_path = env['mpi_lib_path'] |
745 |
|
env.Append(LIBPATH = [lib_path,]) |
746 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
747 |
|
except KeyError: |
748 |
|
pass |
749 |
|
try: |
750 |
|
mpi_libs = env['mpi_libs'] |
751 |
|
except KeyError: |
752 |
|
mpi_libs = [] |
753 |
|
|
754 |
|
try: |
755 |
|
mpi_run = env['mpi_run'] |
756 |
|
except KeyError: |
757 |
|
mpi_run = '' |
758 |
|
|
759 |
|
try: |
760 |
|
mpich_ignore_cxx_seek=env['MPICH_IGNORE_CXX_SEEK'] |
761 |
|
env.Append(CPPDEFINES = [ mpich_ignore_cxx_seek ] ) |
762 |
|
except KeyError: |
763 |
|
pass |
764 |
|
else: |
765 |
|
mpi_libs=[] |
766 |
|
mpi_run = mpi_run_default |
767 |
|
# =========== zip files =========================================== |
768 |
try: |
try: |
769 |
includes = env['papi_path'] |
includes = env['papi_path'] |
770 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
779 |
papi_libs = env['papi_libs'] |
papi_libs = env['papi_libs'] |
780 |
except KeyError: |
except KeyError: |
781 |
papi_libs = None |
papi_libs = None |
782 |
|
try: |
783 |
|
papi_instrument_solver = env['papi_instrument_solver'] |
784 |
|
except KeyError: |
785 |
|
papi_instrument_solver = None |
786 |
|
|
787 |
|
|
788 |
|
# ============= and some helpers ===================================== |
789 |
|
try: |
790 |
|
doxygen_path = env['doxygen_path'] |
791 |
|
except KeyError: |
792 |
|
doxygen_path = None |
793 |
|
try: |
794 |
|
epydoc_path = env['epydoc_path'] |
795 |
|
except KeyError: |
796 |
|
epydoc_path = None |
797 |
try: |
try: |
798 |
src_zipfile = env.File(env['src_zipfile']) |
src_zipfile = env.File(env['src_zipfile']) |
799 |
except KeyError: |
except KeyError: |
841 |
api_doxygen = None |
api_doxygen = None |
842 |
|
|
843 |
try: |
try: |
844 |
svn_pipe = os.popen("svnversion -n") |
svn_pipe = os.popen("svnversion -n .") |
845 |
global_revision = svn_pipe.readlines() |
global_revision = svn_pipe.readlines() |
846 |
svn_pipe.close() |
svn_pipe.close() |
847 |
|
global_revision = re.sub(":.*", "", global_revision[0]) |
848 |
global_revision = re.sub("[^0-9]", "", global_revision) |
global_revision = re.sub("[^0-9]", "", global_revision) |
849 |
except: |
except: |
850 |
global_revision = "0" |
global_revision="-1" |
851 |
env.Append(CPPDEFINES = "SVN_VERSION="+global_revision[0]) |
print "Warning: unable to recover global revsion number." |
852 |
|
if global_revision == "": global_revision="0" |
853 |
|
print "Revision number is %s."%global_revision |
854 |
|
env.Append(CPPDEFINES = "SVN_VERSION="+global_revision) |
855 |
|
|
856 |
# Python install - esys __init__.py |
# Python install - esys __init__.py |
857 |
init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET')) |
init_target = env.Command(pyinstall+'/__init__.py', None, Touch('$TARGET')) |
883 |
|
|
884 |
|
|
885 |
# Allow sconscripts to see the env |
# Allow sconscripts to see the env |
886 |
Export(["env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug", |
Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "blas_libs", "netCDF_libs", "useNetCDF", "mpi_run", |
|
"mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", |
|
|
"netCDF_libs", |
|
887 |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
888 |
"sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", |
"sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile", "trilinos_libs", "mpi_libs", "papi_instrument_solver", |
889 |
"src_tarfile", "examples_tarfile", "examples_zipfile", |
"guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ]) |
|
"guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" |
|
|
]) |
|
890 |
|
|
891 |
# End initialisation section |
# End initialisation section |
892 |
# Begin configuration section |
# Begin configuration section |
893 |
# adds this file and the scons option directore to the source tar |
# adds this file and the scons option directore to the source tar |
894 |
release_srcfiles=[env.File('SConstruct'),]+[ env.File(x) for x in glob.glob('scons/*.py') ] |
release_srcfiles=[env.File('SConstruct'),env.Dir('lib'),env.Dir('include'),]+[ env.File(x) for x in glob.glob('scons/*.py') ] |
895 |
release_testfiles=[env.File('README_TESTS'),] |
release_testfiles=[env.File('README_TESTS'),] |
896 |
env.Zip(src_zipfile, release_srcfiles) |
env.Zip(src_zipfile, release_srcfiles) |
897 |
env.Zip(test_zipfile, release_testfiles) |
env.Zip(test_zipfile, release_testfiles) |
916 |
env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0) |
env.SConscript(dirs = ['doc'], build_dir='build/$PLATFORM/doc', duplicate=0) |
917 |
env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) |
env.SConscript(dirs = ['pyvisi/py_src'], build_dir='build/$PLATFORM/pyvisi', duplicate=0) |
918 |
env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0) |
env.SConscript(dirs = ['pycad/py_src'], build_dir='build/$PLATFORM/pycad', duplicate=0) |
|
|
|
|
# added by Ben Cumming |
|
919 |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
920 |
#env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |
#env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |
921 |
|
|