-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
87 lines (66 loc) · 2.58 KB
/
SConstruct
File metadata and controls
87 lines (66 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import os
debug = False # activates debugging options
warn = False # activates compiler warning
fullmsg = False # activates full compilation output
CXX = 'g++'
CXXFLAGS = '-std=c++17'
DBGFLAGS = '-g'
OPTFLAGS = '-O3 -march=native'
WARNFLAGS = '-Wall'
LINKFLAGS = ''
ARPACK_LFLAGS = '-larpack'
HLIBPRO_PATH = '/home/user/hlibpro/main'
INSTALL_PREFIX = '.' # change to install into other directory
######################################################################
#
# set up compilation environment
#
######################################################################
if debug :
CXXFLAGS = CXXFLAGS + ' ' + DBGFLAGS
LINKFLAGS = LINKFLAGS + ' ' + DBGFLAGS
else :
CXXFLAGS = CXXFLAGS + ' ' + OPTFLAGS
if warn :
CXXFLAGS = CXXFLAGS + ' ' + WARNFLAGS
env = Environment( ENV = os.environ,
CXX = CXX,
CXXFLAGS = Split( CXXFLAGS ),
LINKFLAGS = Split( LINKFLAGS ),
)
if not fullmsg :
env.Replace( CCCOMSTR = " CC $SOURCES" )
env.Replace( CXXCOMSTR = " C++ $SOURCES" )
env.Replace( LINKCOMSTR = " Link $TARGET" )
env.Append( CPPPATH = [ 'include' ] )
env.Prepend( LIBPATH = [ "lib" ] )
# add HLIBpro and ARPACK flags
env.ParseConfig( os.path.join( HLIBPRO_PATH, 'bin/hlib-config' ) + ' --cflags --lflags' )
env.MergeFlags( ARPACK_LFLAGS )
hamls = env.StaticLibrary( 'hamls', [ 'src/eigen_misc.cc',
'src/TEigenAnalysis.cc',
'src/TEigenArnoldi.cc',
'src/TEigenArpack.cc',
'src/TEigenLapack.cc',
'src/THAMLS.cc',
'src/TSeparatorTree.cc' ] )
env.Prepend( LIBS = [ "hamls" ] )
env.Prepend( LIBPATH = [ "." ] )
example = env.Program( 'example/eigensolver.cc' )
#
# installation
#
HEADERS = [ 'include/hamls/arpack.hh',
'include/hamls/eigen_misc.hh',
'include/hamls/TEigenAnalysis.hh',
'include/hamls/TEigenArnoldi.hh',
'include/hamls/TEigenArpack.hh',
'include/hamls/TEigenLapack.hh',
'include/hamls/THAMLS.hh',
'include/hamls/TSeparatorTree.hh' ]
if INSTALL_PREFIX != '.' :
for header in HEADERS :
env.Install( os.path.join( INSTALL_PREFIX, 'include', 'hamls' ), header )
env.Install( os.path.join( INSTALL_PREFIX, 'lib' ), hamls )
env.Install( os.path.join( INSTALL_PREFIX, 'bin' ), example )
env.Alias( 'install', INSTALL_PREFIX )