0

I have been trying to tackle this problem for quite some time now, and it seems like I just can't. After loading some packages I try to source a C++ file, and this is what happens:

sourceCpp("Desktop/studie/master/Scriptie/R files/simulExpRcpp.cpp");  

Error in sourceCpp("Desktop/studie/master/Scriptie/R files/simulExpRcpp.cpp") : 
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install Command Line Tools for XCode (or equivalent).

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'

I have installed gfortran as indicated here, and double checked whether I correctly installed CommandLineTools. Also, my system runs on OS X Mavericks 10.9.5.

I assume the problem has something to do with the library, for which some possible solutions are given here. However, as I am quite new to R, I do not really get all the subtleties yet and the solutions are somewhat abracadabra to me.

Is there someone who can explain to me very carefully what I can do to resolve the problem? Thanks in advance for the help!

Community
  • 1
  • 1
Christov
  • 178
  • 5
  • The error message tells you what to do. "Please install Command Line Tools for XCode (or equivalent)" – Jonathan Potter May 31 '15 at 21:32
  • You haven't told us how you have your system set up. My guess is that you used homebrew to install part of it, and aren't telling us. – IRTFM May 31 '15 at 22:14
  • 1
    @JonathanPotter: Like I said, I have installed Command Line Tools, which I checked with terminal. – Christov Jun 01 '15 at 07:05
  • @BondedDust: I installed gfortran using this command in terminal: curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2 -C / I now see that this might have something to do with homebrew, will dive into that – Christov Jun 01 '15 at 07:08
  • Update: R looks for the file in "-L/usr/local/lib/gcc" while it appears to be in "-L/usr/local/gfortran/lib/gcc". Is there a way to change this? – Christov Jun 01 '15 at 09:21
  • I can think of some possibilities and I not sure which one to recommend. You might try posting that particular question on SuperUser.com. You may need to change: the $PATH variable so that location is searched or put in the proper environment variable or put a dylib in the expected directory pointing to the actual location. And I'm still worried about the message saying no command line tools were found. Fortran is not a command line tool. – IRTFM Jun 01 '15 at 15:31
  • I had a simliar problem and I can recommend the installers found at https://github.com/fxcoudert/gfortran-for-macOS/releases – Balthasar Oct 19 '21 at 19:13

0 Answers0