[R-SIG-Mac] R compile from sources: error in make with gcc-4.7

Simon Urbanek simon.urbanek at r-project.org
Fri Sep 14 16:36:06 CEST 2012


On Sep 14, 2012, at 10:01 AM, Simon Zehnder wrote:

> Running through the errors of my make output on http://pastebin.com/HXqLgH4b (without aqua) pulled my attention to the following error: 
> 
> In file included from ../../../../src/modules/lapack/vecLibg95c.c:5:0:
> /System/Library/Frameworks/vecLib.framework/Headers/vecLib.h:22:4: error: #error "<vecLib/vecLib.h> is deprecated.  Please #include <Accelerate/Accelerate.h> and link to Accelerate.framework."
> 
> This error is, I think from you Simon, already commented on http://permalink.gmane.org/gmane.comp.lang.r.mac/7293. So I followed your advice there and added the flag CPPFLAGS=-D ACCELERATE to my configure command:
> 

That's not what I suggested. Use copy/paste properly or, preferably, use R-patched or R-devel.

Cheers,
Simon


> 1. (Configure) The whole command is:
> 
> ../configure CC="gcc-4.7 -arch $arch" CXX="g++-4.7 -arch $arch" F77="gfortran-4.7 -arch $arch" FC="gfortran-4.7 -arch $arch" OBJC="gcc-4.7 -arch $arch" --x-includes=/usr/X11/include/ --x-libraries=/usr/X11/lib/ --with-blas='-framework libVec' --with-lapack --without-aqua CPPFLAGS="-D ACCELERATE"
> 
> All runs fine - no errors nor warnings.
> 
> 2. (Make) I run the make via:
> 
> make -j 8
> 
> and I get the following errors: http://pastebin.com/5UfaMK6r
> 
> It seems that the flag CPPFLAGS=-D ACCELERATE does not modify the compilers work. 
> 
> Any suggestions here?
> 



> 
> Best regards
> 
> Simon
> 
> 
> On Sep 14, 2012, at 3:23 PM, Simon Zehnder <szehnder at uni-bonn.de> wrote:
> 
>> I now reinstalled XCode and build the gcc-4.7 new, explicitly telling to build a objc compiler. Furthermore I installed the XQuartz package and can now use the symbolic link /usr/X11. 
>> 
>> 1. (Configure) Running the command: 
>> 
>> ../configure CC="gcc-4.7 -arch $arch" CXX="g++-4.7 -arch $arch" F77="gfortran-4.7 -arch $arch" FC="gfortran-4.7 -arch $arch" OBJC="gcc-4.7 -arch $arch" --x-includes=/usr/X11/include/ --x-libraries=/usr/X11/lib/ --with-blas='-framework libVec' --with-lapack
>> 
>> or
>> 
>> ../configure CC="gcc-4.7 -arch $arch" CXX="g++-4.7 -arch $arch" F77="gfortran-4.7 -arch $arch" FC="gfortran-4.7 -arch $arch" OBJC="objc-4.7 -arch $arch" --x-includes=/usr/X11/include/ --x-libraries=/usr/X11/lib/ --with-blas='-framework libVec' --with-lapack
>> 
>> Gives no errors nor warnings in the configure step.
>> 
>> 2. (Make) Doing a make with:
>> 
>> make -j 8
>> 
>> gives me still errors with aqua: http://pastebin.com/n3g6zYfS
>> 
>> If I try to build without aqua I do the following:
>> 
>> 1. (Configure) I configure with: 
>> 
>> ../configure CC="gcc-4.7 -arch $arch" CXX="g++-4.7 -arch $arch" F77="gfortran-4.7 -arch $arch" FC="gfortran-4.7 -arch $arch" OBJC="objc-4.7 -arch $arch" --x-includes=/usr/X11/include/ --x-libraries=/usr/X11/lib/ --with-blas='-framework libVec' --with-lapack --without-aqua
>> 
>> All runs fins - no errors nor warnings. 
>> 
>> 2. (Make) Running the command::
>> 
>> make -j 8
>> 
>> gives again errors with X11 (but quite different): http://pastebin.com/HXqLgH4b
>> 
>> Is there still a possible way to build R from sources with gcc-4.7?
>> 
>> 
>> Best regards
>> 
>> Simon
>> 
>> Begin forwarded message:
>> 
>>> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
>>> Subject: Re: [R-SIG-Mac] R compile from sources: error in make with gcc-4.7
>>> Date: September 13, 2012 10:33:32 PM GMT+02:00
>>> To: r-sig-mac at r-project.org
>>> 
>>> On 13/09/2012 20:48, Simon Urbanek wrote:
>>>> It seems your compiler doesn't support ObjC. You should get a working
>>>> compiler... Besides, gcc-4.7.x has been reported to break so your
>>>> mileage may vary even if you get Apple driver and a more complete
>>>> compiler. More comments inline below.
>>>> 
>>>> Cheers, Simon
>>>> 
>>>> 
>>>> On Sep 13, 2012, at 3:21 PM, Simon Zehnder wrote:
>>>> 
>>>>> Hi R-fellows,
>>>>> 
>>>>> I have some fatal errors compiling the R source files with
>>>>> gcc-4.7.1 on my Mountain Lion and I wonder if this is only on my
>>>>> Mac or if it does happen on other Macs too (I use the gcc-4.7 as I
>>>>> want to compile some C++ code that uses OpenMP 3.1).
>>>>> 
>>>>> Here is the way I did it:
>>>>> 
>>>>> 1. (gcc-4.7) Install gcc-4.7 on my Mac following
>>>>> http://solarianprogrammer.com/2012/07/21/compiling-gcc-4-7-1-mac-osx-lion/
>>>>> (This runs quite well)
>>>>> 
>>>>> 2. (Configure) Getting the R-2.15.1.tar.gz from
>>>>> http://cran.r-project.org,
>>>>> 
>>>>> I used on the shell:
>>>>> 
>>>>> tar -zxvf R-2.15.1.tar.gz cd R-2.15.1* mkdir build && cd build
>>>>> 
>>>>> Further, for the R configure to work it needs the XCode Command
>>>>> Line Tools
>>>>> 
>>>>> Now as the gcc-4.7 is not the default compiler on my Mac and R
>>>>> needs X11 the configure line is a little nasty but works without
>>>>> errors (see also
>>>>> http://stat.ethz.ch/R-manual/R-patched/doc/manual/R-admin.html#Installing-R-under-_0028Mac_0029-OS-X):
>>>>> 
>>>>> 
>>>>> 
>>> ../configure CC="gcc-4.7 -arch x86_64" CXX="g++-4.7 -arch x86_64" F77="gfortran-4.7 -arch x86_64" FC="gfortran-4.7 -arch x86_64" OBJC="gcc-4.7 -arch x86_64" -x-libraries=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11/lib -x-includes=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11/include --with-lapack --with-blas='framework vecLib'
>>>>> 
>>>>> (The usual installation given on
>>>>> http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html, i.e.:
>>>>> 
>>>>> ../configure CC="gcc-4.7 -arch $arch" CXX="g++-4.7 -arch $arch"
>>>>> F77="gfortran-4.7 -arch $arch" FC="gfortran-4.7 -arch $arch"
>>>>> OBJC="gcc-4.7 -arch $arch" --x-includes=/usr/X11/include
>>>>> --x-libraries=/usr/X11/lib --with-blas='framework vecLib'
>>>>> --with-lapack
>>>>> 
>>>>> having defined arch=x86_64
>>>>> 
>>>>> does not work on my machine, as it seems that XCode installs the
>>>>> Command Line Tools with the X11SDK in
>>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11.
>>>> 
>>>>> 
>>>> Again, possibly a problem with your compiler, a supported compiler
>>>> doesn't need that hack. But also 10.8 doesn't come with X11 so I
>>>> assume you installed XQuartz accordingly ...
>>>> 
>>>> 
>>>>> Compiling with this line usually gives:
>>>>> 
>>>>> configure: error: --with-x=yes (default) and X11 headers/libs are
>>>>> not available)
>>>>> 
>>>> 
>>>> Note that the instructions are for Apple compilers and those
>>>> compatible (e.g. FSF builds with Apple driver driver which adds extra
>>>> flags and parses others). For any other compilers, you're on your own
>>>> and the flags may vary.
>>>> 
>>>> 
>>>>> 3. (Make) Doing now the make gives me huge amount of fatal errors
>>>>> with no clue where it comes from and no google documentations so
>>>>> far. All make output can be seen here:
>>>>> http://pastebin.com/3baL8php
>>>>> 
>>>>> I have really no clue where these come from,
>>>> 
>>>> They some from including AppKit, apparently your compiler doesn't
>>>> even work with system frameworks. Even if you fix this instance there
>>>> is Quartz as well. There are a lot of broken compiler builds around,
>>>> so I'm not surprised. If you have to avoid all system services, you
>>>> can try to build without aqua, but I don't think that has been tested
>>>> recently on OS X ...
>>> 
>>> Would yesterday do?
>>> 
>>>> 
>>>> 
>>>>> but maybe somebody of you guys has encountered either these errors
>>>>> as well or has found another way to compile R with gcc-4.7?
>>>>> 
>>>>> 
>>>>> Best Regards
>>>>> 
>>>>> Simon
>>>>> 
>>>>> [[alternative HTML version deleted]]
>>>>> 
>>>>> _______________________________________________ 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
>>>> 
>>> 
>>> 
>>> -- 
>>> 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
>>> 
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 
>> 
>> 	[[alternative HTML version deleted]]
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> 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