Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am having trouble getting started with pgRouting.

1) from binary The Kyngchaos binary just won't install and says it requires PostgreSQL 9.1. I do have it, but probably not where the binary expects it:

herve:pgrouting-master hsenot$ psql --version
psql (PostgreSQL) 9.1.4
herve:pgrouting-master hsenot$ which psql
/opt/opengeo/pgsql/9.1/bin/psql

Any advice on making it available to the installer, by tweaking the path maybe?

herve:~ hsenot$ echo $PATH
/opt/boost_1_52_0:/Library/Frameworks/GDAL.framework/Programs:/Library/Frameworks/UnixImageIO.framework/Programs:/Library/Frameworks/PROJ.framework/Programs:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/opengeo/pgsql/9.1/bin:/opt/opengeo/opengeosuite-2.5-sdk/bin:/usr/X11/bin:/opt/local/include:/opt/local/bin:/opt/local/sbin

2) from source I've tried with the pgRouting 1.05 (tar) and the lastest GitHub version. In both case, it throws the same error.

After "cmake .", I had to manually set the PostgreSQL directories in CMakeCache.txt:

//Path to a file.
POSTGRESQL_INCLUDE_DIR:PATH=/opt/opengeo/pgsql/9.1/include/postgresql/server
//Path to a library.
POSTGRESQL_LIBRARIES:FILEPATH=/opt/opengeo/pgsql/9.1/lib

Without this, cmake (at the next step) says it can't find postgresql.h

The 'cmake' trace is:

herve:pgrouting-master hsenot$ cmake .
-- Boost version: 1.52.0
Boost headers were found here: /opt/boost_1_52_0
Output directory for libraries is set to sh:     /opt/opengeo/pgsql/9.1/bin/postgres/pg_config: Not a directory
Installation directory for libraries is set to sh:     /opt/opengeo/pgsql/9.1/bin/postgres/pg_config: Not a directory and for SQL files is set to /usr/share/pgrouting
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/pgrouting-master

So there is already something fishy here with the "Not a directory" messages.

The 'make' error trace is:

herve:pgrouting-master hsenot$ make
Scanning dependencies of target routing
[ 16%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o
[ 33%] Building C object core/src/CMakeFiles/routing.dir/astar.o
[ 50%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o
[ 66%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp: In instantiation of ‘boost::detail::adj_list_any_edge_pmap::bind_<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, Vertex, boost::no_property, boost::listS>, Vertex, boost::edge_weight_t>’:
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2687:   instantiated from ‘boost::detail::adj_list_choose_edge_pmap<boost::edge_weight_t, boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, Vertex, boost::no_property, boost::listS>, Vertex>’
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2690:   instantiated from ‘boost::detail::adj_list_edge_property_selector::bind_<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, Vertex, boost::no_property, boost::listS>, Vertex, boost::edge_weight_t>’
/opt/boost_1_52_0/boost/graph/properties.hpp:215:   instantiated from ‘boost::detail::edge_property_map<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, Vertex, boost::no_property, boost::listS>, boost::edge_weight_t>’
/opt/boost_1_52_0/boost/graph/properties.hpp:233:   instantiated from ‘boost::property_map<boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, boost::no_property, Vertex, boost::no_property, boost::listS>, boost::edge_weight_t>’
/tmp/pgrouting-master/core/src/boost_wrapper.cpp:77:   instantiated from here
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2653: error: forming reference to void
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2654: error: forming reference to void
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2658: error: forming reference to void
/opt/boost_1_52_0/boost/graph/detail/adjacency_list.hpp:2661: error: forming reference to void
/tmp/pgrouting-master/core/src/boost_wrapper.cpp: In function ‘int boost_dijkstra(edge_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)’:
/tmp/pgrouting-master/core/src/boost_wrapper.cpp:77: error: no matching function for call to ‘get(boost::edge_weight_t, boost_dijkstra(edge_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)::graph_t&)’
make[2]: *** [core/src/CMakeFiles/routing.dir/boost_wrapper.o] Error 1
make[1]: *** [core/src/CMakeFiles/routing.dir/all] Error 2
make: *** [all] Error 2

Has anyone encountered this one before? More generally, has anyone compiled pgRouting on Mac recently?

Any suggestion welcome. Cheers

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

This issue was reported at https://github.com/pgRouting/pgrouting/issues/68 . Could you try my quick fix in your local source?

share|improve this answer
    
Hey @sanak - thanks for that, it worked. I applied your fix then this one about is_same.hpp, then this one about dynamic links and the make completed! Thanks again –  Herve Dec 3 '12 at 23:21
add comment

What's the path to pg_config?

You probably want to run that and use the values of INCLUDEDIR, PKGINCLUDEDIR and INCLUDEDIR-SERVER before you run ./configure

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.