[R-SIG-Mac] R 3.0.1 build from sources: Wrong library paths
Simon Urbanek
simon.urbanek at r-project.org
Thu Sep 12 14:54:14 CEST 2013
On Sep 12, 2013, at 5:50 AM, Simon Zehnder wrote:
> I compiled R and made a check-all without errors (only for the PDF manuals - but this is ok). Then I used
>
> sudo make install
>
> to install it to the R.framework. Now, when I want to use R on the shell no command can be found, as the installation has not installed the binaries in /usr/bin. If I try to change my PATH variable and add /Library/Frameworks/R.framework/Ressources/bin it does not change a thing, I still get the error: -bash: R: command not found. The only thing to make it work is to go into the folder /Libraries/Frameworks/R.framework/Ressources/bin/ and start it via ./R.
>
What the CRAN installer does is essentially
sudo ln -s /Library/Frameworks/R.framework/Resources/bin/R /usr/bin/R
Obviously, changing the PATH works as well - make sure you check the value of PATH in the session you're running (bash uses a cached lookup, but recent versions should have no trouble re-trying after PATH changes) -- assuming running
/Libraries/Frameworks/R.framework/Ressources/bin/R
works. If it doesn't then maybe check the version symlinks.
Re you earlier post - FSF builds of gcc don't support ObjC with Apple runtime, so you have to use Apple's clang (as you did). In my tests few months ago gcc 4.7/4.8 was too unreliable - it was miscompiling R so things were breaking randomly at run-time. If your build seems reliable, please share with use the exact version and settings.
Thanks,
Simon
> I remember no such behaviour for prior builds of R. It seems Mac has changed something since my last compilation of R sources.
>
> Can anyone help?
>
> Best
>
> Simon
>
> On Sep 12, 2013, at 10:49 AM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
>
>> I did some progress on my problem:
>>
>> Using LDFLAGS and CPPFLAGS on the shell instead of in the config.site file changes the directories and make can find all the libraries.
>>
>> The next thing that came up, was the Mac-specific Cocoa issue. When I compile R sources with OBJC="gcc -arch x86_64" I get the following outputs:
>>
>> config.log: https://gist.github.com/anonymous/6534550
>>
>> make.log: https://gist.github.com/anonymous/6534560
>>
>> with errors starting in line 883 of the make.log. So it seems the gcc cannot handle the .m files properly.
>>
>> Then I used OBJC="clang" and I get the following output:
>>
>> config.log: https://gist.github.com/anonymous/6534614
>>
>> make.log: https://gist.github.com/anonymous/6534606
>>
>> Here I get (see line 879 in the make.log) some weird warning. I know these are only warnings, they do not influence the way R works later on, but I am interested why gcc cannot handle the Cocoa files at all and clang has these warnings.
>>
>>
>> Best
>>
>> Simon
>>
>>
>> On Sep 11, 2013, at 11:08 PM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
>>
>>> Dear R-Users and R-Devels,
>>>
>>> I made a brand new install of Mac OS X Mountain Lion 10.8.4 on a new hard drive and want to build R from sources. As I use OpenMP 3.1 in my C++ extensions I used MacPorts to get the gcc48 compiler collection. Installation run without a hassle and I set the mp-gcc48 active.
>>>
>>> I downloaded the R-3.0.1 tar.gz and extracted it. Then I changed the config.site to the following:
>>>
>>> https://gist.github.com/anonymous/6529767
>>>
>>> Furthermore I had to change my PATH variable in the .profile as it included /usr/local/bin:/usr/local/sbin and I have not such a folder in my /usr.
>>>
>>> Now when I run configure I get the following config.log
>>>
>>> https://gist.github.com/anonymous/6529743
>>>
>>> with the warning: "ld: warning: directory not found for option '-L/usr/local/lib' "on line 217. This warning becomes an error if running the make command. I still see the C linker using -L/usr/local/lib which does not exist. I changed the LDFLAGS in the config.site to -L/opt/local/lib but Rs configure script seems to be very resistant to my new proposal.
>>>
>>> I need some help. How should I proceed? Which FLAGS can change the directory the make script searches for libraries? What configure options should be used with R-3.0.1 on OS X 10.8.4 using gcc-4.8.1?
>>>
>>>
>>> Best
>>>
>>> Simon
>>>
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>
More information about the R-SIG-Mac
mailing list