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

make native stopped working for mac64 #257

Closed
xerial opened this issue Sep 8, 2020 · 12 comments · Fixed by #264
Closed

make native stopped working for mac64 #257

xerial opened this issue Sep 8, 2020 · 12 comments · Fixed by #264
Labels

Comments

@xerial
Copy link
Owner

xerial commented Sep 8, 2020

make native-all fails with the following error:

cd target/snappy-1.1.7-Mac-x86_64 && cmake  ../../target/snappy-1.1.7
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.1 or higher is required.  You are running version 3.0.2


-- Configuring incomplete, errors occurred!
Makefile:83: recipe for target 'target/snappy-1.1.7-Mac-x86_64/CMakeCache.txt' failed
make: *** [target/snappy-1.1.7-Mac-x86_64/CMakeCache.txt] Error 1
make: *** [mac64] Error 2
@xerial xerial self-assigned this Sep 8, 2020
@xerial
Copy link
Owner Author

xerial commented Sep 8, 2020

It's probably due to dockcross or multiarch doker image updates

@xerial
Copy link
Owner Author

xerial commented Oct 19, 2020

cc: @iwasakims

@xerial xerial removed their assignment Oct 19, 2020
@xerial
Copy link
Owner Author

xerial commented Oct 19, 2020

@iwasakims Currently, I don't have much time to work on this issue. It would be great if you can take a look.

@iwasakims
Copy link
Contributor

multiarch/crossbuild is based on Debian 8 (jessie) bundling cmake 3.0.2. I think we need updated image with cmake 3.1 or higher. I'm going to try adding script like docker/dockcross-mac64 (or our own Dockerfile if we need).

$ docker run --rm multiarch/crossbuild cmake --version
cmake version 3.0.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ docker run --rm multiarch/crossbuild cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

@iwasakims
Copy link
Contributor

The latest multiarch/crossbuild looks based on Debian stretch bundling cmake 3.7.2.
multiarch/crossbuild@10190a9
https://packages.debian.org/stretch/cmake

@xerial
Copy link
Owner Author

xerial commented Oct 21, 2020

The multiarch/crossbuild image hungs when running CMake...

So I tried make native on Mac instead, but I hit this issue:

touch target/snappy-1.1.7-Mac-x86_64/CMakeCache.txt
c++ -arch x86_64  -Ilib/inc_mac -I/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/include -O2 -fPIC -mmacosx-version-min=10.5 -fvisibility=hidden -stdlib=libstdc++ -DHAVE_CONFIG_H -I"/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/include/darwin" -Itarget/snappy-1.1.7 -Itarget/snappy-1.1.7-Mac-x86_64 -Itarget/bitshuffle-0.3.2/src -c target/snappy-1.1.7/snappy-sinksource.cc -o target/snappy-1.1.7-Mac-x86_64/snappy-sinksource.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++
      standard library instead [-Wstdlibcxx-not-found]
1 warning generated.
c++ -arch x86_64  -Ilib/inc_mac -I/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/include -O2 -fPIC -mmacosx-version-min=10.5 -fvisibility=hidden -stdlib=libstdc++ -DHAVE_CONFIG_H -I"/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/include/darwin" -Itarget/snappy-1.1.7 -Itarget/snappy-1.1.7-Mac-x86_64 -Itarget/bitshuffle-0.3.2/src -c target/snappy-1.1.7/snappy-stubs-internal.cc -o target/snappy-1.1.7-Mac-x86_64/snappy-stubs-internal.o
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++
      standard library instead [-Wstdlibcxx-not-found]
target/snappy-1.1.7/snappy-stubs-internal.cc:29:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
1 warning and 1 error generated.
make: *** [target/snappy-1.1.7-Mac-x86_64/snappy-stubs-internal.o] Error 1

Related pandas-dev/pandas#23424

@xerial
Copy link
Owner Author

xerial commented Oct 21, 2020

This issue is solved by requiring at least macos 10.7 and using libstdc++ #262

@xerial
Copy link
Owner Author

xerial commented Oct 21, 2020

It seems the cross compiler for x86_64-apple-darwin is no longer contained in the multiarch/crossbuild image. We need another workaround.

@xerial
Copy link
Owner Author

xerial commented Oct 21, 2020

At least make native now works on my Mac, we can close this and I'll prepare the next release.

@xerial xerial closed this as completed Oct 21, 2020
@iwasakims
Copy link
Contributor

@xerial sorry for the incomplete fix of #261 and thanks for #262 . The cause of cmake hangs turned out to be infinite loop in cmake wrapper of osxcross. I submitted multiarch/crossbuild#49 . make mac64 worked for me with the updated container.

$ make mac64
...(snop)
cp target/snappy-1.1.8-Mac-x86_64/libsnappyjava.jnilib /tmp/libsnappyjava.jnilib
strip -x /tmp/libsnappyjava.jnilib
cp /tmp/libsnappyjava.jnilib target/snappy-1.1.8-Mac-x86_64/libsnappyjava.jnilib
cp target/snappy-1.1.8-Mac-x86_64/libsnappyjava.jnilib src/main/resources/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib
cp target/snappy-1.1.8-Mac-x86_64/libsnappyjava.jnilib target/classes/org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib

@xerial xerial reopened this Oct 22, 2020
@xerial xerial changed the title make native stopped working make native stopped working for mac64 Oct 22, 2020
@xerial
Copy link
Owner Author

xerial commented Oct 22, 2020

Thanks for the patch! I'll try that later. Re-opened this ticket as a reminder. Thanks

@xerial
Copy link
Owner Author

xerial commented Oct 22, 2020

@iwasakims Anyway, snappy-java 1.1.7.8 and 1.1.8 are released with #256 fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants