pgRouting / pgrouting

Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
https://pgrouting.org
GNU General Public License v2.0
1.17k stars 369 forks source link

Installation problem in macOS #1157

Closed juifa-tsai closed 5 years ago

juifa-tsai commented 6 years ago

Hi expert,

I am trying to install the pgrouting in Mac. But I got the error in end of installation with sudo make install as following error message:

Scanning dependencies of target pgrouting-2.6
[100%] Linking CXX shared module lib/libpgrouting-2.6.so
Undefined symbols for architecture x86_64:
  "_ArrayGetNItems", referenced from:
      _pgr_get_bigIntArr in arrays_input.c.o
  "_BlessTupleDesc", referenced from:
      _alphashape in alpha.c.o
      _turn_restrict_shortest_path_edge in trsp.c.o
  "_CurrentMemoryContext", referenced from:
      _MemoryContextSwitchTo in dijkstra.c.o
      _MemoryContextSwitchTo in dijkstraVia.c.o
      _MemoryContextSwitchTo in floydWarshall.c.o
      _MemoryContextSwitchTo in johnson.c.o
      _MemoryContextSwitchTo in astar.c.o
      _MemoryContextSwitchTo in many_to_dist_driving_distance.c.o
      _MemoryContextSwitchTo in many_to_dist_withPointsDD.c.o
      ...
  "_DatumGetFloat4", referenced from:
      _pgr_SPI_getFloat8 in get_check_data.c.o
  "_DatumGetFloat8", referenced from:
      _pgr_SPI_getFloat8 in get_check_data.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      _eucledianTSP in eucledianTSP.c.o
      _newTSP in newTSP.c.o
      _alphashape in alpha.c.o
      ...
  "_Float8GetDatum", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_HeapTupleHeaderGetDatum", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_RelationNameGetTupleDesc", referenced from:
      _turn_restrict_shortest_path_edge in trsp.c.o
  "_SPI_connect", referenced from:
      _pgr_SPI_connect in postgres_connection.c.o
      _compute_alpha_shape in alpha.c.o
      _compute_trsp in trsp.c.o
     (maybe you meant: _pgr_SPI_connect)
  "_SPI_cursor_close", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_SPI_cursor_fetch", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_SPI_cursor_open", referenced from:
      _pgr_SPI_cursor_open in postgres_connection.c.o
      _compute_alpha_shape in alpha.c.o
      _compute_trsp in trsp.c.o
     (maybe you meant: _pgr_SPI_cursor_open)
  "_SPI_finish", referenced from:
      _pgr_SPI_finish in postgres_connection.c.o
      _finish in trsp.c.o
     (maybe you meant: _pgr_SPI_finish)
  "_SPI_fnumber", referenced from:
      _fetch_column_info in get_check_data.c.o
      _fetch_vertices_columns in alpha.c.o
      _fetch_edge_columns in trsp.c.o
      _fetch_restrict_columns in trsp.c.o
  "_SPI_freetuptable", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_SPI_getbinval", referenced from:
      _pgr_SPI_getChar in get_check_data.c.o
      _pgr_SPI_getBigIntArr in get_check_data.c.o
      _pgr_SPI_getBigInt in get_check_data.c.o
      _pgr_SPI_getFloat8 in get_check_data.c.o
      _fetch_vertex in alpha.c.o
      _fetch_edge in trsp.c.o
      _fetch_restrict in trsp.c.o
      ...
  "_SPI_gettypeid", referenced from:
      _fetch_column_info in get_check_data.c.o
      _fetch_vertices_columns in alpha.c.o
      _fetch_edge_columns in trsp.c.o
      _fetch_restrict_columns in trsp.c.o
  "_SPI_getvalue", referenced from:
      _pgr_SPI_getText in get_check_data.c.o
      _fetch_restrict in trsp.c.o
  "_SPI_palloc", referenced from:
      char* pgr_alloc<char>(unsigned long, char*) in pgr_alloc.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in dijkstra_driver.cpp.o
      Routes_t* pgr_alloc<Routes_t>(unsigned long, Routes_t*) in dijkstraVia_driver.cpp.o
      matrix_cell* pgr_alloc<matrix_cell>(unsigned long, matrix_cell*) in floydWarshall_driver.cpp.o
      matrix_cell* pgr_alloc<matrix_cell>(unsigned long, matrix_cell*) in johnson_driver.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in astar_driver.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in drivedist_driver.cpp.o
      ...
  "_SPI_pfree", referenced from:
      General_path_element_t* pgr_free<General_path_element_t>(General_path_element_t*) in dijkstra_driver.cpp.o
      Routes_t* pgr_free<Routes_t>(Routes_t*) in dijkstraVia_driver.cpp.o
      matrix_cell* pgr_free<matrix_cell>(matrix_cell*) in floydWarshall_driver.cpp.o
      matrix_cell* pgr_free<matrix_cell>(matrix_cell*) in johnson_driver.cpp.o
      General_path_element_t* pgr_free<General_path_element_t>(General_path_element_t*) in astar_driver.cpp.o
      General_path_element_t* pgr_free<General_path_element_t>(General_path_element_t*) in drivedist_driver.cpp.o
      General_path_element_t* pgr_free<General_path_element_t>(General_path_element_t*) in withPoints_dd_driver.cpp.o
      ...
  "_SPI_prepare", referenced from:
      _pgr_SPI_prepare in postgres_connection.c.o
      _compute_alpha_shape in alpha.c.o
      _compute_trsp in trsp.c.o
     (maybe you meant: _pgr_SPI_prepare)
  "_SPI_processed", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_SPI_repalloc", referenced from:
      char* pgr_alloc<char>(unsigned long, char*) in pgr_alloc.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in dijkstra_driver.cpp.o
      Routes_t* pgr_alloc<Routes_t>(unsigned long, Routes_t*) in dijkstraVia_driver.cpp.o
      matrix_cell* pgr_alloc<matrix_cell>(unsigned long, matrix_cell*) in floydWarshall_driver.cpp.o
      matrix_cell* pgr_alloc<matrix_cell>(unsigned long, matrix_cell*) in johnson_driver.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in astar_driver.cpp.o
      General_path_element_t* pgr_alloc<General_path_element_t>(unsigned long, General_path_element_t*) in drivedist_driver.cpp.o
      ...
  "_SPI_result", referenced from:
      _fetch_column_info in get_check_data.c.o
  "_SPI_tuptable", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _fetch_column_info in get_check_data.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      ...
  "_TupleDescInitEntry", referenced from:
      _contractGraph in contractGraph.c.o
  "_construct_array", referenced from:
      _contractGraph in contractGraph.c.o
  "_cstring_to_text", referenced from:
      _contractGraph in contractGraph.c.o
  "_deconstruct_array", referenced from:
      _pgr_get_bigIntArr in arrays_input.c.o
  "_elog_finish", referenced from:
      _pgr_send_error in postgres_connection.c.o
      _pgr_SPI_finish in postgres_connection.c.o
      _pgr_SPI_connect in postgres_connection.c.o
      _pgr_SPI_prepare in postgres_connection.c.o
      _pgr_SPI_cursor_open in postgres_connection.c.o
      _pgr_notice in e_report.c.o
      _pgr_notice2 in e_report.c.o
      ...
  "_elog_start", referenced from:
      _pgr_send_error in postgres_connection.c.o
      _pgr_SPI_finish in postgres_connection.c.o
      _pgr_SPI_connect in postgres_connection.c.o
      _pgr_SPI_prepare in postgres_connection.c.o
      _pgr_SPI_cursor_open in postgres_connection.c.o
      _pgr_notice in e_report.c.o
      _pgr_notice2 in e_report.c.o
      ...
  "_end_MultiFuncCall", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_errcode", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_errfinish", referenced from:
      _check_parameters in check_parameters.c.o
      _pgr_notice in e_report.c.o
      _pgr_notice2 in e_report.c.o
      _pgr_error in e_report.c.o
      _pgr_error2 in e_report.c.o
      _pgr_global_report in e_report.c.o
      _fetch_vehicles in vehicles_input.c.o
      ...
  "_errhint", referenced from:
      _check_parameters in check_parameters.c.o
      _pgr_notice2 in e_report.c.o
      _pgr_error in e_report.c.o
      _pgr_error2 in e_report.c.o
      _pgr_global_report in e_report.c.o
      _fetch_vehicles in vehicles_input.c.o
      _process in pickDeliverEuclidean.c.o
      ...
  "_errmsg", referenced from:
      _check_parameters in check_parameters.c.o
      _pgr_notice in e_report.c.o
      _pgr_notice2 in e_report.c.o
      _fetch_vehicles in vehicles_input.c.o
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      ...
  "_errmsg_internal", referenced from:
      _pgr_error in e_report.c.o
      _pgr_error2 in e_report.c.o
      _pgr_global_report in e_report.c.o
  "_errstart", referenced from:
      _check_parameters in check_parameters.c.o
      _pgr_notice in e_report.c.o
      _pgr_notice2 in e_report.c.o
      _pgr_error in e_report.c.o
      _pgr_error2 in e_report.c.o
      _pgr_global_report in e_report.c.o
      _fetch_vehicles in vehicles_input.c.o
      ...
  "_get_call_result_type", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_get_typlenbyvalalign", referenced from:
      _pgr_get_bigIntArr in arrays_input.c.o
      _contractGraph in contractGraph.c.o
  "_heap_form_tuple", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_init_MultiFuncCall", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_palloc", referenced from:
      _pgr_cstring2char in postgres_connection.c.o
      _pgr_get_restrictions in restrictions_input.c.o
      _pgr_get_bigIntArr in arrays_input.c.o
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      ...
  "_palloc0", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_per_MultiFuncCall", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
  "_pfree", referenced from:
      _pgr_get_bigIntArr in arrays_input.c.o
      _process in dijkstra.c.o
      _process in dijkstraVia.c.o
      _process in floydWarshall.c.o
      _process in johnson.c.o
      _process in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      ...
  "_pg_detoast_datum", referenced from:
      _pgr_SPI_getBigIntArr in get_check_data.c.o
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      ...
  "_repalloc", referenced from:
      _pgr_get_points in points_input.c.o
      _pgr_get_matrixRows in matrixRows_input.c.o
      _get_edges_flow in edges_input.c.o
      _get_edges_5_columns in edges_input.c.o
      _get_edges_9_columns in edges_input.c.o
      _get_edges_basic in edges_input.c.o
      _pgr_get_pd_orders_general in orders_input.c.o
      ...
  "_text_to_cstring", referenced from:
      _many_to_many_dijkstra in dijkstra.c.o
      _dijkstraVia in dijkstraVia.c.o
      _floydWarshall in floydWarshall.c.o
      _johnson in johnson.c.o
      _astarManyToMany in astar.c.o
      _driving_many_to_dist in many_to_dist_driving_distance.c.o
      _many_withPointsDD in many_to_dist_withPointsDD.c.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libpgrouting-2.6.so] Error 1
make[1]: *** [CMakeFiles/pgrouting-2.6.dir/all] Error 2
make: *** [all] Error 2

Steps to reproduce the problem

I built with cmake and installed by following the README.md, the log of cmake shows all the package seems are okay. The cmake log is

CMake Deprecation Warning at CMakeLists.txt:11 (cmake_policy):
  The OLD behavior for policy CMP0046 will be removed from a future version
  of CMake.
  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- CMAKE_BUILD_TYPE
-- CMAKE_BUILD_TYPE
-- The C compiler identification is AppleClang 10.0.0.10001145
-- The CXX compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:50 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- DOXYGEN_MINIMUM_VERSION=1.7
-- SPHINX_MINIMUM_VERSION=1.1
-- POSTGRESQL_MINIMUM_VERSION=9.2.0
-- POSTGIS_MINIMUM_VERSION=2.0.0
-- GNU_CXX_MINIMUM_VERSION=4.6
-- CLANG_CXX_MINIMUM_VERSION=
-- MSVC_CXX_MINIMUM_VERSION=18.0
-- dir='/Users/juifa.tsai/Downloads/pgrouting/cmake'
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Unknown compiler minimum version for AppleClang
-- Using  -std=c++11.
-- Found Perl: /usr/bin/perl (found version "5.18.2")
-- POSTGRESQL_PG_CONFIG is /Library/PostgreSQL/9.6/bin/pg_config
-- POSTGRESQL_EXECUTABLE is /Applications/postgres.app/Contents/MacOS/Postgres
-- POSTGRESQL_VERSION_STRING in FindPostgreSQL.cmake is PostgreSQL 9.6.11
-- POSTGRESQL_INCLUDE_DIR: /Library/PostgreSQL/9.6/include/postgresql/server
-- POSTGRESQL_LIBRARIES: /Library/PostgreSQL/9.6/lib
-- PGSQL_VERSION=96
-- Boost version: 1.68.0
-- Boost headers were found here: /usr/local/include
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   thread
--   chrono
--   system
--   date_time
--   atomic
-- Boost version: 1.68.0
-- Found the following Boost libraries:
--   thread
--   system
--   chrono
--   date_time
--   atomic
-- CGAL_INCLUDE_DIR=/usr/local/include
-- CGAL_LIBRARIES=/usr/local/lib/libCGAL.dylib
-- BOOST_THREAD_LIBRARIES=/usr/local/lib/libboost_thread-mt.dylib;/usr/local/lib/libboost_system-mt.dylib;/usr/local/lib/libboost_chrono-mt.dylib;/usr/local/lib/libboost_date_time-mt.dylib;/usr/local/lib/libboost_atomic-mt.dylib
-- GMP_LIBRARIES=/usr/local/lib/libgmp.dylib
-- Found CGAL: /usr/local/include, /usr/local/lib/libCGAL.dylib, /usr/local/lib/libboost_thread-mt.dylib;/usr/local/lib/libboost_system-mt.dylib;/usr/local/lib/libboost_chrono-mt.dylib;/usr/local/lib/libboost_date_time-mt.dylib;/usr/local/lib/libboost_atomic-mt.dylib, /usr/local/lib/libgmp.dylib
-- Performing Test C_COMPILER_SUPPORTS_FPIC
-- Performing Test C_COMPILER_SUPPORTS_FPIC - Success
-- Performing Test CXX_COMPILER_SUPPORTS_FPIC
-- Performing Test CXX_COMPILER_SUPPORTS_FPIC - Success
-- Performing Test C_COMPILER_SUPPORTS_ROUNDING_MATH
-- Performing Test C_COMPILER_SUPPORTS_ROUNDING_MATH - Success
-- Performing Test CXX_COMPILER_SUPPORTS_ROUNDING_MATH
-- Performing Test CXX_COMPILER_SUPPORTS_ROUNDING_MATH - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/juifa.tsai/Downloads/pgrouting/build

Specifications like the version of pgRouting/PostGIS and PostgreSQL as well as Operating System

My environments are

Not sure if I miss something, I hope someone can point out the right step for me.

Many thanks! J.F.

cvvergara commented 6 years ago

I don't have a mac, so my comments are just guess, I have no way to duplicate

_ArrayGetNItems", referenced from:
      _pgr_get_bigIntArr in arrays_input.c.o

_ArrayGetNItems is a postgres function

What I see is that only where postgres is needed things failed, (Mainly C files) kind of postgres not really being linked

Can you make (a clean build) with this flags

cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DPGROUTING_DEBUG=ON ..

Output will be huge, paste the

But really anything I can tell you is a guess. I haven't being able to make a travis test (since 2013 that I started on the team) for macOS, because I have no idea of how mac works

This is a travis test with postgres 9.6 (on trusty) https://travis-ci.org/pgRouting/pgrouting/jobs/431985880