Packaging of JCUDA 0.6.0 on Mac OSX 10.9.3

367 Views Asked by At

I was able to compile the native 0.6.0 libraries of JCuda on a Mac OSX 10.9.3 64-bit system (http://www.jcuda.org/downloads/downloads.html). Unfortunately Im not smart enough to package everything into a jar. Can someone help me to do so? I created a Netbeans project and copied the contents of all provided Java src folders into it. Then I packaged everything into a jar. Using Jarsplice 0.4.0 I then tried to build a Jar file containing all the native library files listed below (except the first .a file). Unfortunately when I linked the resulting jar into my project and run it, it wasnt working since a libJCudaRuntime-apple-x86_64.jnilib was missing.

Thank you in advance Radek

My lib folder contains: libCommonJNI.a libJCublas-apple-x86_64.dylib libJCublas2-apple-x86_64.dylib libJCudaDriver-apple-x86_64.dylib libJCudaRuntime-apple-x86_64.dylib libJCufft-apple-x86_64.dylib libJCurand-apple-x86_64.dylib libJCusparse-apple-x86_64.dylib

1

There are 1 best solutions below

0
On BEST ANSWER

Just to have this answered here as well: The native libraries can not be packed directly into a JAR (or rather: They can currently not be loaded if they are only contained in the JAR).

Although the infrastructure of the JCuda LibUtils class basically offers the possibility to do this, it is not "officially" supported. One reason for that is that this would only make sense when all native libraries for all operating systems were available (in 32 and 64 bit). Then it would be possible to put all these libraries into a JAR, and unpack and load them transparently at runtime.

It usually takes a while until all native libraries are available. The problem may be alleviated with things like https://github.com/MysterionRise/mavenized-jcuda , which manages the dependencies to the native libraries.