[R-SIG-Mac] Problem with readline when building R from source.

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Sat May 22 04:44:03 CEST 2010


You are right.  Essentially you can change compilers and compiler
flags using a set of environment variables.  These variables are
common across projects where the build process is managed by automake.
 This is especially important if you want to switch between 32 and 64
bit.  My build R script goes more or less like
        ../${SRCDIR}/configure SHELL='/bin/bash' \
            CC="/usr/bin/gcc-4.2 -arch x86_64 -std=gnu99" \
            CFLAGS="-g -O2 -std=gnu99 -march=nocona" \
            CXX="/usr/bin/g++-4.2 -arch x86_64" \
            CXXFLAGS="-g -O2 -march=nocona" \
            OBJC="/usr/bin/gcc-4.2 -arch x86_64" \
            F77="/usr/bin/gfortran-4.2 -arch x86_64" \
            FFLAGS="-g -O2 -march=nocona" \
            FC="/usr/bin/gfortran-4.2 -arch x86_64" \
            FCFLAGS="-g -O2 -march=nocona" \
            --x-includes=/usr/X11/include --x-libraries=/usr/X11/lib \
            --with-system-zlib \
            --with-blas='-framework vecLib' --with-lapack
        make -j2 || exit 1
        make check || exit 1
Note that I have the sources in one directory, but build in another
which is now recommended for many projects.

In general, all of this is more important on OS X than on Linux
because on OS X we typically have 2 compilers and 4 different
architectures.  The -arch flag makes a 64bit version.  And then there
is the whole issue of universal binaries.

Rolf: most of this can be learned from reading:
http://r.research.att.com/building.html

Now, the second set of questions.  Gfortran does not come with Xcode.
Simon has over the last years released various gfortran versions for
use with the various OS X'es.  My guess is that you have a leftover
gfortran you used under your old OS X installation, that is not smart
to use with the current Xcode.  You should remove the old gfortran and
install the new one from
  http://r.research.att.com/tools/
There are quite a few ones there.  Assuming you want to use the newest
and assuming that you have installed Xcode 3.2.2, I would recommend
  http://r.research.att.com/gfortran-42-5659.pkg
In order to uninstall the old one: you just have to remove the files.
For many versions of gfortran, SImon provided something like
gfortran-uninstall, which you may have available.  Using all the
newest stuff may mean that you cannot use binary builds of R packages
from CRAN/Bioconductor (I am not really up to date on this), but if
you build R from source you usually want to build the packages from
source.

All of this is slightly complicated.  But if you wanted it easy, you
should use the CRAN binary build of R :)

Kasper






On Fri, May 21, 2010 at 10:23 PM, Ben Madin
<lists at remoteinformation.com.au> wrote:
> Rolf,
>
> Given the weekend status, I'll hazard a guess that you want to add these as environment variables, so in an attempt to be monosyllabic:
>
> Assuming that you are using the bash shell (which has been the default for a while) log in as the user you are going to run the ./configure script as, and at the command prompt type
>
> export F77="gfortran -arch x86_64"
> export FC="gfortran -arch x86_64"
>
>
> to see what is currently set, just type
>
> export
>
> (if you are still using the tcsh shell, the I think the command becomes setenv instead of export, and it is slightly different, so you will have to look that up)
>
> good luck, I may have the wrong end of the stick here.
>
> cheers
>
> Ben
>
>
>
>
> On 22/05/2010, at 9:21 , Turner Rolf wrote:
>
>>
>>
>> Simon Urbanek wrote:
>>
>>    <SNIP>
>>
>> I bet you are using 32-bit Fortran while using 64-bit gcc for everything else (see this list). You have two options: use F77="gfortran -arch x86_64" FC="gfortran -arch x86_64" or use the Leopard Fortran for Xcode instead of the old Tiger Fortran.
>>
>>    <SNIP>
>>
>> I bet you're right.  But how do I know?  I just do ./configure --- I don't say anything about what/which Fortran to use.
>>
>> Can you go back to being mono-syllabic please?
>>
>> (a) When you say (option 1) `` use F77="gfortran -arch x86_64" FC="gfortran -arch x86_64" '' ***where*** do
>> I ``use'' it.  I.e. how do I go about conveying to the configure process that I wish to set these values for F77
>> and FC?  Do I edit the configure script?  Do I set flags for the ./configure command?  Do I set environment
>> variables?  It's all obvious to you, but not to bunnies such as my very good self.
>>
>> (b) When you say (option 2) ``use the Leopard Fortran for Xcode instead of the old Tiger Fortran'' --- how?
>> I presume that this is really what I should be doing --- but how do I convey to the system that the old Tiger
>> Fortran should not be used?  I would've expected that when I installed Xcode, the Fortran that came with
>> it would be ``the'' Fortran on the machine (that any old Fortrans hanging around would automatically get
>> ditched) or that at the very least the Fortran that came with Xcode would be the one that got used by
>> default.  Naive of me, I know ....
>>
>> Thanks.
>>
>>      cheers,
>>
>>            Rolf
>> ######################################################################
>> Attention:
>> This e-mail message is privileged and confidential. If you are not the
>> intended recipient please delete the message and notify the sender.
>> Any views or opinions presented are solely those of the author.
>>
>> This e-mail has been scanned and cleared by MailMarshal
>> www.marshalsoftware.com
>> ######################################################################
>>
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>



More information about the R-SIG-Mac mailing list