40 lines
1.1 KiB
Diff
40 lines
1.1 KiB
Diff
--- Src/MPI/compile.py
|
|
+++ Src/MPI/compile.py
|
|
@@ -4,7 +4,7 @@
|
|
# Normally nothing needs to be changed below
|
|
import distutils
|
|
import distutils.sysconfig
|
|
-import os, sys
|
|
+import os, subprocess, sys
|
|
from Scientific import N
|
|
|
|
cfgDict = distutils.sysconfig.get_config_vars()
|
|
@@ -32,16 +32,16 @@
|
|
items[i] = os.path.join(frameworkdir[0], items[i])
|
|
linkforshared = ' '.join(items)
|
|
|
|
-cmd = '%s %s -o mpipython -I%s %s %s -L%s -lpython%s %s %s' % \
|
|
- (mpicompiler,
|
|
- linkforshared,
|
|
- cfgDict['INCLUDEPY'],
|
|
- extra_compile_args,
|
|
- sources,
|
|
- cfgDict['LIBPL'],
|
|
- cfgDict['VERSION'],
|
|
- cfgDict['LIBS'],
|
|
- cfgDict['LIBM'])
|
|
+cmd = [mpicompiler]
|
|
+cmd.extend(linkforshared.split())
|
|
+cmd.extend(os.environ.get("CFLAGS", "").split())
|
|
+cmd.extend(os.environ.get("LDFLAGS", "").split())
|
|
+cmd.extend(["-o", "mpipython"])
|
|
+cmd.extend(["-I" + x for x in cfgDict['INCLUDEPY'].split()])
|
|
+cmd.extend(["-I../../Include"])
|
|
+cmd.extend(extra_compile_args.split())
|
|
+cmd.extend(sources.split())
|
|
+cmd.extend(["-lpython%s" % cfgDict['VERSION']])
|
|
|
|
-print 'cmd = ', cmd
|
|
-os.system(cmd)
|
|
+print 'cmd =', " ".join(cmd)
|
|
+sys.exit(subprocess.call(cmd))
|