forked from demisjohn/CAMFR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
machine_cfg.py.gentoo
85 lines (58 loc) · 2.11 KB
/
machine_cfg.py.gentoo
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
# This Python script contains all the machine dependent settings
# needed during the build process.
import os, sys
# Compilers to be used.
cc = "gcc"
cxx = "g++"
f77 = "gfortran -fPIC" # Workaround for scons bug.
if os.environ.has_key("CC"):
cc = os.environ["CC"]
if os.environ.has_key("CXX"):
cxx = os.environ["CXX"]
if os.environ.has_key("FORTRANC"):
f77 = os.environ["FORTRANC"] + " -fPIC"
# Compiler flags.
#
# Note: for the Fortran name definition you can define one of the following
# preprocessor macros:
#
# FORTRAN_SYMBOLS_WITHOUT_TRAILING_UNDERSCORES
# FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE
# FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES
base_flags = "-DFORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE -DNDEBUG "
flags_noopt = base_flags
# If you manually want to add optimisation flags, this is where you do it:
flags = base_flags
if os.environ.has_key("CXXFLAGS"):
flags = flags + " " + os.environ["CXXFLAGS"]
# For gcc 4.2.1, filter the flags a bit.
if "pentium-m" in flags or "pentium4" in flags:
flags = flags.replace("-O3", "-O2")
fflags = flags + " -fPIC "
# Linker and linker flags to be used.
link = cxx
link_flags = ""
if os.environ.has_key("LDFLAGS"):
link_flags = os.environ["LDFLAGS"]
# Include directories.
include_dirs = []
pyver = ""
if os.path.isdir("/usr/include/python2.5"): pyver = "2.5"
elif os.path.isdir("/usr/include/python2.4"): pyver = "2.4"
elif os.path.isdir("/usr/include/python2.3"): pyver = "2.3"
else:
print "Python dir not found!"
sys.exit()
include_dirs.append("/usr/include/python" + pyver)
include_dirs.append("/usr/lib/python" + pyver + "/site-packages")
# Library directories.
library_dirs = []
#library_dirs = ["/opt/intel/mkl8/lib/32"]
# Library names.
libs = ["boost_python", "blitz", "lapack", "blas", "gfortran"]
#libs = ["boost_python", "blitz", "mkl_lapack64", "mkl", "gfortran"]
# Command to strip library of excess symbols:
dllsuffix = ".so"
strip_command = "strip --strip-unneeded camfr/_camfr" + dllsuffix
# Extra files to copy into installation directory.
extra_files = [("doc", ["docs/camfr.pdf"])]