-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSConstruct
60 lines (46 loc) · 1.7 KB
/
SConstruct
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
import commands
import os
# compiling with MPI support?
out = commands.getstatusoutput('mpirun --version')
if out[0] == 0:
MPI = True
else:
MPI = False
print 'Compiling MultiNest without MPI'
## get path to mpif90 executable
if MPI:
out = commands.getstatusoutput('which mpif90')
if out[0] == 0:
mpif90_exec = out[1]
mpif90_version = commands.getoutput(mpif90_exec + ' -v').split('\n')[0]
print 'Found %s at %s' % (mpif90_version, mpif90_exec)
else:
raise RuntimeError('Compiling with MPI but mpif90 does not seem to be installed. Aborting!')
## get path to f2py executable
out = commands.getstatusoutput('which f2py')
if out[0] == 0:
f2py_exec = out[1]
f2py_version = commands.getoutput(f2py_exec + ' -v')
print 'Found f2py version %s at %s' % (f2py_version, f2py_exec)
else:
raise RuntimeError('f2py does not seem to be installed. Aborting!')
Export('MPI', 'f2py_exec')
if MPI: Export('mpif90_exec')
## specify the gfortran executable
## --gfortran=/path/to/gfortran
AddOption('--gfortran', dest='gfortran', type='string', nargs=1, action='store',
help='Absolute path to Fortran compiler')
## on some machines, the gp.so extension needs to be linked with lapack explicitely
## use --gp-with-lapack if getting errors of the type
## ImportError: /data/jfaria/OPEN/OPEN/ext/gp.so: undefined symbol: dpotrf
AddOption('--gp-with-lapack', dest='gp_lapack_link', action='store_true',
help='some help')
SConscript(['OPEN/SConscript'])
path = 'MultiNest/SConscript'
if os.path.isfile(path):
SConscript([path])
else:
print "Missing the SConscript file at %s." % path
print "Try cloning the MultiNest submodule:\n$ git submodule init\n$ git submodule update"
Exit(1)
SConscript(['RJDNest3/SConscript'])