I'm using a prebuilt Postgres binary which puts things in ... /Library/PostgreSQL8/lib/libpq.5.0.dylib /Library/PostgreSQL8/lib/libpq.5.1.dylib /Library/PostgreSQL8/lib/libpq.5.dylib /Library/PostgreSQL8/lib/libpq.a /Library/PostgreSQL8/lib/libpq.dylib ... so when I execute ... library(RdbiPgSQL) ... I get back some quite sensible errors: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/Library/Frameworks/R.framework/ Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so': dlopen(/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/ libs/i386/RdbiPgSQL.so, 6): Library not loaded: /usr/local/pgsql/lib/ libpq.5.dylib Referenced from: /Library/Frameworks/R.framework/Resources/library/ RdbiPgSQL/libs/i386/RdbiPgSQL.so Reason: image not found Error: package/namespace load failed for 'RdbiPgSQL' I can add some soft links to my system, but I was wondering if there was a better way to get things working? Thanks! Jason
RdbiPgSQL, OS X, and the location of libpq.5.dylib
5 messages · Jason Foster, Brian Ripley, Kasper Daniel Hansen
This is really a PostgreSQL-on-MacOS question. On a modern Unix-alike you tell ld.so about such paths via entries in /etc/ld.so.conf.d, but then on all my systems libpq has been installed in standard places. I think you need to ask on a MacOS list (e.g. r-sig-mac) if no MacOS guru answers here.
On Thu, 21 Aug 2008, Jason Foster wrote:
I'm using a prebuilt Postgres binary which puts things in ... /Library/PostgreSQL8/lib/libpq.5.0.dylib /Library/PostgreSQL8/lib/libpq.5.1.dylib /Library/PostgreSQL8/lib/libpq.5.dylib /Library/PostgreSQL8/lib/libpq.a /Library/PostgreSQL8/lib/libpq.dylib ... so when I execute ... library(RdbiPgSQL) ... I get back some quite sensible errors: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so': dlopen(/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so, 6): Library not loaded: /usr/local/pgsql/lib/libpq.5.dylib Referenced from: /Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so Reason: image not found Error: package/namespace load failed for 'RdbiPgSQL' I can add some soft links to my system, but I was wondering if there was a better way to get things working? Thanks! Jason
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-db
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Are you compiling the R package from source, and if yes, there might be an install option to tell where the Postgres library is. But I am not familiar with that database. Kasper
On Aug 21, 2008, at 7:03 PM, Jason Foster wrote:
I'm using a prebuilt Postgres binary which puts things in ... /Library/PostgreSQL8/lib/libpq.5.0.dylib /Library/PostgreSQL8/lib/libpq.5.1.dylib /Library/PostgreSQL8/lib/libpq.5.dylib /Library/PostgreSQL8/lib/libpq.a /Library/PostgreSQL8/lib/libpq.dylib ... so when I execute ... library(RdbiPgSQL) ... I get back some quite sensible errors: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/Library/Frameworks/R.framework/ Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so': dlopen(/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/ libs/i386/RdbiPgSQL.so, 6): Library not loaded: /usr/local/pgsql/lib/ libpq.5.dylib Referenced from: /Library/Frameworks/R.framework/Resources/library/ RdbiPgSQL/libs/i386/RdbiPgSQL.so Reason: image not found Error: package/namespace load failed for 'RdbiPgSQL' I can add some soft links to my system, but I was wondering if there was a better way to get things working? Thanks! Jason
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-db
On Thu, 21 Aug 2008, Kasper Daniel Hansen wrote:
Are you compiling the R package from source, and if yes, there might be an install option to tell where the Postgres library is. But I am not familiar with that database.
This is a run-time not compile-time issue. Even where there options to set run-time paths (-rpath, -R), they are generally not recommended. Looks like Darwin supports -rpath.
Kasper On Aug 21, 2008, at 7:03 PM, Jason Foster wrote:
I'm using a prebuilt Postgres binary which puts things in ... /Library/PostgreSQL8/lib/libpq.5.0.dylib /Library/PostgreSQL8/lib/libpq.5.1.dylib /Library/PostgreSQL8/lib/libpq.5.dylib /Library/PostgreSQL8/lib/libpq.a /Library/PostgreSQL8/lib/libpq.dylib ... so when I execute ... library(RdbiPgSQL) ... I get back some quite sensible errors: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared library '/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so': dlopen(/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so, 6): Library not loaded: /usr/local/pgsql/lib/libpq.5.dylib Referenced from: /Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/libs/i386/RdbiPgSQL.so Reason: image not found Error: package/namespace load failed for 'RdbiPgSQL' I can add some soft links to my system, but I was wondering if there was a better way to get things working? Thanks! Jason
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-db
_______________________________________________ R-sig-DB mailing list -- R Special Interest Group R-sig-DB at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-db
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
This is really a PostgreSQL-on-MacOS question. On a modern Unix- alike you tell ld.so about such paths via entries in /etc/ ld.so.conf.d, but then on all my systems libpq has been installed in standard places. I think you need to ask on a MacOS list (e.g. r-sig-mac) if no MacOS guru answers here.
That's my next step, but the one thing that I'd like to check beforehand relates to:
dlopen(/Library/Frameworks/R.framework/Resources/library/RdbiPgSQL/ libs/i386/RdbiPgSQL.so, 6): Library not loaded: /usr/local/pgsql/ lib/libpq.5.dylib
Has RdbiPgSQL hardcoded the path to libpq such that the library must be in that location? My understanding of Unix-alike dynamic loading isn't the best, but looking at the error my impression is that even if I do add a new location to DYLD_LIBRARY_PATH that the hardcoded path will be the only one searched. This might again be a MacOS question, but I'm wondering if anyone has been able to use a prebuilt RdbiPgSQL binary with Postgres in a non-standard location? Thanks! Jason P.S. The symnlink solution is working, but doesn't feel as elegant as I'd like... but I am able to get things done. Big thanks to the RdbiPgSQL developers for allowing me to avoid using ODBC!