jblas-project / jblas

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

reopen: Windows 64 Library Missing Dependencies? #11

Closed hanneshorn closed 11 years ago

hanneshorn commented 13 years ago

Mikio,

I'm having real problems accessing the 64bit jblas.dll due to those pesky dependent libs., even when having them all in my Windows PATH. Would you mind building this 64bit jblas.dll without the '-shared' option and post it on https://github.com/mikiobraun/jblas/downloads? This may circumvent having these missing dependencies.

Thanks a bunch,

Hans

mikiobraun commented 13 years ago

Hello Hans,

in principle this would be no problem, but I'm not sure I understood what you wanted. Do you mean that you want a jblas.dll which does not contain any of the libraries (even not the ATLAS libraries)?

If you're refering to the "-shared" option passed to the linker, I think it is necessary to create a DLL at all (as opposed to a static library), so it cannot be dropped... .

-M

hanneshorn commented 13 years ago

On 4/13/2011 6:35 AM, mikiobraun wrote:

Hello Hans,

in principle this would be no problem, but I'm not sure I understood what you wanted. Do you mean that you want a jblas.dll which does not contain any of the libraries (even not the ATLAS libraries)?

If you're refering to the "-shared" option passed to the linker, I think it is necessary to create a DLL at all (as opposed to a static library), so it cannot be dropped... .

-M

Hallo Mikio,

when attempting to load the shared 64bit library jblas.dll (with the path to the 64bit gfortran runtime on the Windows PATH), I get jblas.dll: %1 is not a valid Win32 application at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at JBlasTest.(JBlasTest.java:4)

Some experimenting made me believe one could bypass this problem by not using '-shared' when linking. However, the latter produces a "missing WinMain" error. Its was suggested on the web to define an empty 'int main(void) { return 0; }'
in the JNI C wrapper. However, when doing so, the resulting dll crashes the JVM instantly when trying to load it (64bit in my case; dunno about 32 bit). Having said this, please ignore my request to building a static jblas.dll.

However, have you ever encountered this : jblas.dll: %1 is not a valid Win32 application.

If so, do you know a workaround?

Gruss, Hans