Closed jmarca closed 3 years ago
pgRouting has a well maintained Docker repository and as far as I know they all images contain osm2pgrouting as well: https://github.com/pgRouting/docker-pgrouting/ . Could you maybe compare what is different in the way you are creating a Docker image?
It seems maybe they ran into the same problem? For example, looking at the dockerfile for the Postgres 13 version,
They pin osm2pgrouting version to 2.3.6 and also fix the version of libpqxx:
ENV OSM2PGROUTING_VERSION 2.3.6
RUN apt update \
&& apt install -y \
libpqxx-6.2 \
...
These errors from compiler are because Libpqxx v7.x require C++17. Related to issue #289
This is not a bug. It's an improvement so I'm going to change the tag.
Cool! Glad there is movement on this.
In addition to compile flag -std=c++17, I also had to change
diff --git a/src/osm_elements/osm2pgrouting.cpp b/src/osm_elements/osm2pgrouting.cpp
index e11fb2f..37e6232 100644
--- a/src/osm_elements/osm2pgrouting.cpp
+++ b/src/osm_elements/osm2pgrouting.cpp
@@ -140,7 +140,7 @@ int main(int argc, char* argv[]) {
cout << "Can't open database" << endl;
return 1;
}
- C.disconnect ();
+ C.close ();
}catch (const std::exception &e){
cerr << e.what() << std::endl;
return 1;
with my version of pqxx:
user:build$ grep VERSION /usr/include/pqxx/version.hxx
#ifndef PQXX_H_VERSION
# define PQXX_VERSION "7.3.1"
# define PQXX_VERSION_MAJOR 7
# define PQXX_VERSION_MINOR 3
# define PQXX_VERSION_CHECK \
check_pqxx_version_##PQXX_VERSION_MAJOR##_##PQXX_VERSION_MINOR
PQXX_LIBEXPORT int PQXX_VERSION_CHECK() noexcept;
@jmarca Sorry for the delay, the PR is ready if you can review #292 and leave a comment on the PR The most critical part is the change on the minimum standard for C++
I also modified FindPQXX that detects the version, can you verify that it works as it should.
I may not get to it for a few days as I am quite busy, but I have added a reminder for Wednesday to spend an hour checking this with my setup.
On Mon, May 31, 2021 at 11:12:31AM -0700, Vicky Vergara wrote:
@jmarca Sorry for the delay, the PR is ready if you can review #292 and leave a comment on the PR The most critical part is the change on the minimum standard for C++
- C++ minimum standard depends on libpqxx
- For version libpqxx 6: C++14
- For version libpqxx 7: C++17 see here
I also modified FindPQXX that detects the version, can you verify that it works as it should.
-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/pgRouting/osm2pgrouting/issues/284#issuecomment-851623068
--
James E. Marca Activimetrics LLC
Describe the bug Building osm2pgrouting in my docker image. Build fails with libpqxx 7.1.1, 7.2.0, and master. Build succeeds with libpqxx set to 6.4.7
To Reproduce
(I can upload my entire Dockerfile if you want...)
If I change the version of libpqxx to 6.4.7, the build passes
The compile error starts off as:
The releases page for libpqxx (https://github.com/jtv/libpqxx/releases) notes some changes to string processing, which might align with the error above. But I'm not going to pretend to know enough C++ to hazard a guess as to what is going on.
Expected behavior Compile successfully with v 7+ version of libpqxx
Sample Data See above
Specifications (please complete the following information): Use the commands:
NA
In my Dockerfile, I am compiling
I am building osm2pgrouting master, but I have also tried and failed with version OSM2PGROUTING_VERSION=2.3.6
Additional context NA