[R] RMySQL not loading on Mac OS X

Georg Otto georg.otto at tuebingen.mpg.de
Thu Aug 18 11:46:16 CEST 2005


Bill,

thanks a lot for your answer. I did not know about the sig-Mac list.  
I will post there next time if I do not find a solution.

Concerning your suggestion: The system default compiler is gcc 4.0,  
but RMySQL seems to be built using gcc-3.3 regardless if I switch to  
3.3. or not.

Would it be a solution to force RMySQL to use gcc 4.0 during built?  
(Might be a naive idea, I am quite new to this). And if yes, how  
could I do this?

Best,

Georg


On 18 Aug 2005, at 04:21, Bill Northcott wrote:

> On 11/08/2005, at 8:00 PM, Georg Otto wrote:
>
>> I have a problem loading RMySQL 0.5-5 on Mac OS 10.4.2 running R  
>> 2.1.1.
>>
>> I installed RMySQL using:
>>
>> export PKG_CPPFLAGS="-I/usr/local/mysql/include"
>> export PKG_LIBS="-L/usr/local/mysql/lib -lmysqlclient"
>>
>> R CMD INSTALL /Users/gwo/Desktop/RMySQL_0.5-5.tar.gz
>>
>>
>> The installation seemed to work ok, but when I load RMySQL in R I get
>> an error message:
>>
>>
>>
>>> library(RMySQL)
>>>
>>>
>> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>>          unable to load shared library '/Library/Frameworks/
>> R.framework/Resources/library/RMySQL/libs/RMySQL.so':
>>    dlopen(/Library/Frameworks/R.framework/Resources/library/RMySQL/
>> libs/RMySQL.so, 6): Symbol not found: _printf$LDBLStub
>>    Referenced from: /Library/Frameworks/R.framework/Resources/ 
>> library/
>> RMySQL/libs/RMySQL.so
>>    Expected in: flat namespace
>> Error in library(RMySQL) : .First.lib failed for 'RMySQL'
>>
>> Any hint will be highly appreciated!
>>
>>
> I notice this question never got a reply.
>
> It would have been better asked on the sig-Mac list, but here are  
> some pointers.
>
> The
>
>> libs/RMySQL.so, 6): Symbol not found: _printf$LDBLStub
>>
> is caused by not linking all the necessary system libraries.
>
> Either
> 1.  there is an attempt to link objects and/or static libraries  
> built with gcc-3.x/g77 with objects produced by gcc-4.x/gfortran.   
> This will not work.
> or
> 2.  there is an attempt to link using ld or libtool rather than the  
> gcc compiler driver which will ensure that appropriate system  
> libraries are used.
>
> FWIW I had no problem building it, but I was using an R package  
> which I built from source.  So I know the same compiler was used  
> throughout.
>
> If you are using the R binary distribution, make sure you have run  
> 'sudo gcc_select 3.3' to get the right default compiler.
>
> Bill Northcott
>




More information about the R-help mailing list