/[escript]/trunk-mpi-branch/finley/src/SConscript
ViewVC logotype

Annotation of /trunk-mpi-branch/finley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1016 - (hide annotations)
Thu Mar 8 06:31:28 2007 UTC (14 years, 6 months ago) by gross
File size: 3571 byte(s)
MPI version compiles and starts to run now. 
Important:

   * the mpi library needs to be shared.
   * the path needs to be added to LD_LIBRARY path.

The program stucks in the matrix assemblage.


1 gross 707 # Copyright 2006 by ACcESS MNRF
2     #
3     # http://www.access.edu.au
4     # Primary Business: Queensland, Australia
5     # Licensed under the Open Software License version 3.0
6     # http://www.opensource.org/licenses/osl-3.0.php
7     #
8 gross 700 import os
9 jgs 182 Import('*')
10    
11 robwdcock 682 local_env=env.Copy()
12     py_wrapper_local_env=env.Copy()
13     # Remove the sharedlibrary prefix on all platform - we don't want 'lib' mucking with our python modules
14     del py_wrapper_local_env['SHLIBPREFIX']
15 jgs 182
16 robwdcock 682 lib_name = 'finley'
17     py_wrapper_name = lib_name+'cpp'
18     py_wrapper_source = 'CPPAdapter/'+py_wrapper_name+'.cpp' # FIXME: In need of a source tree refactor
19     py_wrapper_lib_name = py_wrapper_name
20 jgs 277
21 robwdcock 682 src_dir = local_env.Dir('.').srcnode().abspath
22 gross 700 filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
23 jgs 182
24 robwdcock 682 sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
25     headers = [x for x in filenames if os.path.splitext(x)[1] in ['.h']]
26 jgs 277
27    
28 robwdcock 682 # finleycpp has additional source in the CPPAdapter sub-directory. Append these to the list
29 gross 700 cppadapter_filenames = [ 'CPPAdapter/'+x for x in os.listdir(src_dir+'/CPPAdapter') if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
30     sources += [ x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
31     cppadapter_headers = [x for x in cppadapter_filenames if os.path.splitext(x)[1] in ['.h']]
32 jgs 190
33 robwdcock 682 sources.remove(py_wrapper_source) # FIXME: should probably refactor the source tree so the python wrapper isn't colocated with c++ sources
34 gross 1016 local_env.Append(LIBS = boost_libs + python_libs + sys_libs + ['escript', 'esysUtils', 'paso'] + mpi_libs )
35     py_wrapper_local_env.Append(LIBS = boost_libs + python_libs + sys_libs + [ lib_name, 'escript', 'esysUtils', 'paso'] + mpi_libs )
36 jgs 481
37 robwdcock 682 if mkl_libs:
38     local_env.Append(CPPDEFINES=['MKL',])
39     local_env.Append(LIBS = mkl_libs)
40     if scsl_libs:
41     local_env.Append(CPPDEFINES=['SCSL',])
42     local_env.Append(LIBS = scsl_libs)
43 gross 1011 if umfpack_libs:
44 robwdcock 682 local_env.Append(CPPDEFINES=['UMFPACK',])
45 gross 1011 local_env.Append(LIBS = umfpack_libs)
46 gross 806
47     if blas_libs:
48     local_env.Append(LIBS = blas_libs)
49    
50 robwdcock 682 if papi_libs:
51     local_env.Append(CPPDEFINES=['PAPI',])
52     local_env.Append(LIBS = papi_libs)
53 jgs 182
54 gross 1011 if trilinos_libs:
55     local_env.Append(CPPDEFINES=['TRILINOS',])
56     local_env.Append(LIBS = trilinos_libs)
57    
58 woo409 757 local_env.Append(CPPDEFINES = 'FINLEY_EXPORTS')
59 jgs 277
60 robwdcock 682 lib = local_env.SharedLibrary(lib_name, sources)
61     py_wrapper_lib = py_wrapper_local_env.SharedLibrary( py_wrapper_lib_name, py_wrapper_source)
62 jgs 277
63 robwdcock 682 include_path = Dir(lib_name, incinstall)
64     cppadapter_include_path = Dir('CppAdapter', include_path)
65 jgs 182
66 robwdcock 682 local_env.Install(include_path, headers )
67     local_env.Install(cppadapter_include_path, cppadapter_headers )
68     local_env.Install(libinstall, lib)
69     py_wrapper_local_env.Install(pyinstall+'/finley', py_wrapper_lib)
70 jgs 182
71 robwdcock 682 # export the lib target since tests will depend on it
72     # the lib target is a list of file nodes (why? win32 produces more than one output file: .lib, .dll, .pdb)
73     # FIXME: This list handling produces the desired result but can this be done directly with scons File nodes?
74     dep_lib = [libinstall+'/'+str(x) for x in lib]
75     Export('dep_lib')
76 jgs 277
77 gross 700 # add source files to release
78     release_srcfiles = [ env.File(x) for x in filenames + cppadapter_filenames ] + [env.File("SConscript"), ]
79     env.Zip(src_zipfile, release_srcfiles)
80     env.Tar(src_tarfile, release_srcfiles)
81    
82 robwdcock 682 # Call the python sconscript
83     env.SConscript(dirs = ['#/finley/py_src'], build_dir='py', duplicate=0)
84 jgs 277
85 robwdcock 682 # Call the unit tests SConscript
86     local_env.SConscript(dirs = ['#/finley/test'], build_dir='#/build/$PLATFORM/finley/test', duplicate=0)
87 jgs 481

  ViewVC Help
Powered by ViewVC 1.1.26