pgRouting/pgrouting — Issue #53: PostgreSQL 9.1 (Ubuntu 11.10) problem installing pgrouting
Author: pavelgajewski
Created: 2012-03-05 15:28:48+00:00
State: open

My basic problem is that after installing Postgresql 9.1 with postgis (up and running) i try to install pgrouting 1.05.

I have installed all libs required.
After enetering final command:
"cmake -DWITH_TSP=ON -DWITH_DD=ON" I'm getting an error:

@ubuntu:~/pgrouting-1.05$ cmake -DWITH_TSP=ON
-- The CXX compiler identification is unknown
CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Warning (dev) at CMakeLists.txt:12 (add_subdirectory):
The source directory

/home/gajos/pgrouting-1.05/cmake

does not contain a CMakeLists.txt file.

CMake does not support this case but it used to work accidentally and is
being allowed for compatibility.

Policy CMP0014 is not set: Input directories must have CMakeLists.txt. Run
"cmake --help-policy CMP0014" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.

-- PostgreSQL not found.
FATALERROR Please check your PostgreSQL installation.
Boost headers were found here: /usr/include
Output directory for libraries is set to /usr/lib/postgresql/9.1/lib
Installation directory for libraries is set to /usr/lib/postgresql/9.1/lib and for SQL files is set to /usr/share/postlbs
Installation directory for libraries is set to /usr/lib/postgresql/9.1/lib
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
POSTGRESQL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/gajos/pgrouting-1.05
used as include directory in directory /home/gajos/pgrouting-1.05/core
used as include directory in directory /home/gajos/pgrouting-1.05/extra/tsp
used as include directory in directory /home/gajos/pgrouting-1.05/extra/tsp/src
used as include directory in directory /home/gajos/pgrouting-1.05/extra/tsp/sql
used as include directory in directory /home/gajos/pgrouting-1.05/extra/driving_distance
used as include directory in directory /home/gajos/pgrouting-1.05/extra/driving_distance/src
used as include directory in directory /home/gajos/pgrouting-1.05/extra/driving_distance/sql
used as include directory in directory /home/gajos/pgrouting-1.05/core/src
used as include directory in directory /home/gajos/pgrouting-1.05/core/sql

-- Configuring incomplete, errors occurred!

Postgres is running and directory contains CMakeLists.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 "5")

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 PostgreSQL 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 ${PGROUTING_SOURCE_DIR}/extra ${PGROUTING_SOURCE_DIR}/extra/tsp ${PGROUTING_SOURCE_DIR}/extra/tsp/src ${PGROUTING_SOURCE_DIR}/extra/driving_distance ${PGROUTING_SOURCE_DIR}/extra/driving_distance/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 -frounding-math")
SET(CMAKE_CXX_FLAGS "-O2 -g -frounding-math")

# 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)
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(${INCLUDE_DIRECTORIES} ${GAUL_INCLUDE_DIR})
ADD_SUBDIRECTORY(extra/tsp)
ENDIF(WITH_TSP)

IF(WITH_DD)
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(${INCLUDE_DIRECTORIES} ${CGAL_INCLUDE_DIR})
ADD_SUBDIRECTORY(extra/driving_distance)
ENDIF(WITH_DD)