The instructions to build a ".lib" file requires a ".def" file. The def file requires the user to download the source and have (among many other things) a working Perl installation and more. It would be very convenient for the users if the lib file was shipped together with the dll and header files.
EDIT: This used to be the case, as in OpenBLAS v0.2.8 from 2013 which included:
libopenblas.a
libopenblas.def
libopenblas.dll
libopenblas.exp
libopenblas.lib
Thank you for the suggestion.
I am trying to get get the binary package from NuGet (i.e., https://www.nuget.org/packages/OpenBLAS). However, only a libopenblas.dll.a is provided. I need the .lib file in the linking process. Any clue if and where I might be able to find it? I don't have a toolchain setup to build from source... Thanks.
That binary on NuGet is seriously outdated, could you please try if the attached package works for you ? (it is not exactly current either, this happens to be the result of a cross-compilation test
that I did on a Linux system a while ago, and already had the .def file that is needed by lib.exe to
create the .lib. If this works, I'll see if I can get the OpenBLAS uploads to sf.net updated again)
openblas035.zip
Hei Martin, thank you very much for taking the time to answer and for the binaries. I can confirm that I can link them with Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26730 for x86. Do you happen to also have the x64 binary?
By the way, it would be great if you could update the https://sf.net repository with more recent binaries. Sorry for asking this if you, but I personally don't have the technical knowledge to compile it myself from source. However, I rely heavily on this project for my research and I appreciate the amazing work you guys are doing!
Sorry, actually did not realize that it was a 32bit lib I had lying around. Will update my cross-compilation to x64 and upload a 64bit of 0.3.6 later today or tomorrow...
Many thanks! I look forward to it!
OK, next attempt. Hope this is actually usable:
openblas036-win64.zip
It worked very well! I used the Microsoft (R) C/C++ Optimizing Compiler Version 19.15.26730 for x64. Thank you again! Very much appreciated!
I have uploaded the win64 build of 0.3.7 and a rebuilt package of 0.3.6 to the github releases page now, will ask xianyi to upload them to his openblas project account on sf.net as well.
(I decided to rebuild 0.3.6 as my previous attempt had Haswell as minimum target by mistake. Both new packages are still DYNAMIC_ARCH and now use TARGET=CORE2 for the common functions)
Closing as the new 0.3.6 and 0.3.7 packages are now on the sourceforge page as well.
That binary on NuGet is seriously outdated, could you please try if the attached package works for you ? (it is not exactly current either, this happens to be the result of a cross-compilation test
that I did on a Linux system a while ago, and already had the .def file that is needed by lib.exe to
create the .lib. If this works, I'll see if I can get the OpenBLAS uploads to sf.net updated again)
openblas035.zip
This is perfect runs.
It is using MingW or native for produce it.
i did the native only producing openblas.lib , and cannot linked.
@realbabilu the dll and def were produced using MingW (in the form of MXE) on Linux, the .lib was created on Windows using lib.exe /def:libopenblas.def /machine:x64 /out:libopenblas.lib from a VisualStudio2015 developer prompt.
Can i opened a new issue ?
Question 1 : Can you describe in easy way step by step?
Question 2 : Could you pointed what wrong what i do, in below ?
Question 3 : In Xianyi precompiled installation packages:
https://github.com/xianyi/OpenBLAS/wiki/Precompiled-installation-packages
a. The windows at sourceforge cannot be linked with VS.
It need libgfortran-3.dll that not included (that is from mingW32 right?
its not available on mingw-64?
got the file. forrtl: severe (157): Program Exception - access violation
Comment 1: The best precompiled package openBlas is here for Windows VS:
Using VS GUI: just add "libopenblas.lib" into source
Using command line: ifort source.f90 libopenblas.dll.a /O3 /QxCORE-AVX2
where the libopenblas.dll should be needed for run the compiled one.
For WSL 10, or Windows Subsystem Linux, Ubuntu on Windows is
sudo apt-get install libopenblas-dev
gfortran -Ofast -ffast-math -funroll-loops -march=core-avx2 -fopenmp any.f90 -lopenblas -o out.x
it is version 0.20 however the speed is the same with the compiled linux own version that compiled :
gfortran -pthread -test_fpu3.f90 libopenblas_haswellp-r0.3.8.dev.a libopenblas.a -O3 -ffast-math -funroll-loops -march=core-avx2 -o TESlinux.x
Attachment for Question 2:
I followed the https://github.com/xianyi/OpenBLAS/wiki/How-to-use-OpenBLAS-in-Microsoft-Visual-Studio for create the lib for VS2019 x64 community.
A. Native
B. MingW-64
B.I MingW-64 Version
B.II Msys2 MingW-64
Probably best to open a new issue for this. Unfortunately I am not building on Windows myself (hence the crossbuild from Linux), so I have to rely on reports and suggestions by others. The missing libgfortran-3.dll is probably this one from mxe libgfortran-3.txt (the issue tracker accepts only .txt for uploads, you need to rename this back to .dll).
Since you building using mingw from linux. I have linux ubuntu also as WSL. this will be adding mingw64-gcc. how it told to use mingw-gcc instead original linux gcc.
Should be sufficient to use make HOSTCC=gcc CC=/path/to/your/mingw-gcc FC=/path/to/your/mingw-gfortran
Got error forrtl: severe (157): Program Exception - access violation when run the app with libopenblas.dll.a produced. both from linux gcc-mingw-w64-gcc and mingw64 souceforge gcc-mingw-w64-gcc
ifort /I"D:\win\test_fpu\Openblas2" test_fpu2.f90 libopenblas.dll.a /link /stack:64000000
Most helpful comment
OK, next attempt. Hope this is actually usable:
openblas036-win64.zip