12 |
EnsureSConsVersion(0,96,91) |
EnsureSConsVersion(0,96,91) |
13 |
EnsurePythonVersion(2,3) |
EnsurePythonVersion(2,3) |
14 |
|
|
15 |
|
|
16 |
#=============================================================== |
#=============================================================== |
17 |
# import tools: |
# import tools: |
18 |
import glob |
import glob |
21 |
if sys.path.count('scons')==0: sys.path.append('scons') |
if sys.path.count('scons')==0: sys.path.append('scons') |
22 |
import scons_extensions |
import scons_extensions |
23 |
|
|
24 |
|
# We may also need to know where python's site-packages subdirectory lives |
25 |
|
python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
26 |
|
|
27 |
#=============================================================== |
#=============================================================== |
28 |
|
|
29 |
tools_prefix="/usr" |
tools_prefix="/usr" |
32 |
# |
# |
33 |
# get the installation prefix |
# get the installation prefix |
34 |
# |
# |
35 |
prefix = ARGUMENTS.get('prefix', '/usr') |
prefix = ARGUMENTS.get('prefix', sys.prefix ) |
36 |
|
|
37 |
# 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 |
38 |
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]) |
|
|
|
39 |
# 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 |
40 |
if os.path.isdir( prefix+"/lib64/"+python_version+"/site-packages"): |
if os.path.isdir( prefix+"/lib64/"+python_version+"/site-packages"): |
41 |
sys_dir_packages = prefix+"/lib64/"+python_version+"/site-packages/esys" |
sys_dir_packages = prefix+"/lib64/"+python_version+"/site-packages/esys" |
304 |
if env['bounds_check']: |
if env['bounds_check']: |
305 |
env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ]) |
env.Append(CPPDEFINES = [ 'BOUNDS_CHECK' ]) |
306 |
env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ]) |
env.Append(CXXDEFINES = [ 'BOUNDS_CHECK' ]) |
307 |
|
bounds_check = env['bounds_check'] |
308 |
|
else: |
309 |
|
bounds_check = 0 |
310 |
|
|
311 |
#================================================================================================= |
#================================================================================================= |
312 |
# |
# |
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 |
453 |
useMPI = None |
useMPI = None |
454 |
# ========= set compiler flags =========================================== |
# ========= set compiler flags =========================================== |
455 |
|
|
456 |
|
# Can't use MPI and OpenMP simultaneously at this time |
457 |
|
if useMPI: |
458 |
|
omp_flags='' |
459 |
|
omp_flags_debug='' |
460 |
|
|
461 |
if dodebug: |
if dodebug: |
462 |
try: |
try: |
463 |
flags = env['cc_flags_debug'] + ' ' + omp_flags_debug |
flags = env['cc_flags_debug'] + ' ' + omp_flags_debug |
487 |
except: |
except: |
488 |
pass |
pass |
489 |
|
|
490 |
|
# ============= Remember what options were used in the compile ===================================== |
491 |
|
if not IS_WINDOWS_PLATFORM: |
492 |
|
env.Execute("/bin/rm -f " + libinstall + "/Compiled.with.*") |
493 |
|
if dodebug: env.Execute("touch " + libinstall + "/Compiled.with.debug") |
494 |
|
if useMPI: env.Execute("touch " + libinstall + "/Compiled.with.mpi") |
495 |
|
if omp_flags != '': env.Execute("touch " + libinstall + "/Compiled.with.OpenMP") |
496 |
|
if bounds_check: env.Execute("touch " + libinstall + "/Compiled.with.bounds_check") |
497 |
|
|
498 |
# ============= set mkl (but only of no MPI) ===================================== |
# ============= set mkl (but only of no MPI) ===================================== |
499 |
if not useMPI: |
if not useMPI: |
500 |
try: |
try: |
506 |
try: |
try: |
507 |
lib_path = env['mkl_lib_path'] |
lib_path = env['mkl_lib_path'] |
508 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
509 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
510 |
except KeyError: |
except KeyError: |
511 |
pass |
pass |
512 |
|
|
528 |
try: |
try: |
529 |
lib_path = env['scsl_lib_path'] |
lib_path = env['scsl_lib_path'] |
530 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
531 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
532 |
except KeyError: |
except KeyError: |
533 |
pass |
pass |
534 |
|
|
646 |
except KeyError: |
except KeyError: |
647 |
blas_libs = [ ] |
blas_libs = [ ] |
648 |
|
|
649 |
# ========== netcdf (currently not supported with mpi) ==================================== |
# ========== netcdf ==================================== |
650 |
if useMPI: |
try: |
651 |
useNetCDF = 'no' |
useNetCDF = env['useNetCDF'] |
652 |
else: |
except KeyError: |
653 |
try: |
useNetCDF = 'yes' |
654 |
useNetCDF = env['useNetCDF'] |
pass |
|
except KeyError: |
|
|
useNetCDF = 'yes' |
|
|
pass |
|
655 |
|
|
656 |
if useNetCDF == 'yes': |
if useNetCDF == 'yes': |
657 |
try: |
try: |
670 |
try: |
try: |
671 |
lib_path = env['netCDF_lib_path'] |
lib_path = env['netCDF_lib_path'] |
672 |
env.Append(LIBPATH = [ lib_path, ]) |
env.Append(LIBPATH = [ lib_path, ]) |
673 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
674 |
if IS_WINDOWS_PLATFORM : |
if IS_WINDOWS_PLATFORM : |
675 |
env.PrependENVPath('PATH', lib_path) |
env.PrependENVPath('PATH', lib_path) |
676 |
except KeyError: |
except KeyError: |
688 |
try: |
try: |
689 |
lib_path = env['boost_lib_path'] |
lib_path = env['boost_lib_path'] |
690 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
691 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
692 |
if IS_WINDOWS_PLATFORM : |
if IS_WINDOWS_PLATFORM : |
693 |
env.PrependENVPath('PATH', lib_path) |
env.PrependENVPath('PATH', lib_path) |
694 |
except KeyError: |
except KeyError: |
705 |
pass |
pass |
706 |
try: |
try: |
707 |
lib_path = env['python_lib_path'] |
lib_path = env['python_lib_path'] |
708 |
|
env['ENV']['LD_LIBRARY_PATH']+=":"+lib_path |
709 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
710 |
except KeyError: |
except KeyError: |
711 |
pass |
pass |
845 |
except KeyError: |
except KeyError: |
846 |
api_doxygen = None |
api_doxygen = None |
847 |
|
|
848 |
|
global_revision="$Rev$" |
849 |
try: |
try: |
850 |
svn_pipe = os.popen("svnversion -n .") |
svn_pipe = os.popen("svnversion -n .") |
851 |
global_revision = svn_pipe.readlines() |
global_revision = svn_pipe.readlines() |
852 |
svn_pipe.close() |
svn_pipe.close() |
|
global_revision = re.sub("[^0-9]", "", global_revision[0]) |
|
853 |
except: |
except: |
854 |
global_revision = "0" |
print "Extracting revision number failed. Using %s instead."%global_revision |
855 |
|
global_revision = re.sub(":.*", "", global_revision[0]) |
856 |
|
global_revision = re.sub("[^0-9]", "", global_revision) |
857 |
env.Append(CPPDEFINES = "SVN_VERSION="+global_revision) |
env.Append(CPPDEFINES = "SVN_VERSION="+global_revision) |
858 |
|
|
859 |
# Python install - esys __init__.py |
# Python install - esys __init__.py |
894 |
# End initialisation section |
# End initialisation section |
895 |
# Begin configuration section |
# Begin configuration section |
896 |
# adds this file and the scons option directore to the source tar |
# adds this file and the scons option directore to the source tar |
897 |
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') ] |
898 |
release_testfiles=[env.File('README_TESTS'),] |
release_testfiles=[env.File('README_TESTS'),] |
899 |
env.Zip(src_zipfile, release_srcfiles) |
env.Zip(src_zipfile, release_srcfiles) |
900 |
env.Zip(test_zipfile, release_testfiles) |
env.Zip(test_zipfile, release_testfiles) |