Skip to content

Instantly share code, notes, and snippets.

@AlexDBlack
Last active March 6, 2016 06:46
Show Gist options
  • Save AlexDBlack/c34e95fd08c0e9b3891b to your computer and use it in GitHub Desktop.
Save AlexDBlack/c34e95fd08c0e9b3891b to your computer and use it in GitHub Desktop.
Installing OpenBLAS on Windows x64 + linking to netlib-java (tested on Windows 8.1)
Following build instructions as per https://github.com/xianyi/OpenBLAS/wiki/Installation-Guide but with some additional details + details for linking with netlib-java
git clone https://github.com/xianyi/OpenBLAS.git
into c:/Temp/ for example
Using MSYS + MinGW-w64:
MSYS as per the recommended version in OpenBLAS guide. Extract to c:/msys
MinGW-w64: rubenvb 64-bit version http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.7-release/
Using fourth in list: x86_64-w64-mingw32-gcc-4.7.4-release-win64_rubenvb.7z
Others are incorrect versions for Windows 64 (and will give obscure errors, found out the hard way)
Set up path environment variable to point to appropriate \bin folders (C:\mingw64\bin and C:\mingw64\x86_64-w64-mingw32\bin)
Open c:\msys\msys.bat
cd c:/Temp/OpenBLAS
make
Result with incorrect mingw versions: "gcc.exe: error: CreateProcess: No such file or directory" and a few other errors, or cygwin1.dll errors
Result wit correct mingw version: Build completes successfully
Copy libopenblas.dll into c:\BLAS (or wherever, just has to be on path)
Make 2 additional copies of the above, called libblas3.dll and liblapack3.dll
Copy dlls in c:\mingw64\bin into c:\BLAS
Add c:\BLAS to system PATH environment variable
////////////////////////////////////////////////////////////////////////////////
OpenBLAS on Windows 32-bit using pre-compiled binaries
Using precompiled binaries - if they work - can be easier than building OpenBLAS from source.
The downide of them is they cannot be optimized to your specific CPU architecture, and hence won't be as fast as compiling from source.
Binaries are available here:
http://sourceforge.net/projects/openblas/files/
For Windows 32 bit, the process is as follows:
1. Download OpenBLAS-v0.2.14-Win32.zip (or later version, if available)
2. Download mingw32_dll.zip
3. Extract both zip to some location, such as C:\BLAS (exact location doesn't matter)
4. Make 2 additional copies of libopenblas.dll, called libblas3.dll and liblapack3.dll
5. Add the folder from step 3 to system PATH environment variable (Control Panel -> System -> Advanced System Settings -> Environment Variables)
////////////////////////////////////////////////////////////////////////////////
OpenBLAS on Windows 64-bit using pre-compiled binaries
The process (and performance caveats) for 64-bit versions of Windows is essentially identical to the 32-bit instructions above.
However, use the following files instead of the 32-bit versions listed above:
- OpenBLAS-v0.2.14-Win64-int32.zip
- mingw64_dll.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment