eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)
BSD 3-Clause "New" or "Revised" License
388 stars 42 forks source link

Could NOT find PostgreSQL #27

Closed mikeshultz closed 7 years ago

mikeshultz commented 7 years ago

Attempting to install on RHEL 7.2 with a postgresql install from pgdg.

# uname -a
Linux db0.cloud.votesmart.org 3.10.0-327.36.2.el7.x86_64 #1 SMP Tue Sep 27 16:01:21 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/*release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.2 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.2"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.2 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.2:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.2"
Red Hat Enterprise Linux Server release 7.2 (Maipo)
Red Hat Enterprise Linux Server release 7.2 (Maipo)

Might be as simple as explorting a couple environmental variables, but nothing is mentioned in the docs.

# cmake .
-- The C compiler identification is GNU 4.8.5
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
CMake Warning at /usr/share/cmake/Modules/FindPostgreSQL.cmake:109 (message):
  Couldn't determine PostgreSQL configuration.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPostgreSQL.cmake:125 (fail_if)
  CMakeLists.txt:64 (find_package)

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY_DIRS
  PostgreSQL_CONFIG_DIR PostgreSQL_INCLUDE_DIRS PostgreSQL_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindPostgreSQL.cmake:173 (find_package_handle_standard_args)
  CMakeLists.txt:64 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/build/pgquarrel/CMakeFiles/CMakeOutput.log".

Was able to fix that with a symlink: ln -s /usr/pgsql-9.4/bin/pg_config /bin/pg_config which then returned the following:

[root@db0 pgquarrel]# cmake .
CMake Warning at /usr/share/cmake/Modules/FindPostgreSQL.cmake:109 (message):
  Couldn't determine PostgreSQL configuration.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPostgreSQL.cmake:145 (fail_if)
  CMakeLists.txt:64 (find_package)

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY_DIRS
  PostgreSQL_INCLUDE_DIRS PostgreSQL_LIBRARIES) (found version "9.4.9")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindPostgreSQL.cmake:173 (find_package_handle_standard_args)
  CMakeLists.txt:64 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/build/pgquarrel/CMakeFiles/CMakeOutput.log".

I tried setting PostgreSQL_LIBRARY_DIRS to paths I thought was acceptable with no joy.

eulerto commented 7 years ago

@mikeshultz You need to add -DCMAKE_PREFIX_PATH=/usr/pgsql-9.4.

cmake -DCMAKE_PREFIX_PATH=/usr/pgsql-9.4 .

In RHEL, pg_config isn't in the PATH. I should add a prefix explicitly. I'll improve the docs to cover the popular Linux distros.

mikeshultz commented 7 years ago

Build worked against HEAD with that option.

venu9l commented 6 years ago

install postgresqlxx-devel where xx is version ,it worked for me to over come below issue.


[osm@localhost build]$ cmake .. -- Building osm2pgsql 0.95.0-dev -- Boost version: 1.57.0 -- Found the following Boost libraries: -- system -- filesystem CMake Warning at /usr/share/cmake/Modules/FindPostgreSQL.cmake:109 (message): Couldn't determine PostgreSQL configuration. Call Stack (most recent call first): /usr/share/cmake/Modules/FindPostgreSQL.cmake:133 (fail_if) CMakeLists.txt:101 (find_package)

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108 (message): Could NOT find PostgreSQL (missing: PostgreSQL_LIBRARY_DIRS PostgreSQL_INCLUDE_DIRS PostgreSQL_LIBRARIES) (found version "9.4.15") Call Stack (most recent call first): /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake/Modules/FindPostgreSQL.cmake:173 (find_package_handle_standard_args) CMakeLists.txt:101 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/osm/osm/osm2pgsql/build/CMakeFiles/CMakeOutput.log". See also "/home/osm/osm/osm2pgsql/build/CMakeFiles/CMakeError.log".