22 |
if sys.path.count('scons')==0: sys.path.append('scons') |
if sys.path.count('scons')==0: sys.path.append('scons') |
23 |
import scons_extensions |
import scons_extensions |
24 |
|
|
25 |
|
# check if UMFPACK is installed on the system: |
26 |
|
if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'): |
27 |
|
umf_path_default='/opt/UMFPACK/Include' |
28 |
|
umf_lib_path_default='/opt/UMFPACK/Lib' |
29 |
|
umf_libs_default=['umfpack'] |
30 |
|
else: |
31 |
|
umf_path_default=None |
32 |
|
umf_lib_path_default=None |
33 |
|
umf_libs_default=None |
34 |
|
|
35 |
|
if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'): |
36 |
|
amd_path_default='/opt/AMD/Include' |
37 |
|
amd_lib_path_default='/opt/AMD/Lib' |
38 |
|
amd_libs_default=['amd'] |
39 |
|
else: |
40 |
|
amd_path_default=None |
41 |
|
amd_lib_path_default=None |
42 |
|
amd_libs_default=None |
43 |
|
|
44 |
|
if os.path.isdir('/opt/UFconfig'): |
45 |
|
ufc_path_default='/opt/UFconfig' |
46 |
|
else: |
47 |
|
ufc_path_default=None |
48 |
|
|
49 |
# Default options and options help text |
# Default options and options help text |
50 |
# 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. |
51 |
# if the options_file or ARGUMENTS do not exist then the ones listed as default here are used |
# if the options_file or ARGUMENTS do not exist then the ones listed as default here are used |
103 |
('scsl_libs', 'SCSL libraries to link with', None), |
('scsl_libs', 'SCSL libraries to link with', None), |
104 |
('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None), |
('scsl_libs_MPI', 'SCSL libraries to link with for MPI build', None), |
105 |
# UMFPACK |
# UMFPACK |
106 |
PathOption('umf_path', 'Path to UMF includes', None), |
PathOption('ufc_path', 'Path to UFconfig includes', ufc_path_default), |
107 |
PathOption('umf_lib_path', 'Path to UMF libs', None), |
PathOption('umf_path', 'Path to UMFPACK includes', umf_path_default), |
108 |
('umf_libs', 'UMF libraries to link with', None), |
PathOption('umf_lib_path', 'Path to UMFPACK libs', umf_lib_path_default), |
109 |
|
('umf_libs', 'UMFPACK libraries to link with', umf_libs_default), |
110 |
|
# AMD (used by UMFPACK) |
111 |
|
PathOption('amd_path', 'Path to AMD includes', amd_path_default), |
112 |
|
PathOption('amd_lib_path', 'Path to AMD libs', amd_lib_path_default), |
113 |
|
('amd_libs', 'AMD libraries to link with', amd_libs_default), |
114 |
|
# BLAS |
115 |
|
PathOption('blas_path', 'Path to BLAS includes', None), |
116 |
|
PathOption('blas_lib_path', 'Path to BLAS libs', None), |
117 |
|
('blas_libs', 'BLAS libraries to link with', None), |
118 |
# Python |
# Python |
119 |
# locations of include files for python |
# locations of include files for python |
120 |
PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])), |
PathOption('python_path', 'Path to Python includes', '/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1])), |
303 |
except KeyError: |
except KeyError: |
304 |
pass |
pass |
305 |
|
|
306 |
try: |
if useMPI: |
|
mkl_libs = env['mkl_libs'] |
|
|
except KeyError: |
|
307 |
mkl_libs = '' |
mkl_libs = '' |
308 |
|
else: |
309 |
|
try: |
310 |
|
mkl_libs = env['mkl_libs'] |
311 |
|
except KeyError: |
312 |
|
mkl_libs = '' |
313 |
|
|
314 |
try: |
try: |
315 |
includes = env['scsl_path'] |
includes = env['scsl_path'] |
316 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
317 |
except KeyError: |
except KeyError: |
318 |
pass |
pass |
319 |
|
|
320 |
try: |
try: |
321 |
lib_path = env['scsl_lib_path'] |
lib_path = env['scsl_lib_path'] |
322 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
323 |
except KeyError: |
except KeyError: |
324 |
pass |
pass |
325 |
|
|
326 |
if useMPI: |
if useMPI: |
327 |
try: |
try: |
328 |
scsl_libs = env['scsl_libs_MPI'] |
scsl_libs = env['scsl_libs_MPI'] |
333 |
scsl_libs = env['scsl_libs'] |
scsl_libs = env['scsl_libs'] |
334 |
except KeyError: |
except KeyError: |
335 |
scsl_libs = '' |
scsl_libs = '' |
336 |
|
|
337 |
try: |
try: |
338 |
includes = env['umf_path'] |
includes = env['umf_path'] |
339 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
340 |
except KeyError: |
except KeyError: |
341 |
pass |
pass |
342 |
|
|
343 |
try: |
try: |
344 |
lib_path = env['umf_lib_path'] |
lib_path = env['umf_lib_path'] |
345 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
346 |
except KeyError: |
except KeyError: |
347 |
pass |
pass |
348 |
|
|
349 |
|
if useMPI: |
350 |
|
umf_libs = '' |
351 |
|
else: |
352 |
|
try: |
353 |
|
umf_libs = env['umf_libs'] |
354 |
|
except KeyError: |
355 |
|
umf_libs = '' |
356 |
|
|
357 |
|
try: |
358 |
|
includes = env['ufc_path'] |
359 |
|
env.Append(CPPPATH = [includes,]) |
360 |
|
except KeyError: |
361 |
|
pass |
362 |
|
|
363 |
|
try: |
364 |
|
includes = env['amd_path'] |
365 |
|
env.Append(CPPPATH = [includes,]) |
366 |
|
except KeyError: |
367 |
|
pass |
368 |
|
|
369 |
|
try: |
370 |
|
lib_path = env['amd_lib_path'] |
371 |
|
env.Append(LIBPATH = [lib_path,]) |
372 |
|
except KeyError: |
373 |
|
pass |
374 |
|
|
375 |
|
if useMPI: |
376 |
|
amd_libs = '' |
377 |
|
else: |
378 |
|
try: |
379 |
|
amd_libs = env['amd_libs'] |
380 |
|
except KeyError: |
381 |
|
amd_libs = '' |
382 |
|
|
383 |
|
try: |
384 |
|
includes = env['blas_path'] |
385 |
|
env.Append(CPPPATH = [includes,]) |
386 |
|
except KeyError: |
387 |
|
pass |
388 |
|
|
389 |
|
try: |
390 |
|
lib_path = env['blas_lib_path'] |
391 |
|
env.Append(LIBPATH = [lib_path,]) |
392 |
|
except KeyError: |
393 |
|
pass |
394 |
|
|
395 |
try: |
try: |
396 |
umf_libs = env['umf_libs'] |
blas_libs = env['blas_libs'] |
397 |
except KeyError: |
except KeyError: |
398 |
umf_libs = '' |
blas_libs = '' |
399 |
|
|
400 |
try: |
try: |
401 |
includes = env['boost_path'] |
includes = env['boost_path'] |
402 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
513 |
env.Alias(init_target) |
env.Alias(init_target) |
514 |
|
|
515 |
# Allow sconscripts to see the env |
# Allow sconscripts to see the env |
516 |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", |
517 |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
518 |
"sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile", |
"sys_libs", "test_zipfile", "src_zipfile", "test_tarfile", "src_tarfile", "examples_tarfile", "examples_zipfile", |
519 |
"guide_pdf", "guide_html_index", "api_epydoc", "useMPI"]) |
"guide_pdf", "guide_html_index", "api_epydoc", "useMPI"]) |
545 |
|
|
546 |
# added by Ben Cumming |
# added by Ben Cumming |
547 |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
548 |
env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |
#env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |