Skip to content
Jeremy B edited this page Mar 13, 2023 · 6 revisions

JOGL is the 3D library NetLogo uses for its 3D view. This is used by NetLogo 3D, the 3D view in regular 2D NetLogo, and in the View2.5D extension.

Getting it bundled for inclusion in NetLogo takes a little extra work. The JOGL libraries themselves are included as normal in the build.sbt file. But JOGL depends on architecture-specific native libraries per architecture to run properly. These native libraries have to be packaged together during the build process, and copied into the NetLogo installation files (see NativeLibs.scala).

These native libraries are posted on the ccl-artifacts Amazon S3 bucket so they can be pulled down by anyone doing development with NetLogo.

Updating the JOGL Natives Package

  • From the JOGL repo in the jar folder of the version you want to use (like https://jogamp.org/deployment/archive/rc/v2.4.0/jar/), download all of the jogl-all-natives-*.jar files for linux-amd64, linux-i586, maxos-universal, windows-amd64, and windows-i586 (the 5 architectures desktop NetLogo runs on). Then do the same for the gluegen-rt-natives-*.jar files.
    • As of version 2.4.0 of JOGL, it seems like they are not packaging 32 bit native libraries anymore. For now, since we'd been using the 2.4.0 release candidate ones in our production builds, those RC libraries are bundled to our 2.4.0 final package. In the future we may have to address this differently.
  • Unzip all 10 of those jar files.
  • In the extracted folders for each, there should be a natives folder and inside that a folder with the "short" architecture name. For example, jogl-all-natives-linux-amd64.jar has a folder natives/linux-amd64/ once extracted. Copy that folder out into a new folder for building the final zip file. Then merge in the gluegen-rt-natives-*.jar version. You should have so, dylib or dll files in each of the 5 subfolders. See the existing native libs bundle for comparison (like https://s3.amazonaws.com/ccl-artifacts/natives/jogl-2.4.0-natives-rc-20200307.zip).
  • Zip those folders together into the jogl-#.#.#-natives-#EXTRA-VERSION.zip file.
  • Upload that file to the ccl-artifacts bucket on Amazon S3, mark it read-only for the public.
  • Do a quick test download.
  • Once the paths are updated in build.sbt and NativeLibs.scala in your local NetLogo repository, do a test update, build, and run of NetLogo 3D. It might be a good idea to clean first, to make sure no existing JOGL libraries are left behind. Here is a sample commit updating JOGL in NetLogo.

There is probably an easier way to do this. JOGL provides an "all" package, but we haven't looked into if it'd be easier to modify our "natives installer" to use it instead of going through these rote steps with each release. Also, JOGL provides "native libs in jars" which should let us include these dependencies as normal jars but we haven't put much time into getting that to work, either.

Clone this wiki locally