Friday, September 5, 2014

How to run netlib-java/breeze in native mode with BLAS/Lapack binaries on Windows 7 x64

Netlib-java allows fast linear algebra in native mode with BLAS/LAPACK libraries. Breeze is for Scala and is based on netlib as well. The problem is where to get binaries and how to set up netlib-java. So, which libraries are needed?
  • libquadmath-0.dll //MINGW
    libwinpthread-1.dll //MINGW
    libgcc_s_seh-1.dll //MINGW
    libgfortran-3.dll //MINGW
    liblapack3.dll //OpenBLAS copy of libopeblas.dll
    libblas3.dll //OpenBLAS copy of libopenblas.dll
    netlib-native_system-win-x86_64.dll //netlib-java
So, few libs from MINGW, one from OpenBLAS copied two times and one from netlib-java. It is important that all libraries have the same architecture: x64 (or x32). Mixing doesn't work. Here are the links where these libraries exist pre-compiled:

You need to place the needed dlls into the project folder or to some folder that is in PATH. Your maven pom project must have the following entry if you use only netlib-java:
  •       <dependency>
or if you use breeze:
  •     <dependency>
Another option would be to compile OpenBLAS. You will need MINGW64, OpenBLAS sources plus MSYS64: (more details at

  • unzip OpenBLAS sources
  • extract MINGW and MSYS in the same folder, 
  • run msys.bat from MINGW/MSYS folder
  • cd to OpenBLAS sources dir and run "make BINARY=64". After a while you'll get libopenblas.dll


  1. There is nothing specific for Linux. You need to install (or better compile) OpenBlas and make a symlink from to Before using netlib you need to and specify the OpenBlas folder in LD_LIBRARY_PATH.

  2. i tried the above given steps, but still i am facing same problem

  3. This comment has been removed by the author.