HelloJOCL requesting "jogamp/natives/" folder

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HelloJOCL requesting "jogamp/natives/" folder

Eric Barnhill
HelloJOCL compiles but (prior to fix below) gives the runtime error:

 Can't load library: /home/[...]/jogamp/natives/linux-amd64//libgluegen-rt.so

Not surprising, since I've followed the jogamp build instructions and this has only given me the folders: jogamp/gluegen, jogamp/jocl, jogamp/jogl .

So I created the folder jogamp/natives/linux-amd64/ and copied in libgluegen-rt.so from /gluegen/build/obj/libgluegen-rt.so,  and it runs fine.

But I am worried I have set myself up for problems down the road. Was this the right thing to do?

Reply | Threaded
Open this post in threaded view
|

Re: HelloJOCL requesting "jogamp/natives/" folder

Xerxes Rånby
This post was updated on .
"normally" you include gluegen-rt.jar and jocl.jar on the classpath

gluegen-rt will then look for its natives inside the jar gluegen-rt-natives-linux-amd64.jar next to the gluegen-rt.jar and jocl.jar will look for its natives inside jocl-natives-linux-amd64.jar next to the jocl.jar
if that fail then it will try load the natives from the natives/linux-amd64 inside the main jar
and if that also fail then it will try load the natives from the natives/linux-amd64/  folder on the filesystem.

example 1 if you have built gluegen jocl and jocl-demos manually then the following command line will launch HelloJOCL
java -cp jocl-demos/build/jar/jocl-demos.jar:gluegen/build/gluegen-rt.jar:jocl/build/jar/jocl.jar com/jogamp/opencl/demos/hellojocl/HelloJOCL


example 2 if you use the pre-build jogamp release then the following command lines will launch HelloJOCL. This example uses the "slim" jar layout.
wget http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1451-jocl_1094-signed/archive/jogamp-all-platforms.7z
wget http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1451-jocl_1094-signed/archive/jocl-demos.7z
7z x jogamp-all-platforms.7z
7z x jocl-demos.7z
java -cp jocl-demos/jar/jocl-demos.jar:jogamp-all-platforms/jar/gluegen-rt.jar:jogamp-all-platforms/jar/jocl.jar com/jogamp/opencl/demos/hellojocl/HelloJOCL


example 3 if you use the pre-build jogamp release then the following command lines will launch HelloJOCL. This example uses the "fat" jar layout. The jogamp-fat.jar contains all the natives for all jogamp modules and platforms we support.
wget http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1451-jocl_1094-signed/fat/jogamp-fat.jar
wget http://jogamp.org/deployment/archive/master/gluegen_896-joal_622-jogl_1451-jocl_1094-signed/archive/jocl-demos.7z
7z x jocl-demos.7z
java -cp jocl-demos/jar/jocl-demos.jar:jogamp-fat.jar com/jogamp/opencl/demos/hellojocl/HelloJOCL

Reply | Threaded
Open this post in threaded view
|

Re: HelloJOCL requesting "jogamp/natives/" folder

Eric Barnhill
Thanks, issue solved.

I had gluegen.jar as well as gluegen-rt.jar on the classpath and that was why it didn't work. When I took gluegen.jar out of the classpath, it worked. Also it worked if I had both of those, and also included jocl-natives-linux-amd64.jar . But it did not work when I had gluegen.jar and gluegen-rt.jar without the third. That was the issue.

(I built from source so used option 1.)