22 |
import scons_extensions |
import scons_extensions |
23 |
|
|
24 |
#=============================================================== |
#=============================================================== |
|
# check on windows or linux platform |
|
|
# |
|
|
IS_WINDOWS_PLATFORM = (os.name== "nt") |
|
25 |
|
|
26 |
if IS_WINDOWS_PLATFORM: |
tools_prefix="/usr" |
|
tools_prefix="C:\\Program Files\\" |
|
|
else: |
|
|
tools_prefix="/usr/local/" |
|
27 |
|
|
28 |
#============================================================================================== |
#============================================================================================== |
29 |
# |
# |
30 |
# get the iinstallation prefix |
# get the installation prefix |
31 |
# |
# |
32 |
prefix = ARGUMENTS.get('prefix', Dir('#.').abspath) |
prefix = ARGUMENTS.get('prefix', '/usr') |
33 |
|
|
34 |
|
# We may also need to know where python's site-packages subdirectory lives |
35 |
|
python_version = 'python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
36 |
|
|
37 |
|
# Install as a standard python package in /usr/lib64 if available, else in /usr/lib |
38 |
|
if os.path.isdir( prefix+"/lib64/"+python_version+"/site-packages"): |
39 |
|
sys_dir_packages = prefix+"/lib64/"+python_version+"/site-packages/esys" |
40 |
|
sys_dir_libraries = prefix+"/lib64" |
41 |
|
else: |
42 |
|
sys_dir_packages = prefix+"/lib/"+python_version+"/site-packages/esys" |
43 |
|
sys_dir_libraries = prefix+"/lib" |
44 |
|
|
45 |
|
sys_dir_examples = prefix+"/share/doc/esys" |
46 |
|
|
47 |
|
source_root = Dir('#.').abspath |
48 |
|
|
49 |
|
dir_packages = os.path.join(source_root,"esys") |
50 |
|
dir_examples = os.path.join(source_root,"examples") |
51 |
|
dir_libraries = os.path.join(source_root,"lib") |
52 |
|
|
53 |
|
print " Default packages local installation: ", dir_packages |
54 |
|
print " Default library local installation ", dir_libraries |
55 |
|
print " Default example local installation: ", dir_examples |
56 |
print "Install prefix is: ", prefix |
print "Install prefix is: ", prefix |
57 |
|
print " Default packages system installation: ", sys_dir_packages |
58 |
|
print " Default library system installation ", sys_dir_libraries |
59 |
|
print " Default example system installation: ", sys_dir_examples |
60 |
|
|
61 |
|
#============================================================================================== |
62 |
|
|
63 |
# Default options and options help text |
# Default options and options help text |
64 |
# 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. |
91 |
# |
# |
92 |
# check if UMFPACK is installed on the system: |
# check if UMFPACK is installed on the system: |
93 |
# |
# |
94 |
umf_path_default=None |
uf_root=None |
95 |
umf_lib_path_default=None |
for i in [ 'UMFPACK', 'umfpack', 'ufsparse', 'UFSPARSE']: |
96 |
umf_libs_default=None |
if os.path.isdir(os.path.join(tools_prefix,'include',i)): |
97 |
if IS_WINDOWS_PLATFORM: |
uf_root=i |
98 |
pass |
print i," is used form ",tools_prefix |
99 |
else: |
break |
100 |
if os.path.isdir('/opt/UMFPACK/Include') and os.path.isdir('/opt/UMFPACK/Lib'): |
if not uf_root==None: |
101 |
umf_path_default='/opt/UMFPACK/Include' |
umf_path_default=os.path.join(tools_prefix,'include',uf_root) |
102 |
umf_lib_path_default='/opt/UMFPACK/Lib' |
umf_lib_path_default=os.path.join(tools_prefix,'lib') |
103 |
umf_libs_default=['umfpack'] |
umf_libs_default=['umfpack'] |
104 |
|
amd_path_default=os.path.join(tools_prefix,'include',uf_root) |
105 |
amd_path_default=None |
amd_lib_path_default=os.path.join(tools_prefix,'lib') |
106 |
amd_lib_path_default=None |
amd_libs_default=['amd'] |
107 |
amd_libs_default=None |
ufc_path_default=os.path.join(tools_prefix,'include',uf_root) |
108 |
if IS_WINDOWS_PLATFORM: |
else: |
109 |
pass |
umf_path_default=None |
110 |
else: |
umf_lib_path_default=None |
111 |
if os.path.isdir('/opt/AMD/Include') and os.path.isdir('/opt/AMD/Lib'): |
umf_libs_default=None |
112 |
amd_path_default='/opt/AMD/Include' |
amd_path_default=None |
113 |
amd_lib_path_default='/opt/AMD/Lib' |
amd_lib_path_default=None |
114 |
amd_libs_default=['amd'] |
amd_libs_default=None |
115 |
|
ufc_path_default=None |
116 |
ufc_path_default=None |
# |
|
if IS_WINDOWS_PLATFORM: |
|
|
pass |
|
|
else: |
|
|
if os.path.isdir('/opt/UFconfig'): |
|
|
ufc_path_default='/opt/UFconfig' |
|
117 |
#========================================================================== |
#========================================================================== |
118 |
# |
# |
119 |
# python installation: |
# python installation: |
120 |
# |
# |
121 |
if IS_WINDOWS_PLATFORM: |
python_path_default=os.path.join(tools_prefix,'include','python%s.%s'%(sys.version_info[0],sys.version_info[1])) |
122 |
python_path_default='C:\\Program Files\\python%s%s'%(sys.version_info[0],sys.version_info[1])+"\\include" |
python_lib_path_default=os.path.join(tools_prefix,'lib') |
123 |
python_lib_path_default='C:\\Program Files\\python%s%s'%(sys.version_info[0],sys.version_info[1])+"\\libs" |
python_lib_default="python%s.%s"%(sys.version_info[0],sys.version_info[1]) |
124 |
python_libs_default=["python%s%s"%(sys.version_info[0],sys.version_info[1])] |
|
|
else: |
|
|
python_path_default='/usr/include/python%s.%s'%(sys.version_info[0],sys.version_info[1]) |
|
|
python_lib_path_default='/usr/lib' |
|
|
python_libs_default=["python%s.%s"%(sys.version_info[0],sys.version_info[1])] |
|
125 |
#========================================================================== |
#========================================================================== |
126 |
# |
# |
127 |
# boost installation: |
# boost installation: |
128 |
# |
# |
129 |
if IS_WINDOWS_PLATFORM: |
boost_path_default=os.path.join(tools_prefix,'include') |
130 |
boost_libs_path_default='C:\\Program Files\\boost\\lib\\' |
boost_lib_path_default=os.path.join(tools_prefix,'lib') |
131 |
boost_libs_default=None |
boost_lib_default=['boost_python'] |
|
for i in os.listdir(boost_libs_path_default): |
|
|
name=os.path.splitext(i) |
|
|
if name[1] == ".dll" and name[0].startswith("boost_python"): |
|
|
if boost_libs_default == None: |
|
|
boost_libs_default= [ name[0] ] |
|
|
else: |
|
|
if not name[0].find("-gd-"): boost_libs_default=[ name[0] ] |
|
|
boost_path_default='C:\\Program Files\\boost\\include\\boost-%s'%(boost_libs_default[0].split("-")[-1],) |
|
|
else: |
|
|
boost_path_default='/usr/include' |
|
|
boost_libs_path_default='/usr/lib' |
|
|
boost_libs_default=['boost_python'] |
|
132 |
#========================================================================== |
#========================================================================== |
133 |
# |
# |
134 |
# check if netCDF is installed on the system: |
# check if netCDF is installed on the system: |
135 |
# |
# |
136 |
netCDF_path_default=None |
netCDF_path_default=os.path.join(tools_prefix,'include','netcdf-3') |
137 |
netCDF_lib_path_default=None |
netCDF_lib_path_default=os.path.join(tools_prefix,'lib','netcdf-3') |
138 |
netCDF_libs_default=None |
|
139 |
useNetCDF_default='no' |
if os.path.isdir(netCDF_path_default) and os.path.isdir(netCDF_lib_path_default): |
140 |
netcdf_dir=os.path.join(tools_prefix,'netcdf') |
useNetCDF_default='yes' |
141 |
if os.path.isdir(os.path.join(netcdf_dir,'include')) and os.path.isdir(os.path.join(netcdf_dir,'lib')): |
netCDF_libs_default=[ 'netcdf_c++', 'netcdf' ] |
142 |
netCDF_path_default=os.path.join(netcdf_dir,'include') |
else: |
143 |
netCDF_lib_path_default=os.path.join(netcdf_dir,'lib') |
useNetCDF_default='no' |
144 |
netCDF_libs_default=['netcdf_cpp', 'netcdf' ] |
netCDF_path_default=None |
145 |
if IS_WINDOWS_PLATFORM: |
netCDF_lib_path_default=None |
146 |
useNetCDF_default='no' # be default netcdf is not supported on windows. |
netCDF_libs_default=None |
147 |
else: |
|
|
useNetCDF_default='yes' |
|
148 |
#========================================================================== |
#========================================================================== |
149 |
# |
# |
150 |
# compile: |
# compile: |
151 |
# |
# |
152 |
if IS_WINDOWS_PLATFORM: |
cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
153 |
# cc_flags_default = '/GR /EHsc /MD /Qc99 /Qopenmp /Qopenmp-report1 /O3 /G7 /Qprec /Qpar-report1 /QxP /QaxP' |
cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
154 |
# cc_flags_debug_default = '/Od /MDd /RTC1 /GR /EHsc /Qc99 /Qopenmp /Qopenmp-report1 /Qprec' |
cxx_flags_default='--no-warn -ansi' |
155 |
cc_flags_default = '/nologo /EHsc /GR /wd4068 /O2 /Op /MT /W3 /Ob0 /Z7' |
cxx_flags_debug_default='--no-warn -ansi -DDOASSERT' |
|
cc_flags_debug_default ='/nologo /EHsc /GR /wd4068 /Od /RTC1 /MTd /ZI /Ob0 /Z7' |
|
|
|
|
|
cc_flags_default = '/nologo /EHsc /GR /O2 /MT /W3 /Ob0 /Z7 /wd4068' |
|
|
cc_flags_debug_default ='/nologo /EHsc /GR /Od /RTC1 /MTd /W3 /Ob0 /Z7/wd4068' |
|
|
cxx_flags_default = '' |
|
|
cxx_flags_debug_default = '' |
|
|
cc_common_flags = '/FD /EHsc /GR /wd4068 ' |
|
|
else: |
|
|
cc_flags_default='-O3 -std=c99 -ffast-math -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
|
|
cc_flags_debug_default='-g -O0 -ffast-math -std=c99 -fpic -Wno-unknown-pragmas -ansi -pedantic-errors' |
|
|
cxx_flags_default='--no-warn -ansi' |
|
|
cxx_flags_debug_default='--no-warn -ansi -DDOASSERT' |
|
156 |
#============================================================================================== |
#============================================================================================== |
157 |
# Default options and options help text |
# Default options and options help text |
158 |
# 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. |
160 |
# DO NOT CHANGE THEM HERE |
# DO NOT CHANGE THEM HERE |
161 |
opts.AddOptions( |
opts.AddOptions( |
162 |
# Where to install esys stuff |
# Where to install esys stuff |
163 |
('incinstall', 'where the esys headers will be installed', prefix+'/include'), |
('incinstall', 'where the esys headers will be installed', Dir('#.').abspath+'/include'), |
164 |
('libinstall', 'where the esys libraries will be installed', prefix+'/lib'), |
('libinstall', 'where the esys libraries will be installed', dir_libraries), |
165 |
('pyinstall', 'where the esys python modules will be installed', prefix), |
('pyinstall', 'where the esys python modules will be installed', dir_packages), |
166 |
('src_zipfile', 'the source zip file will be installed.', prefix+"/release/escript_src.zip"), |
('exinstall', 'where the esys examples will be installed', dir_examples), |
167 |
('test_zipfile', 'the test zip file will be installed.', prefix+"/release/escript_tests.zip"), |
('sys_libinstall', 'where the system esys libraries will be installed', sys_dir_libraries), |
168 |
('src_tarfile', 'the source tar file will be installed.', prefix+"/release/escript_src.tar.gz"), |
('sys_pyinstall', 'where the system esys python modules will be installed', sys_dir_packages), |
169 |
('test_tarfile', 'the test tar file will be installed.', prefix+"/release/escript_tests.tar.gz"), |
('sys_exinstall', 'where the system esys examples will be installed', sys_dir_examples), |
170 |
('examples_tarfile', 'the examples tar file will be installed.', prefix+"/release/doc/escript_examples.tar.gz"), |
('src_zipfile', 'the source zip file will be installed.', Dir('#.').abspath+"/release/escript_src.zip"), |
171 |
('examples_zipfile', 'the examples zip file will be installed.', prefix+"/release/doc/escript_examples.zip"), |
('test_zipfile', 'the test zip file will be installed.', Dir('#.').abspath+"/release/escript_tests.zip"), |
172 |
('guide_pdf', 'name of the user guide in pdf format', prefix+"/release/doc/user/guide.pdf"), |
('src_tarfile', 'the source tar file will be installed.', Dir('#.').abspath+"/release/escript_src.tar.gz"), |
173 |
('api_epydoc', 'name of the epydoc api docs directory',prefix+"/release/doc/epydoc"), |
('test_tarfile', 'the test tar file will be installed.', Dir('#.').abspath+"/release/escript_tests.tar.gz"), |
174 |
('guide_html', 'name of the directory for user guide in html format', prefix+"/release/doc/user/html"), |
('examples_tarfile', 'the examples tar file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.tar.gz"), |
175 |
|
('examples_zipfile', 'the examples zip file will be installed.', Dir('#.').abspath+"/release/doc/escript_examples.zip"), |
176 |
|
('guide_pdf', 'name of the user guide in pdf format', Dir('#.').abspath+"/release/doc/user/guide.pdf"), |
177 |
|
('api_epydoc', 'name of the epydoc api docs directory', Dir('#.').abspath+"/release/doc/epydoc"), |
178 |
|
('guide_html', 'name of the directory for user guide in html format', Dir('#.').abspath+"/release/doc/user/html"), |
179 |
|
('api_doxygen', 'name of the doxygen api docs directory',prefix+"/release/doc/doxygen"), |
180 |
# Compilation options |
# Compilation options |
181 |
BoolOption('dodebug', 'Do you want a debug build?', 'no'), |
BoolOption('dodebug', 'Do you want a debug build?', 'no'), |
182 |
('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), |
217 |
('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default), |
('netCDF_libs', 'netCDF C++ libraries to link with', netCDF_libs_default), |
218 |
# Python |
# Python |
219 |
# locations of include files for python |
# locations of include files for python |
220 |
|
# FIXME: python_path should be python_inc_path and the same for boost etc. |
221 |
PathOption('python_path', 'Path to Python includes', python_path_default), |
PathOption('python_path', 'Path to Python includes', python_path_default), |
222 |
PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default), |
PathOption('python_lib_path', 'Path to Python libs', python_lib_path_default), |
223 |
('python_libs', 'Python libraries to link with', python_libs_default), |
('python_lib', 'Python libraries to link with', python_lib_default), |
224 |
|
('python_cmd', 'Python command', 'python'), |
225 |
# Boost |
# Boost |
226 |
PathOption('boost_path', 'Path to Boost includes', boost_path_default), |
PathOption('boost_path', 'Path to Boost includes', boost_path_default), |
227 |
PathOption('boost_libs_path', 'Path to Boost libs', boost_libs_path_default), |
PathOption('boost_lib_path', 'Path to Boost libs', boost_lib_path_default), |
228 |
('boost_libs', 'Boost libraries to link with', boost_libs_default), |
('boost_lib', 'Boost libraries to link with', boost_lib_default), |
229 |
# Doc building |
# Doc building |
230 |
# PathOption('doxygen_path', 'Path to Doxygen executable', None), |
# PathOption('doxygen_path', 'Path to Doxygen executable', None), |
231 |
# PathOption('epydoc_path', 'Path to Epydoc executable', None), |
# PathOption('epydoc_path', 'Path to Epydoc executable', None), |
246 |
# This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms) |
# This doesn't impact linux and windows which will use the default compiler (g++ or msvc, or the intel compiler if it is installed on both platforms) |
247 |
# FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix |
# FIXME: Perhaps a modification to intelc.py will allow better support for ia64 on altix |
248 |
# |
# |
249 |
|
IS_WINDOWS_PLATFORM = (os.name== "nt") |
250 |
|
|
251 |
if IS_WINDOWS_PLATFORM: |
if IS_WINDOWS_PLATFORM: |
252 |
env = Environment(tools = ['default', 'msvc'], options = opts) |
env = Environment(tools = ['default', 'msvc'], options = opts) |
253 |
else: |
else: |
258 |
else: |
else: |
259 |
env = Environment(tools = ['default'], options = opts) |
env = Environment(tools = ['default'], options = opts) |
260 |
Help(opts.GenerateHelpText(env)) |
Help(opts.GenerateHelpText(env)) |
261 |
|
|
262 |
#================================================================================================= |
#================================================================================================= |
263 |
# |
# |
264 |
# Initialise Scons Build Environment |
# Initialise Scons Build Environment |
265 |
# check for user environment variables we are interested in |
# check for user environment variables we are interested in |
266 |
try: |
try: |
267 |
python_path = os.environ['PYTHONPATH'] |
tmp = os.environ['PYTHONPATH'] |
268 |
env['ENV']['PYTHONPATH'] = python_path |
env['ENV']['PYTHONPATH'] = tmp |
269 |
|
except KeyError: |
270 |
|
pass |
271 |
|
|
272 |
|
env.PrependENVPath('PYTHONPATH', source_root) |
273 |
|
|
274 |
|
try: |
275 |
|
omp_num_threads = os.environ['OMP_NUM_THREADS'] |
276 |
|
except KeyError: |
277 |
|
omp_num_threads = 1 |
278 |
|
|
279 |
|
env['ENV']['OMP_NUM_THREADS'] = omp_num_threads |
280 |
|
|
281 |
|
try: |
282 |
|
env['ENV']['DISPLAY'] = os.environ['DISPLAY'] |
283 |
|
env['ENV']['XAUTHORITY'] = os.environ['XAUTHORITY'] |
284 |
except KeyError: |
except KeyError: |
285 |
python_path = '' |
pass |
286 |
|
|
287 |
try: |
try: |
288 |
path = os.environ['PATH'] |
tmp = os.environ['PATH'] |
289 |
env['ENV']['PATH'] = path |
env['ENV']['PATH'] = tmp |
290 |
except KeyError: |
except KeyError: |
291 |
path = '' |
pass |
292 |
|
|
293 |
try: |
try: |
294 |
ld_library_path = os.environ['LD_LIBRARY_PATH'] |
tmp = os.environ['LD_LIBRARY_PATH'] |
295 |
env['ENV']['LD_LIBRARY_PATH'] = ld_library_path |
env['ENV']['LD_LIBRARY_PATH'] = tmp |
296 |
except KeyError: |
except KeyError: |
297 |
ld_library_path = '' |
pass |
298 |
#========================================================================== |
#========================================================================== |
299 |
# |
# |
300 |
# Add some customer builders |
# Add some customer builders |
302 |
py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True) |
py_builder = Builder(action = scons_extensions.build_py, suffix = '.pyc', src_suffix = '.py', single_source=True) |
303 |
env.Append(BUILDERS = {'PyCompile' : py_builder}); |
env.Append(BUILDERS = {'PyCompile' : py_builder}); |
304 |
|
|
305 |
|
# FIXME: use the inbuilt scons suffix variable. |
306 |
if IS_WINDOWS_PLATFORM: |
if IS_WINDOWS_PLATFORM: |
307 |
runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True) |
runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', src_suffix='.exe', single_source=True) |
308 |
else: |
else: |
320 |
incinstall = None |
incinstall = None |
321 |
try: |
try: |
322 |
libinstall = env['libinstall'] |
libinstall = env['libinstall'] |
323 |
env.Append(LIBPATH = [libinstall,]) # ksteube adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so |
env.Append(LIBPATH = [libinstall,]) # Adds -L for building of libescript.so libfinley.so escriptcpp.so finleycpp.so |
324 |
env.PrependENVPath('LD_LIBRARY_PATH', libinstall) |
env.PrependENVPath('LD_LIBRARY_PATH', libinstall) |
325 |
if env['PLATFORM'] == "win32": |
if env['PLATFORM'] == "win32": |
326 |
env.PrependENVPath('PATH', libinstall) |
env.PrependENVPath('PATH', libinstall) |
327 |
env.PrependENVPath('PATH', env['boost_libs_path']) |
env.PrependENVPath('PATH', env['boost_lib_path']) |
328 |
except KeyError: |
except KeyError: |
329 |
libinstall = None |
libinstall = None |
330 |
try: |
try: |
331 |
pyinstall = env['pyinstall']+'/esys' # 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 |
|
env.PrependENVPath('PYTHONPATH', env['pyinstall']) |
|
332 |
except KeyError: |
except KeyError: |
333 |
pyinstall = None |
pyinstall = None |
334 |
try: |
try: |
335 |
|
exinstall = env['exinstall'] |
336 |
|
except KeyError: |
337 |
|
exinstall = None |
338 |
|
try: |
339 |
|
sys_libinstall = env['sys_libinstall'] |
340 |
|
except KeyError: |
341 |
|
sys_libinstall = None |
342 |
|
try: |
343 |
|
sys_pyinstall = env['sys_pyinstall'] |
344 |
|
except KeyError: |
345 |
|
sys_pyinstall = None |
346 |
|
try: |
347 |
|
sys_exinstall = env['sys_exinstall'] |
348 |
|
except KeyError: |
349 |
|
sys_exinstall = None |
350 |
|
try: |
351 |
dodebug = env['dodebug'] |
dodebug = env['dodebug'] |
352 |
except KeyError: |
except KeyError: |
353 |
dodebug = None |
dodebug = None |
571 |
except KeyError: |
except KeyError: |
572 |
pass |
pass |
573 |
try: |
try: |
574 |
lib_path = env['boost_libs_path'] |
lib_path = env['boost_lib_path'] |
575 |
env.Append(LIBPATH = [lib_path,]) |
env.Append(LIBPATH = [lib_path,]) |
576 |
except KeyError: |
except KeyError: |
577 |
pass |
pass |
578 |
try: |
try: |
579 |
boost_libs = env['boost_libs'] |
boost_lib = env['boost_lib'] |
580 |
except KeyError: |
except KeyError: |
581 |
boost_libs = None |
boost_lib = None |
582 |
try: |
try: |
583 |
includes = env['python_path'] |
includes = env['python_path'] |
584 |
env.Append(CPPPATH = [includes,]) |
env.Append(CPPPATH = [includes,]) |
590 |
except KeyError: |
except KeyError: |
591 |
pass |
pass |
592 |
try: |
try: |
593 |
python_libs = env['python_libs'] |
python_lib = env['python_lib'] |
594 |
except KeyError: |
except KeyError: |
595 |
python_libs = None |
python_lib = None |
596 |
try: |
try: |
597 |
doxygen_path = env['doxygen_path'] |
doxygen_path = env['doxygen_path'] |
598 |
except KeyError: |
except KeyError: |
658 |
except KeyError: |
except KeyError: |
659 |
api_epydoc = None |
api_epydoc = None |
660 |
|
|
661 |
|
try: |
662 |
|
api_doxygen = env.Dir(env['api_doxygen']) |
663 |
|
except KeyError: |
664 |
|
api_doxygen = None |
665 |
|
|
666 |
|
|
667 |
|
# FIXME: exinstall and friends related to examples are not working. |
668 |
|
build_target = env.Alias('build',[libinstall,incinstall,pyinstall]) |
669 |
|
|
670 |
|
env.Default(build_target) |
671 |
|
|
672 |
# Zipgets |
# Zipgets |
|
env.Default(libinstall) |
|
|
env.Default(incinstall) |
|
|
env.Default(pyinstall) |
|
673 |
env.Alias('release_src',[ src_zipfile, src_tarfile ]) |
env.Alias('release_src',[ src_zipfile, src_tarfile ]) |
674 |
env.Alias('release_tests',[ test_zipfile, test_tarfile]) |
env.Alias('release_tests',[ test_zipfile, test_tarfile]) |
675 |
env.Alias('release_examples',[ examples_zipfile, examples_tarfile]) |
env.Alias('release_examples',[ examples_zipfile, examples_tarfile]) |
676 |
|
env.Alias('examples_zipfile',examples_zipfile) |
677 |
|
env.Alias('examples_tarfile',examples_tarfile) |
678 |
env.Alias('api_epydoc',api_epydoc) |
env.Alias('api_epydoc',api_epydoc) |
679 |
|
env.Alias('api_doxygen',api_doxygen) |
680 |
|
env.Alias('guide_html_index',guide_html_index) |
681 |
env.Alias('guide_pdf', guide_pdf) |
env.Alias('guide_pdf', guide_pdf) |
682 |
env.Alias('docs',[ 'release_examples', 'guide_pdf', guide_html_index, api_epydoc]) |
env.Alias('docs',[ 'release_examples', 'guide_pdf', api_epydoc, api_doxygen, guide_html_index]) |
683 |
env.Alias('release', ['release_src', 'release_tests', 'docs']) |
env.Alias('release', ['release_src', 'release_tests', 'docs']) |
684 |
|
|
685 |
env.Alias('build_tests') # target to build all C++ tests |
env.Alias('build_tests') # target to build all C++ tests |
686 |
env.Alias('build_py_tests') # target to build all python tests |
env.Alias('build_py_tests') # target to build all python tests |
687 |
env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests |
env.Alias('build_all_tests', [ 'build_tests', 'build_py_tests' ] ) # target to build all python tests |
694 |
env.Alias(init_target) |
env.Alias(init_target) |
695 |
|
|
696 |
# Allow sconscripts to see the env |
# Allow sconscripts to see the env |
697 |
Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF", |
Export(["IS_WINDOWS_PLATFORM", "env", "incinstall", "libinstall", "pyinstall", "exinstall", "dodebug", "mkl_libs", "scsl_libs", "umf_libs", "amd_libs", "blas_libs", "netCDF_libs", "useNetCDF", |
698 |
"boost_libs", "python_libs", "doxygen_path", "epydoc_path", "papi_libs", |
"boost_lib", "python_lib", "doxygen_path", "epydoc_path", "papi_libs", |
699 |
"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", |
700 |
"guide_pdf", "guide_html_index", "api_epydoc", "useMPI" ]) |
"guide_pdf", "guide_html_index", "api_epydoc", "api_doxygen", "useMPI" ]) |
701 |
|
|
702 |
# End initialisation section |
# End initialisation section |
703 |
# Begin configuration section |
# Begin configuration section |
731 |
# added by Ben Cumming |
# added by Ben Cumming |
732 |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
env.SConscript(dirs = ['pythonMPI/src'], build_dir='build/$PLATFORM/pythonMPI', duplicate=0) |
733 |
#env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |
#env.SConscript(dirs = ['../test'], build_dir='../test/build', duplicate=0) |
734 |
|
|
735 |
|
|
736 |
|
syslib_install_target = env.installDirectory(sys_libinstall,libinstall) |
737 |
|
syspy_install_target = env.installDirectory(sys_pyinstall,pyinstall,recursive=True) |
738 |
|
|
739 |
|
install_target = env.Alias("install", env.Flatten([syslib_install_target, syspy_install_target]) ) |