/[escript]/trunk/finley/src/SConscript
ViewVC logotype

Annotation of /trunk/finley/src/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 700 - (hide annotations)
Thu Apr 6 00:13:40 2006 UTC (13 years, 2 months ago) by gross
File size: 3077 byte(s)
A few changes in the build mechanism and the file structure so scons can build release tar files:

  * paso/src/Solver has been moved to paso/src 
  * all test_.py are now run_.py files and are assumed to be passing python tests. they can run by 
    scons py_tests and are part of the release test set
  * escript/py_src/test_ are moved to escript/test/python and are installed in to the build directory 
    (rather then the PYTHONPATH).
  * all py files in test/python which don't start with run_ or test_ are now 'local_py_tests'. they are installed i
    by not run automatically.
  * CppUnitTest is now treated as a escript module (against previous decisions).
  * scons realse builds nor tar/zip files with relvant source code (src and tests in seperate files)

the python tests don't pass yet due to path problems.


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

  ViewVC Help
Powered by ViewVC 1.1.26