You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-python/scientificpython/files/scientificpython-2.9-mpi.patch

41 lines
1.1 KiB

--- 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))