diff options
author | Pauli Virtanen <pav@iki.fi> | 2017-08-06 18:09:32 -0500 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2017-09-02 16:56:41 +0300 |
commit | 3cb0e8f96afdcf62d09c19d54a719ddd54f9d413 (patch) | |
tree | 2d62ef02f1d44b69c2a4a1603b5930665d8b48fe /numpy/distutils/misc_util.py | |
parent | f3c8a0ab23966cae9992dae74da96807a44bc0d8 (diff) | |
download | numpy-3cb0e8f96afdcf62d09c19d54a719ddd54f9d413.tar.gz |
distutils: handle unlinkable object files in build_clib/build_ext, not gnu
Add concept of unlinkable Fortran object files on the level of
build_clib/build_ext.
Make build_clib generate fake static libs when unlinkable object files are
present, postponing the actual linkage to build_ext.
This enables MSVC+gfortran DLL chaining to only involve those DLLs that
are actually necessary for each .pyd file, rather than linking everything
in to every file. Linking everything to everywhere has issues due to
potential symbol clashes and the fact that library build order is
unspecified.
Record shared_libs on disk instead of in system_info. This is necessary
for partial builds -- it is not guaranteed the compiler is actually called
for all of the DLL files.
Remove magic from openblas msvc detection. That this worked previously
relied on the side effect that the generated openblas DLL would be added
to shared_libs, and then being linked to all generated outputs.
Diffstat (limited to 'numpy/distutils/misc_util.py')
-rw-r--r-- | numpy/distutils/misc_util.py | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 3221e4da3..01376a7ff 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -33,14 +33,6 @@ 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 from numpy.compat import npy_load_module @@ -1565,10 +1557,6 @@ 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: @@ -2077,7 +2065,6 @@ class Configuration(object): """ self.py_modules.append((self.name, name, generate_config_py)) - def get_info(self,*names): """Get resources information. @@ -2295,13 +2282,12 @@ def generate_config_py(target): 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(""" - + # For gfortran+msvc combination, extra shared libraries may exist + f.write(""" import os - -os.environ["PATH"] += os.pathsep + os.path.join(os.path.dirname(__file__), '_lib') - +extra_dll_dir = os.path.join(os.path.dirname(__file__), 'extra-dll') +if os.path.isdir(extra_dll_dir): + os.environ["PATH"] += os.pathsep + extra_dll_dir """) for k, i in system_info.saved_results.items(): |