MCPcopy Create free account
hub / github.com/numpy/numpy / _process_unlinkable_fobjects

Method _process_unlinkable_fobjects

numpy/distutils/command/build_ext.py:639–672  ·  view source on GitHub ↗
(self, objects, libraries,
                                     fcompiler, library_dirs,
                                     unlinkable_fobjects)

Source from the content-addressed store, hash-verified

637 objects, "_gfortran_workaround", output_dir=build_clib, debug=self.debug)
638
639 def _process_unlinkable_fobjects(self, objects, libraries,
640 fcompiler, library_dirs,
641 unlinkable_fobjects):
642 libraries = list(libraries)
643 objects = list(objects)
644 unlinkable_fobjects = list(unlinkable_fobjects)
645
646 # Expand possible fake static libraries to objects;
647 # make sure to iterate over a copy of the list as
648 # "fake" libraries will be removed as they are
649 # encountered
650 for lib in libraries[:]:
651 for libdir in library_dirs:
652 fake_lib = os.path.join(libdir, lib + '.fobjects')
653 if os.path.isfile(fake_lib):
654 # Replace fake static library
655 libraries.remove(lib)
656 with open(fake_lib) as f:
657 unlinkable_fobjects.extend(f.read().splitlines())
658
659 # Expand C objects
660 c_lib = os.path.join(libdir, lib + '.cobjects')
661 with open(c_lib) as f:
662 objects.extend(f.read().splitlines())
663
664 # Wrap unlinkable objects to a linkable one
665 if unlinkable_fobjects:
666 fobjects = [os.path.abspath(obj) for obj in unlinkable_fobjects]
667 wrapped = fcompiler.wrap_unlinkable_objects(
668 fobjects, output_dir=self.build_temp,
669 extra_dll_dir=self.extra_dll_dir)
670 objects.extend(wrapped)
671
672 return objects, libraries
673
674 def _libs_with_msvc_and_fortran(self, fcompiler, c_libraries,
675 c_library_dirs):

Callers 1

build_extensionMethod · 0.95

Calls 6

openFunction · 0.85
splitlinesMethod · 0.80
joinMethod · 0.45
readMethod · 0.45
abspathMethod · 0.45

Tested by

no test coverage detected