title: Cross-compiling R for ARM (Raspberry Pi)
body: <p>I need to build R (<a href="http://www.r-project.org/" rel="nofollow">http://www.r-project.org/</a>) for Arch Linux ARM running on Raspberry Pi.  I am having trouble running ./configure.  I have built my own toolchain using crosstool-ng and it does work, I've compiled other applications with it just fine.</p>
  
  <p>The issue appears to be that I cannot link the Fortran libraries to C code.  Here is where configure fails:</p>
  
  <pre><code>checking for Fortran 77 libraries of gfortran...  -L/home/njackson/bcm2708rpi-toolchain/lib -L/home/njackson/bcm2708rpi-toolchain/lib/gcc/arm-rpi-linux-gnueabi/4.7.3 -L/home/njackson/bcm2708rpi-toolchain/arm-rpi-linux-gnueabi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lgfortran -lm /home/njackson/bcm2708rpi-toolchain/arm-rpi-linux-gnueabi/lib/libgfortran.a /home/njackson/bcm2708rpi-toolchain/lib/gcc/arm-rpi-linux-gnueabi/4.7.3/libgcc.a
  checking for dummy main to link with Fortran 77 libraries... unknown
  configure: error: in `/home/njackson/R-2.15.3':
  configure: error: linking to Fortran libraries from C fails
  See `config.log' for more details
  </code></pre>
  
  <p>It fails here.</p>
  
  <p>I used the following configure command:</p>
  
  <pre><code>./configure --host=arm-linux-gnueabihf CC=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-gcc CXX=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-g++ FC=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-gfortran MAIN_LD=/home/njackson/bcm2708rpi-toolchain/bin/arm-rpi-linux-gnueabi-ld --with-readline=no
  </code></pre>
  
  <p>I'd appreciate help getting this compiled.  Thanks.</p>