Skip to content

RPostgres appears to require Homebrew installation on OS X #22

Closed

Description

@iangow

I attempted to give RPostgres a try, but after attempting to install all sorts of things from Homebrew, the installation gave up and suggested I uninstall MacPorts. Most of the things RPostgres was attempting to install were already present on my system.

Demand for RPostgres may increase in near future due to uncertain status of RPostgreSQL, a package that simply works for me (though compilation has become patchy with recent versions of R on OS X).

Activity

  1. hadley commented on Mar 16, 2015

    @hadley
    Member

    Can you please show the output of running system("pg_config")?

    (Most of these compilation problems will go away once the package is on CRAN, but we would like to make the configuration a bit more robust)

  2. iangow commented on Mar 16, 2015

    @iangow
    Author

    Sure. I’m using a “Mavericks” build of R from CRAN and PostgreSQL from MacPorts.

    Last login: Sun Mar 15 21:40:31 2015 from 192.168.2.3
    Mac-Pro:~ igow$ R

    R version 3.1.3 (2015-03-09) -- "Smooth Sidewalk"
    Copyright (C) 2015 The R Foundation for Statistical Computing
    Platform: x86_64-apple-darwin13.4.0 (64-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.

    Natural language support but running in an English locale

    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.

    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.

    system("pg_config")
    BINDIR = /opt/local/lib/postgresql94/bin
    DOCDIR = /opt/local/share/doc/postgresql
    HTMLDIR = /opt/local/share/doc/postgresql
    INCLUDEDIR = /opt/local/include/postgresql94
    PKGINCLUDEDIR = /opt/local/include/postgresql94
    INCLUDEDIR-SERVER = /opt/local/include/postgresql94/server
    LIBDIR = /opt/local/lib/postgresql94
    PKGLIBDIR = /opt/local/lib/postgresql94
    LOCALEDIR = /opt/local/share/locale
    MANDIR = /opt/local/share/man
    SHAREDIR = /opt/local/share/postgresql94
    SYSCONFDIR = /opt/local/etc/postgresql94
    PGXS = /opt/local/lib/postgresql94/pgxs/src/makefiles/pgxs.mk
    CONFIGURE = '--prefix=/opt/local' '--sysconfdir=/opt/local/etc/postgresql94' '--bindir=/opt/local/lib/postgresql94/bin' '--libdir=/opt/local/lib/postgresql94' '--includedir=/opt/local/include/postgresql94' '--datadir=/opt/local/share/postgresql94' '--mandir=/opt/local/share/man' '--with-includes=/opt/local/include' '--with-libraries=/opt/local/lib' '--with-openssl' '--with-bonjour' '--with-readline' '--with-zlib' '--with-libxml' '--with-libxslt' '--with-gssapi' '--enable-thread-safety' '--with-uuid=e2fs' '--with-python' '--with-perl' 'CC=/usr/bin/clang' 'CFLAGS=-pipe -Os -arch x86_64' 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -headerpad_max_install_names -arch x86_64' 'CPPFLAGS=-I/opt/local/include'
    CC = /usr/bin/clang
    CPPFLAGS = -I/opt/local/include -I/opt/local/include/libxml2 -I/opt/local/include
    CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -pipe -Os -arch x86_64
    CFLAGS_SL =
    LDFLAGS = -L../../../src/common -L/opt/local/lib -Wl,-headerpad_max_install_names -headerpad_max_install_names -arch x86_64 -L/opt/local/lib -L/opt/local/lib -Wl,-dead_strip_dylibs
    LDFLAGS_EX =
    LDFLAGS_SL =
    LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lm
    VERSION = PostgreSQL 9.4.1

    On Mar 16, 2015, at 8:43 AM, Hadley Wickham [email protected] wrote:

    Can you please show the output of running system("pg_config")?

    (Most of these compilation problems will go away once the package is on CRAN, but we would like to make the configuration a bit more robust)

    —
    Reply to this email directly or view it on GitHub https://github.com/rstats-db/RPostgres/issues/22#issuecomment-81632096.

  3. krlmlr commented on Feb 29, 2016

    @krlmlr
    Member

    Does @mmuurr's pull request #81 work for you?

    devtools::install_github("rstats-db/RPostgres#81")
    
  4. iangow commented on Mar 1, 2016

    @iangow
    Author

    Yes. This works on Mac OS X with a MacPorts installation of PostgreSQL 9.4 (also with another installation with PostgreSQL 9.5.1).

    In one case I got an error that prevented installation (message contained namespace ‘DBI’ 0.3.1 is being loaded, but >= 0.3.1.9008 is required), but this was easily fixed with devtools::install_github("rstats-db/DBI") (does it make sense to handle this dependency automatically?).

    > devtools::install_github("rstats-db/RPostgres#81")
    Downloading GitHub repo mmuurr/RPostgres@Amazon-Linux-configure
    Installing RPostgres
    Skipping 1 packages ahead of CRAN: DBI
    Installing 2 packages: BH, Rcpp
    '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore CMD INSTALL  \
      '/private/var/folders/0y/v7w1215j0ylb22zqgt9nsh1m0000gn/T/RtmpYOV6BG/devtools11a7e3bd9ec32/mmuurr-rstats-db.RPostgres-6e8fcab' --library='/Library/Frameworks/R.framework/Versions/3.2/Resources/library'  \
      --install-tests 
    
    * installing *source* package ‘RPostgres’ ...
    Found pg_config includedir!
    Found pg_config libdir!
    Using PKG_CFLAGS=-I/opt/local/include/postgresql94 
    Using PKG_LIBS=-L/opt/local/lib/postgresql94 -lpq
    ** libs
    clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c RPostgres-init.c -o RPostgres-init.o
    clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c RcppExports.cpp -o RcppExports.o
    clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c connection.cpp -o connection.o
    clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c encode.cpp -o encode.o
    clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c encrypt.cpp -o encrypt.o
    clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/opt/local/include/postgresql94  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BH/include"   -fPIC  -Wall -mtune=core2 -g -O2  -c result.cpp -o result.o
    clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o RPostgres.so RPostgres-init.o RcppExports.o connection.o encode.o encrypt.o result.o -L/opt/local/lib/postgresql94 -lpq -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
    installing to /Library/Frameworks/R.framework/Versions/3.2/Resources/library/RPostgres/libs
    ** R
    ** tests
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    * DONE (RPostgres)
    > library(RPostgres)
    > pg <- RPostgres::dbConnect(RPostgres::Postgres())
    > dbListTables(pg)
    [lotsa tables]
    
  5. krlmlr commented on Mar 1, 2016

    @krlmlr
    Member

    Thanks for confirming it.

  6. cilindrox commented on Oct 4, 2016

    @cilindrox

    Confirming this works on Docker, too.

    devtools::install_github("rstats-db/RPostgres") fails (no libpq binary found)

    devtools::install_github("rstats-db/RPostgres#81") nets a successful installation.

  7. github-actions commented on Dec 9, 2020

    @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.

  8. locked and limited conversation to collaborators on Dec 9, 2020
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