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

Alpine C Binding #103

Closed
Alien2150 opened this issue Jul 26, 2018 · 5 comments
Closed

Alpine C Binding #103

Alien2150 opened this issue Jul 26, 2018 · 5 comments

Comments

@Alien2150
Copy link
Contributor

hey guys,

I tried to compile h3 in a dockerized alpine environment. I added the requirements and run cmake but only getting this error message:

cmake .
-- The C compiler identification is GNU 6.4.0
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /h3-master/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/make" "cmTC_8e320/fast"
    /usr/bin/make -f CMakeFiles/cmTC_8e320.dir/build.make CMakeFiles/cmTC_8e320.dir/build
    make[1]: Entering directory '/h3-master/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_8e320.dir/testCCompiler.c.o
    /usr/bin/cc   -fPIE   -std=gnu11 -o CMakeFiles/cmTC_8e320.dir/testCCompiler.c.o   -c /h3-master/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_8e320
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8e320.dir/link.txt --verbose=1
    /usr/bin/cc      -rdynamic CMakeFiles/cmTC_8e320.dir/testCCompiler.c.o  -o cmTC_8e320
    /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory
    /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
    /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared
    collect2: error: ld returned 1 exit status
    make[1]: *** [CMakeFiles/cmTC_8e320.dir/build.make:87: cmTC_8e320] Error 1
    make[1]: Leaving directory '/h3-master/CMakeFiles/CMakeTmp'
    make: *** [Makefile:126: cmTC_8e320/fast] Error 2




  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:50 (project)


-- Configuring incomplete, errors occurred!
See also "/h3-master/CMakeFiles/CMakeOutput.log".
See also "/h3-master/CMakeFiles/CMakeError.log".

I can paste the outout / error log if it helps.

Regards,
Thomas

@isaacbrodsky
Copy link
Collaborator

Hi, it looks like the linker is having difficulty finding part of the C runtime. Could you paste how you installed dependencies, and ideally the steps you followed to get to this point?

@Alien2150
Copy link
Contributor Author

Alien2150 commented Jul 28, 2018

Hey @isaacbrodsky , thanks for the reply. Here are the steps to reprodouce:

docker pull alpine:3.8
docker run -it --rm alpine:3.8 /bin/ash
apk add cmake make gcc libtool
wget https://github.com/uber/h3/archive/master.zip 
unzip master.zip 
cd h3-master
cmake .

@isaacbrodsky
Copy link
Collaborator

Please try installing musl-dev. I also needed to install g++ due to a bug in our CMakeLists.txt. (C++ isn't actually used in this project)

Inside the container:

apk add cmake make gcc libtool musl-dev g++
wget https://github.com/uber/h3/archive/master.zip
unzip master.zip
cd h3-master
cmake .
make
make test

@Alien2150
Copy link
Contributor Author

Looks good. Maybe this should be put into the README? Can come up with a PR

@isaacbrodsky
Copy link
Collaborator

Thanks for helping to update the docs, @Alien2150 !

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

2 participants