jblas-project / jblas

Linear Algebra for Java
http://jblas.org
BSD 3-Clause "New" or "Revised" License
590 stars 149 forks source link

Error configuring jBlas to use OpenBlas #53

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

I am trying to configure jBlas in a way that will enable me to use OpenBlas with it. I have followed the instructions given in https://github.com/mikiobraun/jblas/pull/51. When I try executing the configure command, an error prompts indicating some libraries could not be found:

./configure --static-libs --libpath=$HOME/openblas/lib --download-lapack --lapack-build

Where HOME/openblas/lib indicates my custom installation location. The followings are the error and the log generated in the file configure.log

checking for java, javac... ok
determining operating system... ok (Linux)
determining architecture... ok (amd64)
determining architecture flavor... ok (sse3)
looking for nm... ok
locating the Java Development Kit... ok (/usr/lib/jvm/java-7-openjdk-amd64)
Setting up gcc and flags... ok (gcc)
deciding whether to use g77 or gfortran... ok (gfortran)
looking for version of make... ok (make)
search for lapack sources (configure by --lapack=dir)... ok (./lapack-lite-3.1.1)
determining build type... ok (static)
getting library path...... ok (["/home/ubuntu/openblas/lib"])
determining whether to build for lapack or atlas... ok (lapack)
looking for libraries...... *failed*

Configuration failed!

Reason: Could not locate libraries for the following symbols: dsyev_, daxpy_, dgemm_.

configure.log:

Searching for command java
Searching for command javac
Setting FOUND_JAVA to true
Setting OS_NAME to Linux
Setting OS_ARCH to amd64
Searching for command gcc
Setting OS_ARCH_WITH_FLAVOR to amd64/sse3
Searching for command nm
Setting NM to nm
Setting FOUND_NM to true
Searching for file /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h
Setting JAVA_HOME to /usr/lib/jvm/java-7-openjdk-amd64
Searching for command gcc
Searching for command make
Searching for command ld
Setting CC to gcc
Setting CFLAGS to -fPIC
Setting INCDIRS to ["-Iinclude -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux"]
Setting SO to so
Setting LIB to lib
Setting RUBY to ruby
Setting LDFLAGS to ["-shared"]
Setting F77 to gfortran
Setting LD to gcc
Setting CCC to c99
Setting MAKE to make
Searching for file ./lapack-lite-3.1.1/BLAS/SRC/dgemm.f
Searching for file ./lapack-lite-3.1.1/SRC/dsyev.f
Setting LAPACK_HOME to ./lapack-lite-3.1.1
Setting LINKAGE_TYPE to static
Setting libpath to ["/home/ubuntu/openblas/lib"]
Setting BUILD_TYPE to lapack

I wonder what the problem could be. It seems a rather straightforward process, and I fail to identify what mistake I am doing. Any help would be appreciated.

mikiobraun commented 9 years ago

Have a look at the #51 and the changes to config_libs.rb.

that way you tell him to look for the openblas lib also, and that has the symbols which are currently missing.

Hope this helps,

Mikio

On Wed, Oct 8, 2014 at 12:40 PM, Iriasthor notifications@github.com wrote:

Hi,

I am trying to configure jBlas in a way that will enable me to use OpenBlas with it. I have followed the instructions given in #51 https://github.com/mikiobraun/jblas/pull/51. When I try executing the configure command, an error prompts indicating some libraries could not be found:

./configure --static-libs --libpath=$HOME/openblas/lib --download-lapack --lapack-build

Where HOME/openblas/lib indicates my custom installation location. The followings are the error and the log generated in the file configure.log

checking for java, javac... ok determining operating system... ok (Linux) determining architecture... ok (amd64) determining architecture flavor... ok (sse3) looking for nm... ok locating the Java Development Kit... ok (/usr/lib/jvm/java-7-openjdk-amd64) Setting up gcc and flags... ok (gcc) deciding whether to use g77 or gfortran... ok (gfortran) looking for version of make... ok (make) search for lapack sources (configure by --lapack=dir)... ok (./lapack-lite-3.1.1) determining build type... ok (static) getting library path...... ok (["/home/ubuntu/openblas/lib"]) determining whether to build for lapack or atlas... ok (lapack) looking for libraries...... failed

Configuration failed!

Reason: Could not locate libraries for the following symbols: dsyev, daxpy, dgemm_.

configure.log:

Searching for command java Searching for command javac Setting FOUND_JAVA to true Setting OS_NAME to Linux Setting OS_ARCH to amd64 Searching for command gcc Setting OS_ARCH_WITH_FLAVOR to amd64/sse3 Searching for command nm Setting NM to nm Setting FOUND_NM to true Searching for file /usr/lib/jvm/java-7-openjdk-amd64/include/jni.h Setting JAVA_HOME to /usr/lib/jvm/java-7-openjdk-amd64 Searching for command gcc Searching for command make Searching for command ld Setting CC to gcc Setting CFLAGS to -fPIC Setting INCDIRS to ["-Iinclude -I/usr/lib/jvm/java-7-openjdk-amd64/include -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux"] Setting SO to so Setting LIB to lib Setting RUBY to ruby Setting LDFLAGS to ["-shared"] Setting F77 to gfortran Setting LD to gcc Setting CCC to c99 Setting MAKE to make Searching for file ./lapack-lite-3.1.1/BLAS/SRC/dgemm.f Searching for file ./lapack-lite-3.1.1/SRC/dsyev.f Setting LAPACK_HOME to ./lapack-lite-3.1.1 Setting LINKAGE_TYPE to static Setting libpath to ["/home/ubuntu/openblas/lib"] Setting BUILD_TYPE to lapack

I wonder what the problem could be. It seems a rather straightforward process, and I fail to identify what mistake I am doing. Any help would be appreciated.

— Reply to this email directly or view it on GitHub https://github.com/mikiobraun/jblas/issues/53.

Mikio Braun - http://blog.mikiobraun.de, http://twitter.com/mikiobraun

ghost commented 9 years ago

Hi,

I thought this modification was already included in config_libs.rb, what an innocent mistake of mine. After including it, it now allows me to make the configuration properly.

Thank you for the quick and useful reply. /Mikel

osmanbaskaya commented 8 years ago

Hey Mikel,

When I add --libs=openblas, dsyev, daxpy symbols are resolved. However, in order to resolve dgemm_ I had to add lapack (--libs=openblas,lapack). Is that what you did, too?