Search code examples
scalasbtscala-breeze

Scala Breeze Unable to load windows 64 dll


Hi I'm trying to use the Breeze library for Scala but keep running into this error:

[error] (run-main) java.lang.ExceptionInInitializerError: unable to load from [netlib-native_system-win-x86_64.dll]

for some reasone that dll won't load when running my code. I'm using SBT, here is my build.st

name := "BreezeTest"

version := "1.0"

scalaVersion := "2.10.3"

libraryDependencies  ++= Seq(
        "org.scalanlp" % "breeze_2.10" % "0.5.2",
        "org.scalanlp" % "breeze-viz_2.10" % "0.5.2"
)

Has anyone else had similar problems or know what might be causing this?

Thanks.


Solution

  • Take a look at the windows section of the readme here: https://github.com/fommil/netlib-java

    Windows

    The native_system builds expect to find libblas3.dll and liblapack3.dll on the %PATH% (or current working directory). Besides vendor-supplied implementations, OpenBLAS provide generically tuned binaries, and it is possible to build ATLAS.>

    Use Dependency Walker to help resolve any problems such as: UnsatisfiedLinkError (Can't find dependent libraries).

    NOTE: OpenBLAS doesn't provide separate libraries so you will have to customise the build or copy the binary into both libblas3.dll and liblapack3.dll whilst also obtaining a copy of libgfortran-1-3.dll, libquadmath-0.dll and libgcc_s_seh-1.dll from MinGW.

    I should add you can also just set these JVM properties; it will be slower, but it will guaranteed to work:

    -Dcom.github.fommil.netlib.BLAS=com.github.fommil.netlib.F2jBLAS
    -Dcom.github.fommil.netlib.LAPACK=com.github.fommil.netlib.F2jLAPACK
    -Dcom.github.fommil.netlib.ARPACK=com.github.fommil.netlib.F2jARPACK
    

    I should probably add an FAQ to Breeze.