yueshengu / rpostgresql

Automatically exported from code.google.com/p/rpostgresql
0 stars 0 forks source link

-Kthread -kthread -pthreads not defined for Darwin on MacPorts #47

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. On OS X with Macports gcc-mp-4.7 and Macports R
2. install.packages('RPostgreSQL')

What is the expected output? What do you see instead?
I expect t to install, but I see: 

/opt/local/bin/gcc-mp-4.7 -std=gnu99 -pipe -O3 -march=corei7 -m64  -Kthread 
-kthread -pthread -pthreads  -D_REENTRANT -D_THREAD_SAFE 
-D_POSIX_PTHREAD_SEMANTICS  -DFRONTEND -DUNSAFE_STAT_OK -I. -I../src/include   
-DSO_MAJOR_VERSION=5  -c -o fe-auth.o fe-auth.c
gcc-mp-4.7: error: unrecognized command line option '-Kthread'
gcc-mp-4.7: error: unrecognized command line option '-kthread'
gcc-mp-4.7: error: unrecognized command line option '-pthreads'
make[1]: *** [fe-auth.o] Error 1

What version of the product are you using? On what operating system?
OS X 10.8.2, R 2.15.2, gcc 4.7, postgresql 9.2.3,  MacPorts

Please provide any additional information below.
If I download the source, and take out those flags, it compiles with no problem.

Original issue reported on code.google.com by ericbrow...@gmail.com on 16 Feb 2013 at 12:53

GoogleCodeExporter commented 8 years ago
This is most likely a problem with MacPorts.  You might want to forward your 
issue to the MacPorts maintainers.  Tomoaki's suggestions to do everything form 
MacPorts should also fix the problem. Since we do not maintain the MacPorts 
ports for R and PostgreSQL I don't want to speak for them and we can't fix them.

For reference to other emails regarding same, binaries do exist outside of 
MacPorts:

R - http://cran.r-project.org/bin/macosx/
PostgreSQL - 
http://www.postgresqlformac.com/lists/downloads/unified_installer_disk_imag/

The benefit with using the binary from postgresqlformac.com is that you also 
get a System Preference panel to start and shut down PostgreSQL, modify server 
settings, and a script to allow switching between different PostgreSQL 
versions.  The only downside of postgresqlformac.com is that updates are 
sometimes a month or two behind.  That can usually be fixed with a little 
prompting as the build process is automated.

Having used both Fink and MacPorts I have settled on using R and PostgreSQL 
outside of both because it works better for me although I do use MacPorts for 
other software.

I have just confirmed that if PostgreSQL is installed correctly, installing 
RPostreSQL from inside R works for both binary and source on OS X 10.8.2 
(Mountain Lion).

install.packages('RPostgreSQL')
install.packages('RPostgreSQL', type='source')

'PostgreSQL is installed correctly' means that pg_config is in your path.  To 
find out if this is the case type 'pg_config' without the quote marks at a 
command prompt (in the terminal).  You should see some info showing the 
locations of your PostgreSQL installation.

For example:
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/postgresql
HTMLDIR = /usr/share/postgresql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/serverLIBDIR = /usr/lib
PKGLIBDIR = /usr/lib/postgresql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/postgresql
SYSCONFDIR = /private/etc/postgresql
PGXS = /usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--infodir=/usr/share/info' '--disable-dependency-tracking' 
'--prefix=/usr' '--sbindir=/usr/libexec' '--sysconfdir=/private/etc' 
'--mandir=/usr/share/man' '--localstatedir=/private/var/pgsql' 
'--htmldir=/usr/share/postgresql' '--enable-thread-safety' '--enable-dtrace' 
'--with-tcl' '--with-perl' '--with-python' '--with-gssapi' '--with-krb5' 
'--with-pam' '--with-ldap' '--with-bonjour' '--with-openssl' '--with-libxml' 
'--with-libxslt' '--with-system-tzdata=/usr/share/zoneinfo' 
'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/us
r/bin/cc' 'CFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations' 
'LDFLAGS=-arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations' 
'LDFLAGS_EX=-mdynamic-no-pic'
CC = 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bi
n/cc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations -Wall 
-Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement 
-Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -arch x86_64 -pipe -Os -g -Wall -Wno-deprecated-declarations 
-Wl,-dead_strip_dylibs
LDFLAGS_EX = -mdynamic-no-pic
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline 
-lm 
VERSION = PostgreSQL 9.1.4

This example happens to use PostgreSQL (9.1.4) supplied with mac os x .  To 
change this simply change the order of directories in the shell PATH to return 
the correct pg_config. Keep in mind that since Apple provides a version of 
PostgreSQL with all later versions of OS X that you have to always make sure 
you are not getting the two versions confused.

To find your current PATH type 'env $PATH' at a command prompt (in the 
terminal).

If you prefer not to mess with the operating system PATH then you can also add 
something like the following (which is how I use it) to .Rprofile in your user 
home directory.  This is for using PostgreSQL from postgresqlformac.com as 
noted above.

Sys.setenv("PATH" = paste("/Library/PostgreSQL/bin",Sys.getenv("PATH"),sep=":"))

There should not be any need to modify anything in RPostgreSQL to get this 
working.

Original comment by ne...@neiltiffin.com on 17 Feb 2013 at 5:19