Summary: | Provide a JogAmp Big Fat Jar for Beginners [convenient, but inefficient] | ||
---|---|---|---|
Product: | [JogAmp] General | Reporter: | Sven Gothel <sgothel> |
Component: | builds | Assignee: | Xerxes Rånby <xerxes> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | gouessej, xerxes |
Priority: | --- | ||
Version: | 2.3.2 | ||
Hardware: | All | ||
OS: | all | ||
Type: | FEATURE | SCM Refs: |
gluegen 0240a71c56c1108da6863a2bb34e971ac6a4e061
gluegen cb2c86e887d1ae8a29eab5e3967b6ec99d853218
jogl 3f13a60ca428ed879ad2ac551f7bd808b9ba44a9
jogamp-scripting e58bf0a5418a777ae79387df1a24a6907df686ba
jogamp-scripting 0283ed5a7bf9401161845b11179f8689eafdd7a2
jogamp-scripting 6fa617357f82d015e4bfc959b3f38095d66b0b5a
gluegen bf4d8786cb732d86db333b43020ecf0af27f60bf
gluegen 32f09a5894ce3b157d5439df83703fa6f5336ff4
gluegen 73bb0ada4c77ef86d37747532f4807e0ec0ab51d
|
Workaround: | --- | ||
Bug Depends on: | 843, 1032 | ||
Bug Blocks: |
Description
Sven Gothel
2015-03-10 10:48:40 CET
(In reply to comment #0) > > The one big fat jar file then contains: > - all modules java-jar > - all modules and all platforms native jar We should also see how to handle the API doc here, i.e. [1] add it to the big fat jar file, _or_ [2] also provide a big far source zip file Since [2] would somewhat spoil the intention (one file), IMHO we should target for [1]. Should the JogAmp big fat JAR contain both mobile (Android) and desktop native libraries? I remember that I had to remove the Android natives from the directory of the classpath because they were loaded under GNU Linux :s In my humble opinion, we should check that when a developer puts the JARs of the native libraries into the same directory (even those not required by the platform), the proper ones are always loaded and GlueGen never tries to load Android native libraries under GNU Linux. We'll need to update the wiki, especially if the JogAmp big fat JAR contains the source code and the documentation. As some web browsers still modify the JARs for security purposes (they break them by putting them into ZIP archives), this JogAmp big fat JAR should still be put into a 7z archive. gluegen 0240a71c56c1108da6863a2bb34e971ac6a4e061 New distributed files in 'dist' subfolder for producing fat files via jogamp-scripting: dist/jogamp-fat.mf dist/jogamp-test-fat.mf dist/junit.jar jogamp-scripting e58bf0a5418a777ae79387df1a24a6907df686ba Provide JogAmp Big Fat Jars and Fat 7z Archive New files: - fat/jogamp-fat.jar - fat/jogamp-fat-test.jar - fat/jogamp-fat-java-src.jar - archive/jogamp-fat-all.7z jogamp-scripting 0283ed5a7bf9401161845b11179f8689eafdd7a2 - Add fat/jogamp-fat-test-java-src.jar fat jars will be visible w/ next aggregated build, i.e. tomorrow. gluegen cb2c86e887d1ae8a29eab5e3967b6ec99d853218 Use 'Main-Class' for default launch of useful info/demos jogl 3f13a60ca428ed879ad2ac551f7bd808b9ba44a9 Add default main entry test TestGearsES2SimpleNEWT jogamp-scripting 6fa617357f82d015e4bfc959b3f38095d66b0b5a Add oculusvr jars +++ i.e. fat jars can be launched directly via 'java -jar jogamp-fat.jar' and 'java -jar jogamp-fat-test.jar'. (In reply to comment #2) > Should the JogAmp big fat JAR contain both mobile (Android) and desktop > native libraries? I remember that I had to remove the Android natives from > the directory of the classpath because they were loaded under GNU Linux :s > In my humble opinion, we should check that when a developer puts the JARs of > the native libraries into the same directory (even those not required by the > platform), the proper ones are always loaded and GlueGen never tries to load > Android native libraries under GNU Linux. > > We'll need to update the wiki, especially if the JogAmp big fat JAR contains > the source code and the documentation. As some web browsers still modify the > JARs for security purposes (they break them by putting them into ZIP > archives), this JogAmp big fat JAR should still be put into a 7z archive. All implemented .. and build available: <http://jogamp.org/deployment/archive/master/gluegen_876-joal_603-jogl_1414-jocl_1066/archive/jogamp-fat-all.7z> <http://jogamp.org/deployment/archive/master/gluegen_876-joal_603-jogl_1414-jocl_1066/fat/> - not including Android natives - launchable Corner Case 1: jogamp modules fail to load the natives if you unpack the fat-jar. gluegen JNILibLoaderBase needs to be updated to look for natives in the natives/${os.and.arch}/ located on the classpath as a fallback to support using an unpacked fat-jar. Testcase: mkdir fat-test cd fat-test wget http://jogamp.org/deployment/archive/master/gluegen_882-joal_608-jogl_1422-jocl_1071-signed/fat/jogamp-fat.jar wget wget http://jogamp.org/deployment/archive/master/gluegen_882-joal_608-jogl_1422-jocl_1071-signed/fat/jogamp-fat-test.jar unzip -o jogamp-fat-test.jar unzip -o jogamp-fat.jar java -cp . com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo xranby@Xerxes-ESPRIMO:~/fat-test$ java -cp . com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo Desired win size 800x400 Desired win pos 10/10 Scene MSAA Samples 0 Graph MSAA Samples 0 Graph VBAA Samples 4 Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /home/xranby/fat-test/libgluegen-rt.so at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854) at java.lang.Runtime.load0(Runtime.java:795) at java.lang.System.load(System.java:1062) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:596) at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63) at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:95) at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:459) at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:421) at com.jogamp.common.os.Platform$1.run(Platform.java:317) at java.security.AccessController.doPrivileged(Native Method) at com.jogamp.common.os.Platform.<clinit>(Platform.java:287) at com.jogamp.opengl.GLProfile.<clinit>(GLProfile.java:146) at com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo.main(GPUTextNewtDemo.java:103) (In reply to comment #7) > Corner Case 1: jogamp modules fail to load the natives if you unpack the > fat-jar. > gluegen JNILibLoaderBase needs to be updated to look for natives in the > natives/${os.and.arch}/ located on the classpath as a fallback to support > using an unpacked fat-jar. Branch to merge: https://github.com/xranby/gluegen/tree/bug1145 Fixes Bug 1145 cc1 when using an unpacked fat-jar By add current working directory + natives/os-arch/ + library names to enumerateLibraryPaths Corner Case 2: null versions reported using the fat-jar Testcase: java -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow outputs null versions: ----------------------------------------------------------------------------------------------------- Package: com.jogamp.gluegen Extension Name: null Specification Title: null ... Implementation Commit: null ----------------------------------------------------------------------------------------------------- Package: com.jogamp.opengl Extension Name: null ... Implementation Commit: null (In reply to comment #9) > Corner Case 2: null versions reported using the fat-jar > > Testcase: > java -cp jogamp-fat.jar com.jogamp.newt.opengl.GLWindow > > outputs null versions: > ----------------------------------------------------------------------------- > ------------------------ > Package: com.jogamp.gluegen > Extension Name: null > Specification Title: null > ... > Implementation Commit: null > ----------------------------------------------------------------------------- > ------------------------ > Package: com.jogamp.opengl > Extension Name: null > ... > Implementation Commit: null This information is extracted from the manifest as far as I know. See: https://github.com/sgothel/gluegen/blob/master/src/java/com/jogamp/common/GlueGenVersion.java#L49 https://github.com/sgothel/jogl/blob/master/src/jogl/classes/com/jogamp/opengl/JoglVersion.java#L54 gluegen bf4d8786cb732d86db333b43020ecf0af27f60bf Fix cc1 NativeLibrary: Add current working directory + natives/os-arch/ + library names Fixes Bug 1145 cc1 when using an unpacked fat-jar gluegen 32f09a5894ce3b157d5439df83703fa6f5336ff4 Fix cc2: Null versions reported using the fat-jar (JogampVersion) In case we run fat-jar file, the package name is 'com.jogamp' and all entries are based upon GlueGen. JogampVersion will fall back trying to find a fat-jar Manifest in case a null Manifest is being passed. 73bb0ada4c77ef86d37747532f4807e0ec0ab51d JNILibLoaderBase.addNativeJarLibsImpl: Proper order: #1 single-slim-jar, #2 fat-jar, #3 Classpath + TAG.class We shall attempt the official recommendation of deployment first (single-slim-jar) not wasting time trying a 'nativeLibraryPath' lookup within the classpath. |