Skip to content

Clean up native platform naming across ImageJ2 components #305

@ctrueden

Description

@ctrueden

There are at least four different places where platform naming comes into play:

  1. Bare native libraries for ImageJ/ImageJ2/Fiji. The ImageJ Launcher detects the platform, and sets java.library.path to include a folder lib/<platform>, which currently supports five values: lib/win32, lib/win64, lib/macosx, lib/linux, and lib/linux-amd64. Here is the logic where that is defined.

  2. Native libraries wrapped in JAR files. The ImageJ Updater names the platforms slightly differently: jars/win32, jars/win64, jars/macosx, jars/linux32, and jars/linux64 (there is also tiger, for long-obsolete old versions of Mac OS X). Definitions are here, used in various places around the Updater code. The Updater selects the appropriate platform, marking files automatically as suitable only for the matching platform, for things in the correct lib or jars subdirectory.

  3. Naming of native classifier JARs. For example, jogl-all-2.3.2-natives-linux-i586.jar. Highly inconsistent across projects in the wild. See here and here and here for more discussion. One detail of note is that pom-scijava-base defines a property scijava.platform.arch which is generally equal to Java's os.arch except that for x86-compatible architectures (e.g. x86_64, amd64) it simplifies it down to simply the number (e.g. 64). But for non-x86 e.g. Mac M1's ARM 64-bit architecture it will be the full os.arch value e.g. arm64.

  4. Subdirectory naming convention for native-lib-loader. The native-lib-loader project enables dynamic loading of native libraries from inside JAR files, so that the JARs describe above in (3) can have their wrapped natives loaded easily. We use it in projects like FLIMLib to easily utilize native code from Java. Unfortunately, it has its own incompatible naming convention as well, distinct from (1), (2), and (3) above.

I dislike the inconsistency in naming across these four areas, and would prefer to reconcile and standardize the naming where possible, particularly now that Mac M1 machines are in the wild using ARM architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions