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 from sources works in buster docker image but does not in bullseye #116

Closed
azarz opened this issue Jan 3, 2023 · 6 comments
Closed
Labels

Comments

@azarz
Copy link

azarz commented Jan 3, 2023

Linked to #83 I think

I'm building prime_server from source using a Dockerfile.

From the node:16-buster image, the compilation works

FROM node:16-buster as build

WORKDIR /home/prime-server
RUN apt-get update && apt-get install -y git cmake autoconf automake pkg-config libtool make gcc g++ lcov libcurl4-openssl-dev libzmq3-dev libczmq-dev
RUN git clone --depth 1 --recursive https://github.com/kevinkreiser/prime_server.git && cd prime_server &&\
./autogen.sh && ./configure && make && make install

However, from node:16-bullseye, if fails with th following error:

config.status: executing libtool commands
CXX src/prime_serverd-prime_serverd.o
CXX src/libprime_server_la-prime_server.lo
CXX src/libprime_server_la-zmq_helpers.lo
CXX src/libprime_server_la-netstring_protocol.lo
CXX src/libprime_server_la-http_util.lo
CXX src/libprime_server_la-http_protocol.lo
CXXLD libprime_server.la
CXXLD prime_serverd
/usr/bin/ld: src/prime_serverd-prime_serverd.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:913: prime_serverd] Error 1

FROM node:16-bullseye as build

WORKDIR /home/prime-server
RUN apt-get update && apt-get install -y git cmake autoconf automake pkg-config libtool make gcc g++ lcov libcurl4-openssl-dev libzmq3-dev libczmq-dev
RUN git clone --depth 1 --recursive https://github.com/kevinkreiser/prime_server.git && cd prime_server &&\
./autogen.sh && ./configure && make && make install
@azarz
Copy link
Author

azarz commented Jan 3, 2023

I have managed to build prime_server on bullseye using the command cmake -B build . && cmake --build build && make -C build install

However, I then build Valhalla. On the latest master version (c03bd26), it fails with the following error:

[ 43%] Built target valhalla-sif
make[2]: Entering directory '/home/valhalla/valhalla/build'
Scanning dependencies of target valhalla-loki
make[2]: Leaving directory '/home/valhalla/valhalla/build'
make[2]: Entering directory '/home/valhalla/valhalla/build'
[ 43%] Building CXX object src/loki/CMakeFiles/valhalla-loki.dir/search.cc.o
[ 43%] Building CXX object src/loki/CMakeFiles/valhalla-loki.dir/worker.cc.o
In file included from /home/valhalla/valhalla/valhalla/loki/worker.h:19,
                 from /home/valhalla/valhalla/src/loki/worker.cc:22:
/home/valhalla/valhalla/valhalla/worker.h:12:10: fatal error: prime_server/http_protocol.hpp: No such file or directory
   12 | #include <prime_server/http_protocol.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/loki/CMakeFiles/valhalla-loki.dir/build.make:95: src/loki/CMakeFiles/valhalla-loki.dir/worker.cc.o] Error 1
make[2]: Leaving directory '/home/valhalla/valhalla/build'
make[1]: *** [CMakeFiles/Makefile2:2116: src/loki/CMakeFiles/valhalla-loki.dir/all] Error 2
make[1]: Leaving directory '/home/valhalla/valhalla/build'
make: *** [Makefile:171: all] Error 2

When I instead clone prime_server and checkout on the previous commit (43715e5), Valhalla compilation works

RUN git clone --depth 3 --recursive https://github.com/kevinkreiser/prime_server.git && cd prime_server && git checkout 43715e5 && \
cmake -B build . && cmake --build build && make -C build install

@kevinkreiser
Copy link
Owner

haha we just merged a pr that handles the install directories (#115 ) seems like, at least on bullseye, this doesnt work properly. my question to you would be, can you see what directory the headers are installed into? are there in /usr/local/include or /usr/local/include/prime_server? the code expects the latter but i could imagine that the former is happening since that pr potentially

@azarz
Copy link
Author

azarz commented Jan 3, 2023

The headers are indeed installed in /usr/local/include

FROM node:16-bullseye as build

### Compilation de Valhalla
RUN apt-get update && \
apt-get install -y cmake make libtool pkg-config g++ gcc curl unzip jq lcov protobuf-compiler \
vim-common locales libcurl4-openssl-dev zlib1g-dev liblz4-dev libprotobuf-dev && \
apt-get install -y libgeos-dev libgeos++-dev libluajit-5.1-dev libspatialite-dev libsqlite3-dev wget sqlite3 spatialite-bin python3-shapely && \
apt-get install -y libsqlite3-mod-spatialite python3-pip

WORKDIR /home/prime-server
RUN apt-get install -y git cmake autoconf automake pkg-config libtool make gcc g++ lcov libcurl4-openssl-dev libzmq3-dev libczmq-dev
RUN git clone --depth 1 --recursive https://github.com/kevinkreiser/prime_server.git && cd prime_server && \
cmake -B build . && cmake --build build && make -C build install

RUN ls /usr/local/include

RUN ls /usr/local/include/prime_server

Step 6/7 : RUN ls /usr/local/include
http_protocol.hpp
http_util.hpp
netstring_protocol.hpp
node
prime_server.hpp
zmq_helpers.hpp

Step 7/7 : RUN ls /usr/local/include/prime_server
ls: cannot access '/usr/local/include/prime_server': No such file or directory

@kevinkreiser
Copy link
Owner

Awesome thanks for confirming I'll fix it this evening!

@kevinkreiser
Copy link
Owner

@azarz should be fixed now, i tested with a clean install via docker to verify (at least on ubuntu, should work in debian as well)

@azarz
Copy link
Author

azarz commented Jan 5, 2023

I can confirm this works, thanks!

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

No branches or pull requests

2 participants