From f3c8a0ab23966cae9992dae74da96807a44bc0d8 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sat, 22 Jul 2017 15:30:07 -0500 Subject: 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. --- numpy/distutils/misc_util.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'numpy/distutils/misc_util.py') 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''' -- cgit v1.2.1