ihmcrobotics / ihmc-native-library-loader

Simple helper library to load native libraries from a .jar bundle
Apache License 2.0
3 stars 3 forks source link

[feature PR] ARM support #3

Open Adito5393 opened 3 years ago

Adito5393 commented 3 years ago

Would you be interested in a PR to:

  1. Allow your tool to load a library if the system is ARM (tested on Raspberry Pi 4B). Additional code to NativeLibraryLoader.java file:

    if (isRpiARM()) {
      platform = Platform.LINUX32;
    } else if {
    // same code...
    private static boolean isRpiARM() {
      return SystemUtils.IS_OS_LINUX && (SystemUtils.OS_ARCH.equals("arm"));
    }
  2. Change the native word from the project name to nat because with the introduction of Java automatic name in JDK9, native is a protected word and can not be used in the module name (that is automatically generated from the project name by the maven compiler plugin).

jespersmith commented 3 years ago

Sorry for the late reply, but yes a PR would be appreciated.

varunagrawal commented 2 years ago

ARM would have to also consider Apple Silicon. I'm currently using

private static boolean isARM_64()
{
    String os = System.getProperty("os.arch");
    return os.contains("aarch") && os.contains("64");
}

as an additional function, so I guess this should be renamed to isApple_64 and for RPi have it as isARM_64?

jespersmith commented 2 years ago

We're working on a new release. I just wait for an arm system to be available

https://github.com/ihmcrobotics/ihmc-native-library-loader/tree/feature/armsupport