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

3.1.3 build error on RHEL 7 #2190

Closed
devrimgunduz opened this issue Oct 19, 2021 · 8 comments
Closed

3.1.3 build error on RHEL 7 #2190

devrimgunduz opened this issue Oct 19, 2021 · 8 comments

Comments

@devrimgunduz
Copy link

Hi,

Getting the following two errors below while building 3.1.3 on RHEL 7. I'm using boost 1.69, and gcc 4.8.5. Can you please take a look? Thanks!

Devrim

1st one:

make[3]: Entering directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build' cd /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build && /usr/bin/cmake3 -E cmake_depends "Unix Makefiles" /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3 /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/common /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build/src/common /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build/src/common/CMakeFiles/common.dir/DependInfo.cmake --color= Scanning dependencies of target common /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c: In function 'process': /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c:97:5: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < total_pd_orders; i++) { ^ /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c:97:5: note: use option -std=c99 or -std=gnu99 to compile your code /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c:122:17: error: redefinition of 'i' for (size_t i = 0; i < total_vehicles; i++) { ^ /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c:97:17: note: previous definition of 'i' was here for (size_t i = 0; i < total_pd_orders; i++) { ^ /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/pickDeliver/pickDeliverEuclidean.c:122:5: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < total_vehicles; i++) { ^ make[3]: *** [src/pickDeliver/CMakeFiles/pickDeliver.dir/pickDeliverEuclidean.c.o] Error 1 make[3]: Leaving directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build'

2nd one:

[ 37%] Building CXX object src/components/CMakeFiles/components.dir/bridges_driver.cpp.o
cd /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build/src/components && /usr/lib64/ccache/c++ -DBOOST_ALLOW_DEPRECATED_HEADERS -DBoost_VERSION_MACRO=106900 -DPGSQL_VERSION=134 -DPROJECT_VERSION="3.1.3" -I/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include -isystem /usr/pgsql-13/include/server -isystem /usr/include/boost169 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -frounding-math -DNDEBUG -std=c++11 -o CMakeFiles/components.dir/bridges_driver.cpp.o -c /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/components/bridges_driver.cpp
In file included from /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/cpp_common/basePath_SSEC.hpp:43:0,
from /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/dijkstra/pgr_dijkstra.hpp:55,
from /var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/withPoints/withPoints_driver.cpp:39:
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/cpp_common/pgr_base_graph.hpp: In instantiation of 'pgrouting::graph::Pgr_base_graph<G, Vertex, Edge>::Pgr_base_graph(const std::vector<T_V>&, graphType) [with G = boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, pgrouting::Basic_vertex, pgrouting::Basic_edge>; T_V = pgrouting::Basic_vertex; T_E = pgrouting::Basic_edge]':
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/withPoints/withPoints_driver.cpp:153:61: required from here
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/cpp_common/pgr_base_graph.hpp:326:30: warning: variable 'vertex' set but not used [-Wunused-but-set-variable]
for (const auto vertex : vertices) {
^
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/cpp_common/pgr_base_graph.hpp: In instantiation of 'pgrouting::graph::Pgr_base_graph<G, Vertex, Edge>::Pgr_base_graph(const std::vector<T_V>&, graphType) [with G = boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, pgrouting::Basic_vertex, pgrouting::Basic_edge>; T_V = pgrouting::Basic_vertex; T_E = pgrouting::Basic_edge]':
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/src/withPoints/withPoints_driver.cpp:163:65: required from here
/var/lib/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/include/cpp_common/pgr_base_graph.hpp:326:30: warning: variable 'vertex' set but not used [-Wunused-but-set-variable]
make[3]: Leaving directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build' [ 37%] Built target withPoints make[3]: Leaving directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build'
[ 37%] Built target components
make[2]: Leaving directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build' make[1]: *** [all] Error 2 make[1]: Leaving directory /home/pgsql/git/pgrpms/rpm/redhat/master/non-common/pgrouting31/main/pgrouting-3.1.3/build'
error: Bad exit status from /var/tmp/rpm-tmp.8vIdmI (%install)

@cvvergara
Copy link
Member

First attempt to reproduce
I find difficult to install gcc-4.8 on 20.04, so I will force the compilation to -std=c++11 to try to reproduce
btw do you know any CI that is for RHEL?

@cvvergara
Copy link
Member

#1850 might be relevant.

@cvvergara
Copy link
Member

@devrimgunduz are you getting any errors on 3.2.0 or 3.2.1?

@cvvergara
Copy link
Member

cvvergara commented Oct 21, 2021

@cvvergara
Copy link
Member

git diff v3.1.3 CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index adda4796a2..4687de7ab5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -101,6 +101,7 @@ if (BOOST_VERSION VERSION_LESS "1.75.0")
 else()
     set(CMAKE_CXX_STANDARD 14)
 endif()
+set(CMAKE_C_STANDARD 90)
 
 add_definitions(-DBOOST_ALLOW_DEPRECATED_HEADERS)
 set(COMPILER_VERSION "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}")

So gcc 4.8 is using C90 as default
Will fix the code so that with C90 there is no problem

@cvvergara
Copy link
Member

I could not reproduce second problem , but it is on an assertion cycle, so when it is a release the body of the cycle is empty.
I am just commenting out that problematic code as it does not do anything

@cvvergara cvvergara added this to the 3.1.4 milestone Oct 21, 2021
@cvvergara cvvergara mentioned this issue Oct 21, 2021
6 tasks
@cvvergara
Copy link
Member

@devrimgunduz
Can you check that it works on the PR "2191
Because if it does then I shall work the same fix on 3.0 3.2 and on develop

@devrimgunduz
Copy link
Author

Hi @cvvergara,

Thanks for the extremely fast response and fix. The patch works on RHEL 7, and pgrouting 3.1.

Cheers, Devrim

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

No branches or pull requests

2 participants