Login  Register

Re: JogAmp Build v2.4.0-rc-20210111

Posted by Sven Gothel on Jan 19, 2021; 10:20am
URL: https://forum.jogamp.org/JogAmp-Build-v2-4-0-rc-20210111-tp4040955p4040982.html

On 1/18/21 6:12 PM, Manu [via jogamp] wrote:
> Today, I tried again to build universal .dylib files under Catalina and XCode
> 12.3, and this time it worked, so it could worth to try with the Mac used to
> build and deliver JOGL.

Thank you, I will give it a try this month.

> On my side, the difference was that I built this time
> Gluegen and JOGL in a virtual machine but there must have been something else.
>
> The only difficulty was to succeed to link with libjawt.dylib for ARM under an
> Intel computer. I tried to set DYLD_LIBRARY_PATH env variable but it didn't work.
> So here's the solution to build Gluegen and JOGL for Mac ARM that I used:
> - download Zulu OpenJDK 11
> <https://www.azul.com/downloads/zulu-community/?version=java-11-lts&os=macos&package=jdk> for
> x86_64 *and* arm64
> - install Zulu OpenJDK 11 for x86_64 in /Library/Java/JavaVirtualMachines to
> use it for build process
> - unzip Zulu OpenJDK 11 for arm64 somewhere on your disk and prepare a
> universal libjawt.dylib file for x86_64 and arm64 with a command similar to:
>
> lipo /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/libjawt.dylib /path/to/zulu11.43.1021-ca-jdk11.0.9.1-macosx_aarch64/zulu-11.jdk/Contents/Home/lib/libjawt.dylib -output /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/libjawt.dylib -create
>
> - check libjawt.dylib is universal with the command:
>
> lipo /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/lib/libjawt.dylib -info
>
> - get Gluegen and JOGL with Git as explained at
> http://forum.jogamp.com/jogl/doc/HowToBuild.html
> - before running Ant scripts, edit /gluegen/make/gluegen-cpptasks-base.xml/ to
> replace "x86_64" by "arm64" in the following lines:
>
> <compilerarg value="x86_64" if="use.macosx64"/>
> <linkerarg value="x86_64" if="use.macosx64"/>
>
> - run Ant scripts
> - pick generated .dylib files in
> /gluegen/build/gluegen-rt-natives-macosx-universal.jar/ and
> /jogl/build/jar/jogl-all-natives-macosx-universal.jar/ files
> - finally, if you want universal .dylib files use /lipo/ command to combine
> x86_64 and arm64 .dylib files, with commands similar to:
>
> lipo path/to/arm64/libgluegen_rt.dylib path/to/x86_64/libgluegen_rt.dylib -output path/to/universal/libgluegen_rt.dylib -create
>
>
> Sven, I hope you'll be able to adapt your Ant scripts to perform these
> operations.
That part should be easy, as long I get the right tools in place, see above.

Thank you for digging out the details.

~Sven

--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; fax : +49 (471) 4707741
Timezone CET: PST+9, EST+6, UTC+1


signature.asc (849 bytes) Download Attachment