Skip to content

Configuration failed because libpq was not found. #118

Closed

Description

@JackStat

@jeroen after the latest 5 or so commits (one of them was messaged "Aggh who broke my shit" haha). My shit was broken... If I do an install to commit https://github.com/rstats-db/RPostgres/commit/f1835d31a7a5fd72a7877ee63d851ebedf2a3d9e everything works fine. Let me know if I can do anything to help fix the issue and as always thanks for everything you do.

Using pg_config includedir and libdir!
Using PKG_CFLAGS=
Using PKG_LIBS=-lpq
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libpq was not found. Try installing:
 * deb: libpq-dev (Debian, Ubuntu, etc)
 * rpm: postgresql-devel (Fedora, EPEL)
 * rpm: postgreql8-devel, psstgresql92-devel, postgresql93-devel, or postgresql94-devel (Amazon Linux)
 * csw: postgresql_dev (Solaris)
 * brew: postgresql (OSX)
If libpq is already installed, check that either:
(i)  'pkg-config' is in your PATH AND PKG_CONFIG_PATH contains
     a libpq.pc file; or
(ii) 'pg_config' is in your PATH.
If neither can detect , you can set INCLUDE_DIR
and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------

Activity

  1. jeroen commented on Mar 21, 2017

    @jeroen
    Member

    Hmm your pkg-config is giving these values, so that means something is misconfigured on your system. Can you please show the output of the successful install? In particular the lines with Using PKG_CFLAGS and Using PKG_LIBS=...

  2. JackStat commented on Mar 21, 2017

    @JackStat
    ContributorAuthor

    hmm I am doing a fresh build of a docker image that was based on your opencpu dockerfile. Let me see if I can reproduce it with the dockerfile. I have added some other junk in there that I need to remove before sharing

  3. oz-r commented on Mar 25, 2017

    @oz-r
    Contributor

    I've got a PR(#119) that will most likely fix this issue.

  4. mmuurr commented on Mar 28, 2017

    @mmuurr
    Contributor

    @Usman-R's #119 does fix this for me.

    @jeroen I think I'm the one who "broke [...] shit" with #81... reason being...
    I've found a bunch of PostgreSQL installations over the years (on particular Linux distros, e.g. Amazon Linuxes) where some combination of these are true:

    • pkg_config specifying only one of cflags or libs
    • pg_config specifying only one of includedir or libdir
    • the above two cases not complementing each other forcing me to manually specify one or the other of INCLUDE_DIR or LIB_DIR (but not necessarily both) as an arg to RPostgres' installation.

    Thus, #81 tried to factor these two variables out into their own value-discovery paths.
    For both variables, highest priority is an arg given at package-install time, then pkg_config, then pg_config, then (finally) brew if on darwin*.
    Being able to pass exactly one of INCLUDE_DIR or LIB_DIR (i.e. without having to necessarily pass both) at installation-time seems like a good enough reason (IMHO) to treat these two variables separately during installation, but I'm happy to defer to the original author.
    Definitely not trying to rock-the-boat here, and thanks a ton for all the work/contributing you put in to these projects.

  5. guilherme commented on May 31, 2017

    @guilherme

    @JackStat It worked for me when I installed both: libpq-dev and pkg-config

  6. kanxu526 commented on May 31, 2018

    @kanxu526

    Bumped into this issue and @guilherme 's method works for me as well.

  7. vikram-rawat commented on Oct 1, 2020

    @vikram-rawat

    Hi,

    Got the same issue like this one today while trying to create a docker file from windows. Is there a solution to fix it yet...

    Ticket seems to be closed..

  8. krlmlr commented on Oct 1, 2020

    @krlmlr
    Member

    Please open a new issue with a precise description. What output are you seeing? Have you installed libpq-dev?

  9. github-actions commented on Oct 2, 2021

    @github-actions
    Contributor

    This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

  10. locked and limited conversation to collaborators on Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions