Hello, I have basic familiarity with Unix but by most standards a novice. I am trying to install R on a linux machine and am following the instructions in the R install and admin guide in terms of what is required to compile the R source code. I downloaded R version 2.11.1 and extracted the files into my home directory. I realize I need a FORTRAN compiler to help with this process and have tried installing a few but still cannot past the configuration step of installing R: ./configure --with-readline=no Once I run this command after installing GFortran I get the following error: ... checking whether we can compute C Make dependencies... yes, using gcc -std=gnu99 -MM checking whether gcc -std=gnu99 supports -c -o FILE.lo... yes checking how to get verbose linking output from gfortran... configure: WARNING: compilation failed checking for Fortran 77 libraries of gfortran... checking how to get verbose linking output from gcc -std=gnu99... -v checking for C libraries of gcc -std=gnu99... -L/usr/local/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lgcc_s checking for dummy main to link with Fortran 77 libraries... none checking for Fortran 77 name-mangling scheme... configure: error: in `/home/lotayv01/R-2.11.1': configure: error: cannot compile a simple Fortran program See `config.log' for more details. For more details I can show you the section in the config.log file ... /data/home/lotayv01/usr/local/gfortran/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.0/f951: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory configure:22471: $? = 1 configure: failed program was: | program main | | end configure:22548: WARNING: compilation failed configure:22554: result: configure:22556: checking for Fortran 77 libraries of gfortran configure:22579: gfortran -o conftest -L/usr/local/lib64 conftest.f /data/home/lotayv01/usr/local/gfortran/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.0/f951: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory ... When I check the version of Gfortran at the console command line I get this: GNU Fortran (GCC) 4.6.0 20100407 (experimental) [trunk revision 158083] Copyright (C) 2010 Free Software Foundation, Inc. Even before this I tried the g95 fortran compiler and the same thing happened, how can I fix this problem, any help on this matter would be greatly appreciated. Thanks -- View this message in context: http://r.789695.n4.nabble.com/R-linux-install-FORTRAN-compiling-error-tp2240821p2240821.html Sent from the R help mailing list archive at Nabble.com.
This is not an issue with R, but with gfortran. See the following: http://gcc.gnu.org/wiki/GFortran#news (under heading "gfortran 4.5") http://gcc.gnu.org/ml/fortran/2010-04/msg00061.html Also, I suspect you are using a precompiled gcc/gfortran, and it assumes you have libmpc.so.2 <http://www.muliprecision.org> installed. If you compile all of gcc, you won't see this problem. However, this is probably not the simplest solution. I'd try the solution in the second link above. Else, if `gcc --version` <= 4.4, get the compiled gfortran at that version. P.S. `grep -R mpc.h R-2.11.1/*` indicates R does not depend on libmpc Matt Shotwell Graduate Student Division of Biostatistics and Epidemiology Medical University of South Carolina On Wed, 2010-06-02 at 17:07 -0400, vaneet wrote:> Hello, > > I have basic familiarity with Unix but by most standards a novice. I am > trying to install R on a linux machine and am following the instructions in > the R install and admin guide in terms of what is required to compile the R > source code. I downloaded R version 2.11.1 and extracted the files into my > home directory. I realize I need a FORTRAN compiler to help with this > process and have tried installing a few but still cannot past the > configuration step of installing R: > > ./configure --with-readline=no > > Once I run this command after installing GFortran I get the following error: > ... > checking whether we can compute C Make dependencies... yes, using gcc > -std=gnu99 -MM > checking whether gcc -std=gnu99 supports -c -o FILE.lo... yes > checking how to get verbose linking output from gfortran... configure: > WARNING: compilation failed > > checking for Fortran 77 libraries of gfortran... > checking how to get verbose linking output from gcc -std=gnu99... -v > checking for C libraries of gcc -std=gnu99... -L/usr/local/lib64 > -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 > -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 > -L/usr/lib/../lib64 -lgcc_s > checking for dummy main to link with Fortran 77 libraries... none > checking for Fortran 77 name-mangling scheme... configure: error: in > `/home/lotayv01/R-2.11.1': > configure: error: cannot compile a simple Fortran program > See `config.log' for more details. > > For more details I can show you the section in the config.log file > > ... > /data/home/lotayv01/usr/local/gfortran/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.0/f951: > error while loading shared libraries: libmpc.so.2: cannot open shared object > file: No such file or directory > configure:22471: $? = 1 > configure: failed program was: > | program main > | > | end > configure:22548: WARNING: compilation failed > configure:22554: result: > configure:22556: checking for Fortran 77 libraries of gfortran > configure:22579: gfortran -o conftest -L/usr/local/lib64 conftest.f > /data/home/lotayv01/usr/local/gfortran/bin/../libexec/gcc/i686-pc-linux-gnu/4.6.0/f951: > error while loading shared libraries: libmpc.so.2: cannot open shared object > file: No such file or directory > ... > > When I check the version of Gfortran at the console command line I get this: > GNU Fortran (GCC) 4.6.0 20100407 (experimental) [trunk revision 158083] > Copyright (C) 2010 Free Software Foundation, Inc. > > Even before this I tried the g95 fortran compiler and the same thing > happened, how can I fix this problem, any help on this matter would be > greatly appreciated. > > Thanks
P.S. My linux machine has the following info: Red Hat Enterprise Linux Server release 5.5 (Tikanga) -- View this message in context: http://r.789695.n4.nabble.com/R-linux-install-FORTRAN-compiling-error-tp2240821p2241770.html Sent from the R help mailing list archive at Nabble.com.
On Jun 3, 2010, at 9:17 AM, vaneet wrote:> > Thanks for your replies. > > I understand you think the best solution is to find the gfortran and > possibly libgfortran packages from the version of my Linux and gcc > distribution which according to a quick check is the following (also this is > a 64 bit linux machine): > > gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48) > Copyright (C) 2006 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > The question is do you know where I can find a free gfortran package from > this distribution and would I need to completely reinstall the gcc package > from that version that includes gfortran and other compilers or can I simply > add gfortran to my existing packages? > > ThanksSorry that I am coming to this late, but is there a reason that you did not install R using already available RPMs other than perhaps not being aware that they exist? For RHEL 4 and 5 there is the EPEL: https://fedoraproject.org/wiki/EPEL which provides pre-built binaries of many add-on packages, including R. R 2.11.0 is available there and Tom Callaway posted on the Fedora SIG list this morning that 2.11.1 is in the updates testing repo. If you do need a FORTRAN compiler, which you may yet for add-on CRAN packages, one should be available via the regular RHEL repos, for which you would have already paid for access (not to mention direct telephone support from RH). For RHEL 5 (based upon your followup), follow the instructions here: https://fedoraproject.org/wiki/EPEL/FAQ#howtouse to gain access to the EPEL. Then, as root, you can use: yum install R-core R-devel to install R. By staying with RPMs specifically built for your release, you tend to obviate version incompatibility issues, as Prof. Ripley has noted. HTH, Marc Schwartz