Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated the SConstruct.EXAMPLE with a working version of mine

  • Loading branch information...
commit 31c0c8e316806c25dc1556dad7e2a307529f82e0 1 parent 59b841e
@b45ch1 authored
Showing with 41 additions and 63 deletions.
  1. +41 −63 SConstruct.EXAMPLE
View
104 SConstruct.EXAMPLE
@@ -2,79 +2,57 @@ import distutils.sysconfig
import os
import numpy
-# 1: BUILD ADOL-C FUNCTIONALITY WITHOUT SPARSE DRIVERS
-#-----------------------------------------------------
-adolc_include_path = '/home/basti/workspace/ADOL-C-2.1.0/ADOL-C/src'
-adolc_library_path = '/home/basti/workspace/ADOL-C-2.1.0/ADOL-C/src/.libs'
-
+# -1: CUSTOMIZE THIS TO FIT YOUR SYSTEM !!!
+python_include_path= '/usr/include/python2.5'
+
+adolc_include_path = '/u/walter/workspace/ADOL-C-2.1.0/ADOL-C/src'
+adolc_library_path = '/u/walter/workspace/ADOL-C-2.1.0/ADOL-C/src/.libs'
+
+colpack_include_path = '/u/walter/workspace/colpack/build/include'
+colpack_library_path = '/u/walter/workspace/colpack/build/lib'
+
LIBS = ['adolc',
- 'boost_python-mt',
- ]
+ 'boost_python',
+ 'colpack',
+ ]
LIBPATH = [
- adolc_library_path,
- ]
+ adolc_library_path,
+ colpack_library_path,
+ ]
INCLUDEPATH = [
- adolc_include_path,
- '/usr/include/python2.5'
- ]
+ adolc_include_path,
+ python_include_path,
+ colpack_include_path,
+ ]
-env = Environment(
- CPPPATH=[distutils.sysconfig.get_python_inc(),numpy.get_include()] + INCLUDEPATH,
- CXXFLAGS="-ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB -O2 -Wall",
- LIBPATH=["/usr/lib/python2.5/config"] + LIBPATH,
- LIBS= LIBS,
- RPATH = LIBPATH, #include information where shared libraries can be found to avoid errors like: "ImportError: libboost_python-gcc42-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory"
- SHLIBPREFIX="", #gets rid of lib prefix
-)
-Default('.')
-adolc = env.SharedLibrary(target='_adolc', source=['py_adolc.cpp', 'num_util.cpp'])
-#env.Install("./release/adolc", adolc)
-#2: BUILD SPARSE SUPPORT
-#-----------------------
-colpack_include_path = '/home/basti/workspace/colpack/build/include'
-colpack_library_path = '/home/basti/workspace/colpack/build/lib'
+# 0: setup the command line parsing
+AddOption('--prefix',
+ dest='prefix',
+ nargs=1, type='string',
+ action='store',
+ metavar='DIR',
+ help='installation prefix')
-LIBS = ['adolc',
- 'boost_python-mt',
- 'colpack',
- ]
-LIBPATH = [
- adolc_library_path,
- colpack_library_path,
- ]
-INCLUDEPATH = [
- adolc_include_path,
- adolc_include_path + '/adolc/sparse',
- colpack_include_path,
- '/usr/include/python2.5'
- ]
-env2 = Environment(
- CPPPATH=[distutils.sysconfig.get_python_inc(),numpy.get_include()] + INCLUDEPATH,
- CXXFLAGS="-ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB -O2 -Wall",
- LIBPATH=["/usr/lib/python2.5/config"] + LIBPATH,
- LIBS= LIBS,
- RPATH = LIBPATH, #include information where shared libraries can be found to avoid errors like: "ImportError: libboost_python-gcc42-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory"
- SHLIBPREFIX="", #gets rid of lib prefix
+env = Environment(
+ PREFIX = GetOption('prefix'),
+ TMPBUILD = '/tmp/builddir',
+ CPPPATH=[distutils.sysconfig.get_python_inc(),numpy.get_include()] + INCLUDEPATH,
+ CXXFLAGS="-ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB -O2 -Wall",
+ LIBPATH=["/usr/lib/python2.5/config"] + LIBPATH,
+ LIBS= LIBS,
+ RPATH = LIBPATH, #include information where shared libraries can be found to avoid errors like: "ImportError: libboost_python-gcc42-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory"
+ SHLIBPREFIX="", #gets rid of lib prefix
)
-Default('.')
+Export('env')
+Export('adolc_include_path')
+SConscript('adolc/SConscript')
+SConscript('adolc/sparse/SConscript')
-colpack = env2.SharedLibrary(target='_colpack',
- source=['py_colpack.cpp',
- 'num_util.cpp',
- adolc_include_path +'/sparse/sparsedrivers.cpp',
- adolc_include_path +'/sparse/sparse_fo_rev.cpp',
- adolc_include_path +'/int_forward_s.c',
- adolc_include_path +'/int_forward_t.c',
- adolc_include_path +'/int_reverse_s.c',
- adolc_include_path +'/int_reverse_t.c',
- adolc_include_path +'/nonl_ind_forward_s.c',
- adolc_include_path +'/nonl_ind_forward_t.c',
- adolc_include_path +'/indopro_forward_s.c',
- adolc_include_path +'/indopro_forward_t.c',
- ])
+env.Install( target='./build/adolc/', source = ['adolc/__init__.py','adolc/wrapped_functions.py','adolc/_adolc.so'])
+env.Install( target='./build/adolc/sparse/', source = ['adolc/sparse/__init__.py', 'adolc/sparse/_colpack.so', 'adolc/sparse/wrapped_functions.py'])
Please sign in to comment.
Something went wrong with that request. Please try again.