summaryrefslogtreecommitdiff
path: root/numpy/distutils/misc_util.py
diff options
context:
space:
mode:
authorxoviat <xoviat@users.noreply.github.com>2017-07-22 15:30:07 -0500
committerPauli Virtanen <pav@iki.fi>2017-09-02 16:56:22 +0300
commitf3c8a0ab23966cae9992dae74da96807a44bc0d8 (patch)
tree8d00247115affdcb9d8f5b1b8c88586946b9143b /numpy/distutils/misc_util.py
parent11593aa176d491beb0cc5ffcc393956a5435a2bf (diff)
downloadnumpy-f3c8a0ab23966cae9992dae74da96807a44bc0d8.tar.gz
distutils: gnu: patch fcompile
This allows mingw's gfortran to work with MSVC. DLLs are autogenerated using heuristics that should work with most cases. In addition, a libopenblas DLL is compiled from the static lib for use with MSVC. All generated DLLs have randomized names so that no clashes will occur.
Diffstat (limited to 'numpy/distutils/misc_util.py')
-rw-r--r--numpy/distutils/misc_util.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py
index 30d72f50e..3221e4da3 100644
--- a/numpy/distutils/misc_util.py
+++ b/numpy/distutils/misc_util.py
@@ -33,6 +33,13 @@ def clean_up_temporary_directory():
atexit.register(clean_up_temporary_directory)
+# stores the order in which the libraries were added
+_ldata = []
+def get_library_names():
+ """Get the library names in order"""
+ global _ldata
+
+ return _ldata
from numpy.distutils.compat import get_exception
from numpy.compat import basestring
@@ -1558,6 +1565,10 @@ class Configuration(object):
name = name #+ '__OF__' + self.name
build_info['sources'] = sources
+ global _ldata
+ # Track the library order
+ _ldata += [name]
+
# Sometimes, depends is not set up to an empty list by default, and if
# depends is not given to add_library, distutils barfs (#1134)
if not 'depends' in build_info:
@@ -2283,6 +2294,16 @@ def generate_config_py(target):
f.write('# This file is generated by %s\n' % (os.path.abspath(sys.argv[0])))
f.write('# It contains system_info results at the time of building this package.\n')
f.write('__all__ = ["get_info","show"]\n\n')
+
+ if system_info.shared_libs:
+ f.write("""
+
+import os
+
+os.environ["PATH"] += os.pathsep + os.path.join(os.path.dirname(__file__), '_lib')
+
+""")
+
for k, i in system_info.saved_results.items():
f.write('%s=%r\n' % (k, i))
f.write(r'''