1 |
# Copyright 2006 by ACcESS MNRF |
# Copyright 2006 by ACcESS MNRF |
2 |
# |
# |
3 |
# http://www.access.edu.au |
# http://www.access.edu.au |
4 |
# Primary Business: Queensland, Australia |
# Primary Business: Queensland, Australia |
62 |
else: |
else: |
63 |
hostname+="_" |
hostname+="_" |
64 |
options_file = "scons/"+hostname+"_options.py" |
options_file = "scons/"+hostname+"_options.py" |
65 |
|
print "option file is ",options_file |
66 |
|
|
67 |
opts = Options(options_file, ARGUMENTS) |
opts = Options(options_file, ARGUMENTS) |
68 |
opts.AddOptions( |
opts.AddOptions( |
117 |
PathOption('blas_lib_path', 'Path to BLAS libs', None), |
PathOption('blas_lib_path', 'Path to BLAS libs', None), |
118 |
('blas_libs', 'BLAS libraries to link with', None), |
('blas_libs', 'BLAS libraries to link with', None), |
119 |
# netCDF |
# netCDF |
120 |
|
('useNetCDF', 'switch on/off the usage of netCDF', 'yes'), |
121 |
PathOption('netCDF_path', 'Path to netCDF includes', '/usr/local/include'), |
PathOption('netCDF_path', 'Path to netCDF includes', '/usr/local/include'), |
122 |
PathOption('netCDF_lib_path', 'Path to netCDF libs', '/usr/local/lib'), |
PathOption('netCDF_lib_path', 'Path to netCDF libs', '/usr/local/lib'), |
123 |
('netCDF_libs_cxx', 'netCDF C++ libraries to link with', [ 'netcdf_c++', 'netcdf'] ), |
('netCDF_libs_cxx', 'netCDF C++ libraries to link with', [ 'netcdf_c++', 'netcdf'] ), |
140 |
# MPI |
# MPI |
141 |
BoolOption('useMPI', 'Compile parallel version using MPI', 'no'), |
BoolOption('useMPI', 'Compile parallel version using MPI', 'no'), |
142 |
) |
) |
|
|
|
|
# Initialise Scons Build Environment |
|
|
# check for user environment variables we are interested in |
|
|
try: |
|
|
python_path = os.environ['PYTHONPATH'] |
|
|
except KeyError: |
|
|
python_path = '' |
|
|
try: |
|
|
path = os.environ['PATH'] |
|
|
except KeyError: |
|
|
path = '' |
|
|
try: |
|
|
ld_library_path = os.environ['LD_LIBRARY_PATH'] |
|
|
except KeyError: |
|
|
ld_library_path = '' |
|
|
|
|
143 |
# Note: On the Altix the intel compilers are not automatically |
# Note: On the Altix the intel compilers are not automatically |
144 |
# detected by scons intelc.py script. The Altix has a different directory |
# detected by scons intelc.py script. The Altix has a different directory |
145 |
# path and in some locations the "modules" facility is used to support |
# path and in some locations the "modules" facility is used to support |
150 |
|
|
151 |
if os.name != "nt" and os.uname()[4]=='ia64': |
if os.name != "nt" and os.uname()[4]=='ia64': |
152 |
env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts) |
env = Environment(ENV = {'PATH':path}, tools = ['default', 'intelc'], options = opts) |
|
env['ENV']['PATH'] = path |
|
|
env['ENV']['LD_LIBRARY_PATH'] = ld_library_path |
|
|
env['ENV']['PYTHONPATH'] = python_path |
|
153 |
if env['CXX'] == 'icpc': |
if env['CXX'] == 'icpc': |
154 |
env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py |
env['LINK'] = env['CXX'] # version >=9 of intel c++ compiler requires use of icpc to link in C++ runtimes (icc does not). FIXME: this behaviour could be directly incorporated into scons intelc.py |
155 |
elif os.name == "nt": |
elif os.name == "nt": |
156 |
env = Environment(tools = ['default', 'intelc'], options = opts) |
env = Environment(tools = ['default', 'intelc'], options = opts) |
|
env['ENV']['PYTHONPATH'] = python_path |
|
157 |
else: |
else: |
158 |
env = Environment(tools = ['default'], options = opts) |
env = Environment(tools = ['default'], options = opts) |
159 |
|
# Initialise Scons Build Environment |
160 |
|
# check for user environment variables we are interested in |
161 |
|
try: |
162 |
|
python_path = os.environ['PYTHONPATH'] |
163 |
|
env['ENV']['PYTHONPATH'] = python_path |
164 |
|
except KeyError: |
165 |
|
python_path = '' |
166 |
|
|
167 |
|
try: |
168 |
|
path = os.environ['PATH'] |
169 |
env['ENV']['PATH'] = path |
env['ENV']['PATH'] = path |
170 |
|
except KeyError: |
171 |
|
path = '' |
172 |
|
try: |
173 |
|
ld_library_path = os.environ['LD_LIBRARY_PATH'] |
174 |
env['ENV']['LD_LIBRARY_PATH'] = ld_library_path |
env['ENV']['LD_LIBRARY_PATH'] = ld_library_path |
175 |
env['ENV']['PYTHONPATH'] = python_path |
except KeyError: |
176 |
|
ld_library_path = '' |
177 |
|
|
178 |
|
|
179 |
# Setup help for options |
# Setup help for options |
180 |
Help(opts.GenerateHelpText(env)) |
Help(opts.GenerateHelpText(env)) |
406 |
blas_libs = '' |
blas_libs = '' |
407 |
|
|
408 |
try: |
try: |
409 |
includes = env['netCDF_path'] |
useNetCDF = env['useNetCDF'] |
|
env.Append(CPPPATH = [includes,]) |
|
410 |
except KeyError: |
except KeyError: |
411 |
|
useNetCDF = 'yes' |
412 |
pass |
pass |
413 |
|
|
414 |
try: |
if not useNetCDF == 'yes': |
415 |
lib_path = env['netCDF_lib_path'] |
print "Warning: Installation is not configured with netCDF. Some I/O function may not be available." |
416 |
env.Append(LIBPATH = [lib_path,]) |
|
417 |
except KeyError: |
if useNetCDF == 'yes': |
418 |
pass |
try: |
419 |
|
includes = env['netCDF_path'] |
420 |
|
env.Append(CPPPATH = [includes,]) |
421 |
|
except KeyError: |
422 |
|
pass |
423 |
|
|
424 |
try: |
try: |
425 |
netCDF_libs_cxx = env['netCDF_libs_cxx'] |
lib_path = env['netCDF_lib_path'] |
426 |
except KeyError: |
env.Append(LIBPATH = [lib_path,]) |
427 |
netCDF_lib_cxx = [ ] |
except KeyError: |
428 |
|
pass |
429 |
|
|
430 |
|
try: |
431 |
|
netCDF_libs_cxx = env['netCDF_libs_cxx'] |
432 |
|
except KeyError: |
433 |
|
netCDF_libs_cxx = [ ] |
434 |
|
else: |
435 |
|
netCDF_libs_cxx=[ ] |
436 |
|
|
437 |
try: |
try: |
438 |
includes = env['boost_path'] |
includes = env['boost_path'] |
551 |
env.Alias(init_target) |
env.Alias(init_target) |
552 |
|
|
553 |
# Allow sconscripts to see the env |
# Allow sconscripts to see the env |
554 |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs_cxx", |
Export(["env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs_cxx", "useNetCDF", |
555 |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
556 |
"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", |
557 |
"guide_pdf", "guide_html_index", "api_epydoc", "useMPI"]) |
"guide_pdf", "guide_html_index", "api_epydoc", "useMPI"]) |