Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on macos location of dylib differs from expected. #1

Open
niloch opened this issue Aug 3, 2018 · 0 comments
Open

Building on macos location of dylib differs from expected. #1

niloch opened this issue Aug 3, 2018 · 0 comments

Comments

@niloch
Copy link

niloch commented Aug 3, 2018

On intel i7 2015 MacBook Pro running HighSierra 10.13.5

Mismatch between "os.arch" in sbt.build vs NativeUtils.java path.

In sbt.build os.arch = x86_64.

Building beanpiece libsentencepiece.dylib is placed in /osx/x86_64/libsentencepiece.dylib.

However at runtime when NativeUtils.java attempts to load the appropriate libary it searches in /osx/i386/libsentencepiece.dylib

in NativeUtils path returns i386 due to

private static Architecture architecture() {
        String arch = System.getProperty("os.arch").toLowerCase(Locale.ENGLISH);
         // arch = "x86_64"
        if (arch.contains("ppc")) {
            return Architecture.PPC;
        } else if (arch.contains("i386") || arch.contains("x86")) {
            return Architecture.I386;
        } else if (arch.contains("amd64") || arch.contains("x86_64")) {
            return Architecture.AMD64;
        } else {
            throw new IllegalArgumentException("Unsupported architecture: " + arch);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant