Ticket #127 (closed bug report: fixed)

Opened 2 years ago

Last modified 7 days ago

Add functions to database fails when compiled with DD support

Reported by: daniel Owned by: anton
Priority: critical Milestone: Version 1.1
Component: pgRouting package Version: trunk
Keywords: Cc:

Description

Add functions to database fails when compiled with DD support.

daniel@bougainvilla:~$ psql -U postgres -f /usr/share/postlbs/routing_core.sql routing2
CREATE TYPE
CREATE TYPE
psql:/usr/share/postlbs/routing_core.sql:32: FEHLER:  konnte Bibliothek »/usr/lib/postgresql/8.3/lib/librouting.so« nicht laden: libgaul.so.0: cannot open shared object file: No such file or directory
psql:/usr/share/postlbs/routing_core.sql:43: FEHLER:  konnte Bibliothek »/usr/lib/postgresql/8.3/lib/librouting.so« nicht laden: libgaul.so.0: cannot open shared object file: No such file or directory
psql:/usr/share/postlbs/routing_core.sql:53: FEHLER:  konnte Bibliothek »/usr/lib/postgresql/8.3/lib/librouting.so« nicht laden: libgaul.so.0: cannot open shared object file: No such file or directory
CREATE FUNCTION

Attachments

CMakeLists.txt Download (3.9 KB) - added by anton 2 years ago.

Change History

follow-ups: ↓ 5 ↓ 6   Changed 2 years ago by anton

  • status changed from new to assigned

Can you please try this CMakeList.txt?

CMAKE_MINIMUM_REQUIRED(VERSION 2.3) PROJECT(PGROUTING)

#----------------------------------------------------------------------------- # PGROUTING version number. SET(PGROUTING_VERSION_MAJOR "1") SET(PGROUTING_VERSION_MINOR "0") SET(PGROUTING_VERSION_PATCH "1")

SET(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}")

add_subdirectory(cmake) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

include (MacroLibrary?)

macro_optional_find_package(PostgreSQL) IF(NOT POSTGRESQL_FOUND)

MESSAGE(FATAL ERROR " Please check your Boost installation.")

ENDIF(NOT POSTGRESQL_FOUND)

FIND_PACKAGE(Boost) IF(Boost_INCLUDE_DIRS)

MESSAGE("Boost headers were found here: ${Boost_INCLUDE_DIR}")

ELSE(Boost_INCLUDE_DIRS)

MESSAGE(FATAL ERROR " Please check your Boost installation ")

ENDIF(Boost_INCLUDE_DIRS)

EXEC_PROGRAM(pg_config

ARGS --pkglibdir OUTPUT_VARIABLE LIB_DIR)

IF(LIB_DIR)

MESSAGE("Output directory for libraries is set to ${LIB_DIR}")

ELSE(LIB_DIR)

SET(LIB_DIR ${PGROUTING_BINARY_DIR}/lib) MESSAGE("pg_config not found, output directory for libraries is set to ${PGROUTING_BINARY_DIR}/lib")

ENDIF(LIB_DIR)

if(PGROUTING_CORE_INCLUDE_DIR)

set(PGROUTING_CORE_FOUND TRUE)

else(PGROUTING_CORE_INCLUDE_DIR)

FIND_PATH(PGROUTING_CORE_INCLUDE_DIR dijkstra.h

PATHS ${CMAKE_CURRENT_SOURCE_DIR}/core/src )

if(PGROUTING_CORE_INCLUDE_DIR)

set(PGROUTING_CORE_FOUND TRUE) message(STATUS "Found PGROUTING_CORE core: ${PGROUTING_CORE_INCLUDE_DIR}") INCLUDE_DIRECTORIES(${PGROUTING_CORE_INCLUDE_DIR})

else(PGROUTING_CORE_INCLUDE_DIR)

set(PGROUTING_CORE_FOUND FALSE) message(STATUS "PGROUTING_CORE core not found.")

endif(PGROUTING_CORE_INCLUDE_DIR)

mark_as_advanced(PGROUTING_CORE_INCLUDE_DIR)

endif(PGROUTING_CORE_INCLUDE_DIR)

OPTION(WITH_TSP "Build TSP library" OFF) OPTION(WITH_DD "Build Driving distance library" OFF)

IF(UNIX)

SET(LIBRARY_INSTALL_PATH ${LIB_DIR}) SET(SQL_INSTALL_PATH /usr/share/postlbs) MESSAGE("Installation directory for libraries is set to ${LIBRARY_INSTALL_PATH} and for SQL files is set to ${SQL_INSTALL_PATH}")

ELSE(UNIX)

SET(LIBRARY_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib)

ENDIF(UNIX)

SET(PGROUTING_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/core ${PGROUTING_SOURCE_DIR}/core/src )

INCLUDE_DIRECTORIES(. ${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) IF(WIN32)

INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR}/port/win32)

ENDIF(WIN32)

# we need link libpostgres.a on win32 env IF(WIN32)

LINK_DIRECTORIES(${LIB_DIR}) LINK_LIBRARIES(postgres)

ENDIF(WIN32)

SET(CMAKE_C_FLAGS "-O2 -g") SET(CMAKE_CXX_FLAGS "-O2 -g")

# Recurse into the subdirectories. This does not actually # cause another cmake executable to run. The same process will walk through # the project's entire directory structure. SUBDIRS(core)

IF(WITH_TSP)

SET(TSP_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/tsp ${PGROUTING_SOURCE_DIR}/extra/tsp/src macro_optional_find_package(GAUL) IF(NOT GAUL_FOUND)

message(FATAL ERROR " Please check your gaul installation, or set correct path to GAUL_INCLUDE_DIR and GAUL_LIBRARIES.")

ENDIF(NOT GAUL_FOUND) INCLUDE_DIRECTORIES(${TSP_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${GAUL_INCLUDE_DIR}) LINK_LIBRARIES(${GAUL_LIBRARIES} ${GAUL_UTIL_LIBRARIES}) ADD_SUBDIRECTORY(extra/tsp)

ENDIF(WITH_TSP)

IF(WITH_DD)

SET(DD_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/driving_distance ${PGROUTING_SOURCE_DIR}/extra/driving_distance/src macro_optional_find_package(CGAL) IF(NOT CGAL_FOUND)

message(FATAL ERROR " Please check your CGAL installation, or set correct path to CGAL_INCLUDE_DIR and CGAL_LIBRARIES.")

ENDIF(NOT CGAL_FOUND) INCLUDE_DIRECTORIES(${DD_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${CGAL_INCLUDE_DIR}) LINK_LIBRARIES(${CGAL_LIBRARIES}) ADD_SUBDIRECTORY(extra/driving_distance)

ENDIF(WITH_DD)

Changed 2 years ago by anton

  Changed 2 years ago by anton

  • status changed from assigned to closed
  • resolution set to fixed

Fixed with [203]

  Changed 2 years ago by sunrise

This works ok for me.. but It probably needs feedback. postlbs Air Jordan

  Changed 10 months ago by diatman

in reply to: ↑ 1   Changed 7 months ago by mike3050

Replying to anton:

Can you please try this CMakeList.txt? CMAKE_MINIMUM_REQUIRED(VERSION 2.3) PROJECT(PGROUTING) #----------------------------------------------------------------------------- # PGROUTING version number. SET(PGROUTING_VERSION_MAJOR "1") SET(PGROUTING_VERSION_MINOR "0") SET(PGROUTING_VERSION_PATCH "1") SET(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}") add_subdirectory(cmake) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include (MacroLibrary?) macro_optional_find_package(PostgreSQL) IF(NOT POSTGRESQL_FOUND) MESSAGE(FATAL ERROR " Please check your Boost  cheap auto insurance quotes installation.") ENDIF(NOT POSTGRESQL_FOUND) FIND_PACKAGE(Boost) IF(Boost_INCLUDE_DIRS) MESSAGE("Boost headers were found here: ${Boost_INCLUDE_DIR}") ELSE(Boost_INCLUDE_DIRS) MESSAGE(FATAL ERROR " Please check your Boost installation ") ENDIF(Boost_INCLUDE_DIRS) EXEC_PROGRAM(pg_config ARGS --pkglibdir OUTPUT_VARIABLE LIB_DIR) IF(LIB_DIR) MESSAGE("Output directory for libraries is set to ${LIB_DIR}") ELSE(LIB_DIR) SET(LIB_DIR ${PGROUTING_BINARY_DIR}/lib) MESSAGE("pg_config not found, output directory for libraries is set to ${PGROUTING_BINARY_DIR}/lib") ENDIF(LIB_DIR) if(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND TRUE) else(PGROUTING_CORE_INCLUDE_DIR) FIND_PATH(PGROUTING_CORE_INCLUDE_DIR dijkstra.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/core/src ) if(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND TRUE) message(STATUS "Found PGROUTING_CORE core: ${PGROUTING_CORE_INCLUDE_DIR}") INCLUDE_DIRECTORIES(${PGROUTING_CORE_INCLUDE_DIR}) else(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND FALSE) message(STATUS "PGROUTING_CORE core not found.") endif(PGROUTING_CORE_INCLUDE_DIR) mark_as_advanced(PGROUTING_CORE_INCLUDE_DIR) endif(PGROUTING_CORE_INCLUDE_DIR) OPTION(WITH_TSP "Build TSP library" OFF) OPTION(WITH_DD "Build Driving distance library" OFF) IF(UNIX) SET(LIBRARY_INSTALL_PATH ${LIB_DIR}) SET(SQL_INSTALL_PATH /usr/share/postlbs) MESSAGE("Installation directory for libraries is set to ${LIBRARY_INSTALL_PATH} and for SQL files is set to ${SQL_INSTALL_PATH}") ELSE(UNIX) SET(LIBRARY_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) ENDIF(UNIX) SET(PGROUTING_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/core ${PGROUTING_SOURCE_DIR}/core/src ) INCLUDE_DIRECTORIES(. ${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) IF(WIN32) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR}/port/win32) ENDIF(WIN32) # we need link libpostgres.a on win32 env IF(WIN32) LINK_DIRECTORIES(${LIB_DIR}) LINK_LIBRARIES(postgres) ENDIF(WIN32) SET(CMAKE_C_FLAGS "-O2 -g") SET(CMAKE_CXX_FLAGS "-O2 -g") # Recurse into the subdirectories. This does not actually # cause another cmake executable to run. The same process will walk through # the project's entire directory structure. SUBDIRS(core) IF(WITH_TSP) SET(TSP_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/tsp ${PGROUTING_SOURCE_DIR}/extra/tsp/src macro_optional_find_package(GAUL) IF(NOT GAUL_FOUND) message(FATAL ERROR " Please check your gaul installation, or set correct path to GAUL_INCLUDE_DIR and GAUL_LIBRARIES.") ENDIF(NOT GAUL_FOUND) INCLUDE_DIRECTORIES(${TSP_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${GAUL_INCLUDE_DIR}) LINK_LIBRARIES(${GAUL_LIBRARIES} ${GAUL_UTIL_LIBRARIES}) ADD_SUBDIRECTORY(extra/tsp) ENDIF(WITH_TSP) IF(WITH_DD) SET(DD_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/driving_distance ${PGROUTING_SOURCE_DIR}/extra/driving_distance/src macro_optional_find_package(CGAL) IF(NOT CGAL_FOUND) message(FATAL ERROR " Please check your CGAL installation, or set correct path to CGAL_INCLUDE_DIR and CGAL_LIBRARIES.") ENDIF(NOT CGAL_FOUND) INCLUDE_DIRECTORIES(${DD_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${CGAL_INCLUDE_DIR}) LINK_LIBRARIES(${CGAL_LIBRARIES}) ADD_SUBDIRECTORY(extra/driving_distance) ENDIF(WITH_DD)

That's really helped me.Thanks

in reply to: ↑ 1   Changed 7 weeks ago by mike3050

Replying to anton:

Can you please try this CMakeList.txt? CMAKE_MINIMUM_REQUIRED(VERSION 2.3) PROJECT(PGROUTING) #----------------------------------------------------------------------------- # PGROUTING version number. SET(PGROUTING_VERSION_MAJOR "1") SET(PGROUTING_VERSION_MINOR "0") SET(PGROUTING_VERSION_PATCH "1") SET(PGROUTING_VERSION_STRING "${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}.${PGROUTING_VERSION_PATCH}") add_subdirectory(cmake) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include (MacroLibrary?) macro_optional_find_package(PostgreSQL) IF(NOT POSTGRESQL_FOUND) MESSAGE(FATAL ERROR " Please check your Boost installation.") ENDIF(NOT POSTGRESQL_FOUND) FIND_PACKAGE(Boost) IF(Boost_INCLUDE_DIRS) MESSAGE("Boost headers were found here: ${Boost_INCLUDE_DIR}") ELSE(Boost_INCLUDE_DIRS) MESSAGE(FATAL ERROR " Please check your Boost installation ") ENDIF(Boost_INCLUDE_DIRS) EXEC_PROGRAM(pg_config ARGS --pkglibdir OUTPUT_VARIABLE LIB_DIR) IF(LIB_DIR) MESSAGE("Output directory for libraries is set to ${LIB_DIR}") ELSE(LIB_DIR) SET(LIB_DIR ${PGROUTING_BINARY_DIR}/lib) MESSAGE("pg_config not found, output directory for libraries is set to ${PGROUTING_BINARY_DIR}/lib") ENDIF(LIB_DIR) if(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND TRUE) else(PGROUTING_CORE_INCLUDE_DIR) FIND_PATH(PGROUTING_CORE_INCLUDE_DIR dijkstra.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/core/src ) if(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND TRUE) message(STATUS "Found PGROUTING_CORE core: ${PGROUTING_CORE_INCLUDE_DIR}") INCLUDE_DIRECTORIES(${PGROUTING_CORE_INCLUDE_DIR}) else(PGROUTING_CORE_INCLUDE_DIR) set(PGROUTING_CORE_FOUND FALSE) message(STATUS "PGROUTING_CORE core not found.") endif(PGROUTING_CORE_INCLUDE_DIR) mark_as_advanced(PGROUTING_CORE_INCLUDE_DIR) endif(PGROUTING_CORE_INCLUDE_DIR) OPTION(WITH_TSP "Build TSP library" OFF) OPTION(WITH_DD "Build Driving distance library" OFF) IF(UNIX) SET(LIBRARY_INSTALL_PATH ${LIB_DIR}) SET(SQL_INSTALL_PATH /usr/share/postlbs) MESSAGE("Installation directory for libraries is set to ${LIBRARY_INSTALL_PATH} and for SQL files is set to ${SQL_INSTALL_PATH}") ELSE(UNIX) SET(LIBRARY_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) SET(SQL_INSTALL_PATH ${PGROUTING_BINARY_DIR}/lib) ENDIF(UNIX) SET(PGROUTING_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/core ${PGROUTING_SOURCE_DIR}/core/src ) INCLUDE_DIRECTORIES(. ${PGROUTING_INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) IF(WIN32) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${POSTGRESQL_INCLUDE_DIR}/port/win32) ENDIF(WIN32) # we need link libpostgres.a on  auto insurance quotes win32 env IF(WIN32) LINK_DIRECTORIES(${LIB_DIR}) LINK_LIBRARIES(postgres) ENDIF(WIN32) SET(CMAKE_C_FLAGS "-O2 -g") SET(CMAKE_CXX_FLAGS "-O2 -g") # Recurse into the subdirectories. This does not actually # cause another cmake executable to run. The same process will walk through # the project's entire directory structure. SUBDIRS(core) IF(WITH_TSP) SET(TSP_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/tsp ${PGROUTING_SOURCE_DIR}/extra/tsp/src macro_optional_find_package(GAUL) IF(NOT GAUL_FOUND) message(FATAL ERROR " Please check your gaul installation, or set correct path to GAUL_INCLUDE_DIR and GAUL_LIBRARIES.") ENDIF(NOT GAUL_FOUND) INCLUDE_DIRECTORIES(${TSP_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${GAUL_INCLUDE_DIR}) LINK_LIBRARIES(${GAUL_LIBRARIES} ${GAUL_UTIL_LIBRARIES}) ADD_SUBDIRECTORY(extra/tsp) ENDIF(WITH_TSP) IF(WITH_DD) SET(DD_INCLUDE_DIRECTORIES ${PGROUTING_SOURCE_DIR}/extra/driving_distance ${PGROUTING_SOURCE_DIR}/extra/driving_distance/src macro_optional_find_package(CGAL) IF(NOT CGAL_FOUND) message(FATAL ERROR " Please check your CGAL installation, or set correct path to CGAL_INCLUDE_DIR and CGAL_LIBRARIES.") ENDIF(NOT CGAL_FOUND) INCLUDE_DIRECTORIES(${DD_INCLUDE_DIRECTORIES} ${INCLUDE_DIRECTORIES} ${CGAL_INCLUDE_DIR}) LINK_LIBRARIES(${CGAL_LIBRARIES}) ADD_SUBDIRECTORY(extra/driving_distance) ENDIF(WITH_DD)

Thank you

  Changed 7 days ago by vedavyas

This functions ok personally.. however it probably wants feedback.  Best coffee makers world

Note: See TracTickets for help on using tickets.