Also via system env variables
Can compile using msvc against MKL libraries (and probably fully static blas and lapack) os.environ['MKLROOT'] = "C:\\Program Files (x86)\\IntelSWTools\\compilers_and_libraries\\windows\\mkl"
see [#2266]
https://stackoverflow.com/questions/54201961/how-to-tell-f2py-module-to-look-in-current-directory-for-shared-object-dependence suggests >>> unset LD_LIBRARY_FLAGS # just in case was set before >>> export LDFLAGS=-Wl,-rpath=. >>> export NPY_DISTUTILS_APPEND_FLAGS=1 >>> python3 -m numpy.f2py -c progpy.f lib.so -m prog >>> python3 test.py hello world
C:\msys64\je\workspace\ccp4\win10-trunk\devtools\install\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros' warnings.warn(msg) C:\msys64\je\workspace\ccp4\win10-trunk\devtools\checkout\numpy-1.16.6\numpy\distutils\fcompiler\__init__.py:530: UserWarning: LDFLAGS is used as is, not appended to flags already defined by numpy.distutils! Use NPY_DISTUTILS_APPEND_FLAGS=1 to obtain appending behavior instead (this behavior will become default in a future release). linker_so_flags = self.flag_vars.linker_so C:\msys64\je\workspace\ccp4\win10-trunk\devtools\checkout\numpy-1.16.6\numpy\distutils\fcompiler\__init__.py:540: UserWarning: LDFLAGS is used as is, not appended to flags already defined by numpy.distutils! Use NPY_DISTUTILS_APPEND_FLAGS=1 to obtain appending behavior instead (this behavior will become default in a future release). linker_exe_flags = self.flag_vars.linker_exe warning: I don't know what to do with 'runtime_library_dirs': ['C:\\msys64\\je\\workspace\\ccp4\\win10-trunk\\devtools\\install/lib'] Creating library build\temp.win-amd64-3.7\Release\numpy\linalg\lapack_lite.cp37-win_amd64.lib and object build\temp.win-amd64-3.7\Release\numpy\linalg\lapack_lite.cp37-win_amd64.exp lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_st_write lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_string_len_trim lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_transfer_character_write lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_transfer_integer_write lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_st_write_done lapack.lib(xerbla.f.obj) : error LNK2001: unresolved external symbol _gfortran_stop_string lapack.lib(dormlq.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(dormqr.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(zunmbr.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(zunmlq.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(zunmqr.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(dormbr.f.obj) : error LNK2001: unresolved external symbol _gfortran_concat_string lapack.lib(dlartg.f.obj) : error LNK2001: unresolved external symbol __powidf2 lapack.lib(dlaed6.f.obj) : error LNK2001: unresolved external symbol __powidf2 build\lib.win-amd64-3.7\numpy\linalg\lapack_lite.cp37-win_amd64.pyd : fatal error LNK1120: 8 unresolved externals
<distutils id="numpy" supports-non-srcdir-builds="no" distbuildargs="--compiler=msvc --fcompiler=gnu95 "> <branch repo="pythonhosted" module="b7/6f/24647f014eef9b67a24adfcbcd4f4928349b4a0f8393b3d7fe648d4d2de3/numpy-1.16.6.zip" <patch file="numpy-intelcompiler.patch" strip="0"/> <patch file="numpy-distutils-mingw64.patch" strip="0" /> <!-- does not recognise ming64 --> <patch file="numpy-distutils-msvcrt.patch" strip="0" /> <!-- does not recognise 1915 MSVC --> <patch file="numpy-core-setup.patch" strip="0" /> <!-- no /CL- for mingw --> <patch file="numpy-distutils-fcompiler-gnu.patch" strip="0" /> <!-- no no-cygwin for gcc 4+ --> <patch file="numpy-core-setup_common-msvc.patch" strip="0" /> <!-- .exe extension -->
Using --compiler=msvc is required in mingw environment