OpenBLAS: Windows binary package missing openblas .lib file

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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 17

Most upvoted comments

OK, next attempt. Hope this is actually usable: openblas036-win64.zip

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

  1. install miniconda3 x64
  2. Anaconda prompt > conda config --add channels conda-forge conda install -y cmake flang clangdev perl libflang conda install -y -c isuruf kitware-ninja
  3. run vcvarsallx64.bat (this is on the new command prompt or anaconda; pressumed anaconda), checked with link.exe (ok)
  4. run (pressumed anaconda prompt also) set “LIB=%CONDA_INSTALL_LOCN%\Library\lib;%LIB%” set “CPATH=%CONDA_INSTALL_LOCN%\Library\include;%CPATH%” (it need " on last) mkdir build cd build cmake … -G “Ninja” -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_Fortran_COMPILER=flang -DBUILD_WITHOUT_LAPACK=no -DNOFORTRAN=0 -DDYNAMIC_ARCH=ON -DCMAKE_BUILD_TYPE=Release
  5. cmake --build . --config Release
  6. got the openblas.lib on build/release
  7. install cmake.exe on windows (pressumed cmake.exe on path wheninstall)
  8. next…getting lost here. # do this from powershell so cmake can find visual studio
    anaconda powershell or windows powershell ? pressumed windows powershell since anaconda already got cmake itself, so the installed cmake for windows not anaconda. cmake -G “Visual Studio 14 Win64” -DCMAKE_BUILD_TYPE=Release . this is run on openblas source folder ?? looks cant run. i mad another folder, build2 cmake … -G “Visual Studio 15 Win64” at folder build 2. then got some VS2017 project.
  9. When i run the openblas workplace got the openblas.lib also. this a static ?
    i cant link with my source for testing inverse matrix: test_fpu3.f90 test_fpu3.f90 https://www.mediafire.com/file/oi966842pbdemt9/test_fpu3.f90/file that calls Lapack Blas3 DGETRI; DGFTRF,ILAENV ifort test_fpu2.f90 /O3 /OxCORE-AVX2 openblas.lib /link /stack:64000000 it fails to call the Lapack.

B. MingW-64 B.I MingW-64 Version

  1. Install MingW-w64-install.exe
  2. in bin folder it has mingw32-make.exe copy to make.exe (maybe unnecessary) copy ar.exe x86_64-w64-mingw32-ar. copy ranlib.exe to x86_64-w64-mingw32-ranlib. in folder openblas, m
  3. compile make HOSTCC=gcc CC=/mnt/d/linux/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/x86_64-w64-mingw32-gcc.exe FC=/mnt/d/linux/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/x86_64-w64-mingw32-gfortran.exe BINARY=64
  4. use the dll.a ifort /I"D:\win\test_fpu\Openblas2" test_fpu2.f90 libopenblas.dll.a /link /stack:64000000
  5. Got error forrtl: severe (157): Program Exception - access violation Image PC Routine Line Source libopenblas.dll 000000006DA5F594 Unknown Unknown Unknown

B.II Msys2 MingW-64

  1. Install msys2
  2. missing the developtment tool --> The installationtool for repo broken use on terminal msys pacman -Syu , then close windows pacman -S base-devel pacman -S gfortran-gcc pacman -S mingw-w64-x86_64-crt-git (for installing the git)
  3. make TARGET=Haswell num_threads=12
  4. it goterror ln: failed to create symbolic link ‘cygopenblas.a’: No such file or directory but got files: cygopenblas.dll libopenblas.dll.a cygopenblas_haswellp-r0.3.8.dev.a
  5. ifort source.f90 libopenblas.dll.a cygopenblas_haswellp-r0.3.8.dev.a output produced but hang on call blas lapack.

Closing as the new 0.3.6 and 0.3.7 packages are now on the sourceforge page as well.

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)

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…

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