summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/__init__.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2017-08-06 18:09:32 -0500
committerPauli Virtanen <pav@iki.fi>2017-09-02 16:56:41 +0300
commit3cb0e8f96afdcf62d09c19d54a719ddd54f9d413 (patch)
tree2d62ef02f1d44b69c2a4a1603b5930665d8b48fe /numpy/distutils/fcompiler/__init__.py
parentf3c8a0ab23966cae9992dae74da96807a44bc0d8 (diff)
downloadnumpy-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/fcompiler/__init__.py')
-rw-r--r--numpy/distutils/fcompiler/__init__.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py
index 9d465e9d8..1d558319d 100644
--- a/numpy/distutils/fcompiler/__init__.py
+++ b/numpy/distutils/fcompiler/__init__.py
@@ -698,6 +698,38 @@ class FCompiler(CCompiler):
else:
return hook_name()
+ def can_ccompiler_link(self, ccompiler):
+ """
+ Check if the given C compiler can link objects produced by
+ this compiler.
+ """
+ return True
+
+ def wrap_unlinkable_objects(self, objects, output_dir, extra_dll_dir):
+ """
+ Convert a set of object files that are not compatible with the default
+ linker, to a file that is compatible.
+
+ Parameters
+ ----------
+ objects : list
+ List of object files to include.
+ output_dir : str
+ Output directory to place generated object files.
+ extra_dll_dir : str
+ Output directory to place extra DLL files that need to be
+ included on Windows.
+
+ Returns
+ -------
+ converted_objects : list of str
+ List of converted object files.
+ Note that the number of output files is not necessarily
+ the same as inputs.
+
+ """
+ raise NotImplementedError()
+
## class FCompiler
_default_compilers = (