[R-SIG-Mac] [plr for postgressql] make throws "*** Cannot build PL/R because libR is not a shared library" error

Simon Urbanek simon.urbanek at r-project.org
Mon Jan 8 20:39:05 CET 2007


Sam,

just for the record, are you sure you want to re-compile R yourself?  
It is not necessary, so I'm just asking ...

On Jan 8, 2007, at 1:10 PM, Sam Hunting wrote:

> Configuring R-2.4.1 for postgresql-8.2.0 on Mac OS X:
>
> sh-2.05b#sudo gcc_select 3.3
>
> ...
>
> sh-2.05b# ./configure --enable-R-shlib
>
> Results of configure:
>
>   R is now configured for powerpc-apple-darwin8.8.0
>
>   Source directory:          .
>   Installation directory:    /Library/Frameworks
>
>   C compiler:                gcc -std=gnu99  -g -O2
>   Fortran 77 compiler:       g77  -g -O2
>
>   C++ compiler:              g++  -g -O2
>   Fortran 90/95 compiler:    g77 -g -O2
>
>   Interfaces supported:      X11, aqua, tcltk
>   External libraries:        readline
>   Additional capabilities:   iconv, MBCS, NLS
>   Options enabled:           framework, shared BLAS, R
> profiling
>
>   Recommended packages:      yes
>
> Then make and install run to completion.
>
> However, when I go to make plr as the postgres user,
> this happens:
>
>     eve:/usr/local/src/postgresql-8.2.0/contrib/plr
>
>     postgres$ make
>
>    *** Cannot build PL/R because libR is not a shared
> library.
>    *** You might have to rebuild your R installation.
> Refer to
> *** the documentation for details.
>
> I thought that "--enable-R-shlib" was supposed to
> handle the shared library error? Any suggestions?
> Thanks in advance for any help you can give.]
>

Pretty much all builds of R for Mac (including the CRAN binary  
version) come with libR.dylib, so that is not really the problem. I'm  
not a pgsql user, so the following is only based on a quick look at R/ 
PL sources. Firstly, you'll need to run something like "R CMD make",  
because the R/PL documentation fails to tell you that it requires you  
to set the environment variables correctly.

Secondly, AFAICs there is a bug in R/PL, because it is not using the  
correct paths in its Makefile. A proper way would be to get the flags  
via R CMD config (as most other packages do), but it's using fixed  
paths are are incorrect for multi-arch R builds (the CRAN build  
creates fat libraries, so it will still work, but other builds may  
fail). If the above trick doesn't work, I suspect that you will have  
to hack the Makefile manually to fix all this. I would suggest you to  
contact the maintainer of R/PL and ask them to use R CMD config for  
linking R which will vastly simplify their Makefile.

Cheers,
Simon



More information about the R-SIG-Mac mailing list