Closed iboates closed 7 months ago
In the end I realized that the problem is actually quite simple, and it is that libpq
is not the same thing as libpqxx
. Furthermore, libpqxx
is just not available on alpine linux, and must be compiled from source. Therefore, the below Dockerfile works. If you are not using docker, you can quite easily extract the commands from it to compile on Alpine, if for whatever bizarre reason, you are choosing to torment yourself by using Alpine for anything other than Docker.
FROM docker.io/alpine:latest
RUN apk add --no-cache \
git \
expat \
expat-dev \
boost-dev \
boost-program_options \
postgresql-dev \
cmake \
make \
g++
# libqxx is not available on apk, must build from source
RUN git clone https://github.com/jtv/libpqxx.git
WORKDIR libpqxx
RUN cmake . -DCMAKE_INSTALL_PREFIX=/usr -DSKIP_BUILD_TEST=ON
RUN make
RUN make install
WORKDIR ..
RUN git clone -b v2.3.8 https://github.com/pgRouting/osm2pgrouting.git
WORKDIR osm2pgrouting
RUN cmake -H. -Bbuild
WORKDIR build/
RUN make
RUN make install
Problem
I cannot compile on Alpine Linux due to libpqxx not being found
To Reproduce
Compile on Alpine Linux. I am doing so in a Dockerfile (pretty typical for Alpine):
The compilation error is:
TL;DR:
It's worth noting that on Alpine, the package is called
libpq-dev
, notlibpqxx-dev
. (link) I'm not that experienced in C++ but I guess that there are missing headers? Any ideas on what I can try? Ive already tried a lot of monkey-pasting from other related issues to no avail.Expectation
Should be able to compile