Github user maropu commented on a diff in the pull request:

    https://github.com/apache/incubator-hivemall/pull/80#discussion_r117657316
  
    --- Diff: xgboost/src/main/java/hivemall/xgboost/NativeLibLoader.java ---
    @@ -54,15 +55,47 @@ private static boolean hasResource(String path) {
         }
     
         private static String getOSName() {
    -        return System.getProperty("os.name");
    +        return System.getProperty("os.name").toLowerCase();
    +    }
    +
    +    private static String getOSArch() {
    +        return System.getProperty("os.arch").toLowerCase();
    +    }
    +
    +    private static String getOSArchString() {
    +        String os = getOSName();
    +        if(os.startsWith("linux")) {
    +            os = "linux";
    +        } else if(os.startsWith("mac")) {
    +            os = "darwin";
    +        } else if(os.startsWith("windows")) {
    +            os = "windows";
    +        }
    +
    +        String arch = getOSArch();
    +        if(arch.equals("amd64") || arch.equals("x86_64")) {
    +            arch = "x64";
    +        } else if(arch.endsWith("86")) {
    +            arch = "x86";
    +        } else if(arch.indexOf("arm64") != -1) {
    +            arch = "arm64";
    +        } else if(arch.indexOf("armv6") != -1) {
    +            arch = "armv6";
    +        } else if(arch.indexOf("armv7") != -1) {
    +            arch = "armv7";
    +        } else if(arch.indexOf("ppc") != -1) {
    +            arch = "ppc64le";
    +        }
    +
    +        return os + "-" + arch;
    --- End diff --
    
    I think you could refer [the 
code](https://github.com/xerial/snappy-java/blob/master/src/main/java/org/xerial/snappy/OSInfo.java)
 in `snappy-java` to handle almost all the case for detecting arch.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to