Home My Page Projects Code Snippets Project Openings devtools
Summary Activity Tracker SCM

[#2245] mingw: numpy windows python vc_buildtools (MKL)

Date:
2020-05-30 19:38
Priority:
3
State:
Open
Submitted by:
Charles Ballard (ccb63)
Assigned to:
Nobody (None)
branch:
py3
type:
none
Summary:
mingw: numpy windows python vc_buildtools (MKL)

Detailed description
https://wiki.python.org/moin/WindowsCompilers

This is a standalone version of Visual C++ 14.2 compiler, you don't need to install Visual Studio 2019.

Install Microsoft Build Tools for Visual Studio 2019.
In Build tools, install C++ build tools and ensure the latest versions of MSVCv142 - VS 2019 C++ x64/x86 build tools and Windows 10 SDK are checked.
The setuptools Python package version must be at least 34.4.0.
{i} Build Tools also allows to install any previous Visual C++ 14 version (Including 2015, 2017 ones).

https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
Message  ↓
Date: 2020-06-21 20:14
Sender: Charles Ballard

Also via system env variables

Date: 2020-06-21 20:10
Sender: Charles Ballard

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"

Date: 2020-06-17 18:41
Sender: Charles Ballard

see [#2266]

Date: 2020-06-03 19:38
Sender: Charles Ballard

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

Date: 2020-06-03 19:36
Sender: Charles Ballard

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

Date: 2020-06-03 19:35
Sender: Charles Ballard

<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 -->

Date: 2020-06-03 18:42
Sender: Charles Ballard

Using --compiler=msvc is required in mingw environment

Field Old Value Date By
summarymingw: numpy windows python vc_buildtools2020-06-21 20:14ccb63
summarymingw: windows python vc_buildtools2020-06-17 16:14ccb63