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

Introduce macosx-arm64 to presets for libpostal #1205

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

MasseGuillaume
Copy link
Contributor

No description provided.

@saudet saudet merged commit 54d33ac into bytedeco:master Aug 11, 2022
@MasseGuillaume MasseGuillaume deleted the libpostal-arm64 branch August 11, 2022 14:03
@MasseGuillaume
Copy link
Contributor Author

Hi @saudet, I tried the library on my mac m1 but it fails at runtime with:

Checking for new libpostal data file...
libpostal data file up to date
Checking for new libpostal parser data file...
libpostal parser data file up to date
Checking for new libpostal language classifier data file...
libpostal language classifier data file up to date
dyld[38785]: missing symbol called

Apparently, this is a sign the architecture of the library is incorrect. However, if I unpack the jar, the library looks ok

otool -hv libpostal.1.dylib
libpostal.1.dylib:
Mach header
      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64   X86_64        ALL  0x00       DYLIB    14       1696   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS

do you have an idea of what went wrong?

Thanks,
Guillaume

@saudet
Copy link
Member

saudet commented Aug 11, 2022

It's saying "X86_64", doesn't this need to be "ARM64"?

@MasseGuillaume
Copy link
Contributor Author

oh you are right, I was looking at the other dynamic library where the architecture is correct:

otool -hv libjnipostal.dylib  libpostal.1.dylib

libjnipostal.dylib:
Mach header
      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64    ARM64        ALL  0x00       DYLIB    18       1808   NOUNDEFS DYLDLINK TWOLEVEL WEAK_DEFINES BINDS_TO_WEAK NO_REEXPORTED_DYLIBS


libpostal.1.dylib:
Mach header
      magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
MH_MAGIC_64   X86_64        ALL  0x00       DYLIB    14       1696   NOUNDEFS DYLDLINK TWOLEVEL NO_REEXPORTED_DYLIBS

hum so the cppbuild.sh must be incorrect: https://github.com/bytedeco/javacpp-presets/pull/1205/files#diff-ae4eed1b337db40a14189f50b893c841de813757ab17c9f41e6d903263ab6f86R45

@saudet
Copy link
Member

saudet commented Aug 11, 2022

To get cross compilation working with Autotools (or CMake for that matter), you'll probably need to set CC="clang -arch arm64 -fPIC" and CXX="clang++ -arch arm64 -fPIC" like this:
https://github.com/bytedeco/javacpp-presets/blob/master/leptonica/cppbuild.sh#L471

@MasseGuillaume
Copy link
Contributor Author

ok got it, I'm really sorry:

#1207

@saudet
Copy link
Member

saudet commented Aug 11, 2022

There's actually no C++ files in libpostal, so we should be able to do the same as libffi. Could you test only with CC="clang -arch arm64?

@saudet
Copy link
Member

saudet commented Nov 3, 2022

This has been released with version 1.5.8. Thanks for the contribution!

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

Successfully merging this pull request may close these issues.

None yet

2 participants