jblas-project / jblas

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

System.mapLibraryName returns suffix 'dylib' and not 'jnilib' using JDK 7 on OS X #19

Closed mlehman closed 11 years ago

mlehman commented 11 years ago

I'm not sure what the best solution is for handling this, but for me the easiest solution was to re-package with a second copy of all the jnlib libraries using the alternate suffix.

For similar see: https://github.com/xerial/snappy-java/issues/6

mikiobraun commented 11 years ago

Hi,

so did I understood correctly, the expected name for DLLs has changed between JDK 6 and 7? dylib for JDK 7 and jnilib for JDK 6?

mlehman commented 11 years ago

Yes, on JDK7 it looks for the native libraries with the .dylib extension which resulted in an UnsatisfiedLinkError.

Looking at other projects affected, the simplest solution seems to be just to include copies with both versions of the file extension.

mikiobraun commented 11 years ago

Ah I see... But given that I already have all those really big shared libs in there, I think I'd rather hack something together to copy the library if that happens... .

mikiobraun commented 11 years ago

I just committed a patch which detects when the library name ends in .dylib and uses the .jnilib ending instead. Works on my colleagues Mac with Java 7. Let me know if it works for you as well.

mlehman commented 11 years ago

Yep! Works for me too.

mikiobraun commented 11 years ago

alright, awesome!