1

I am having trouble re-installing gfortran on my mac after upgrading to mountain lion.

I have:

  • Downloaded the latest version of XCode and installed command line tools.
  • I tried running gfortran but it is not available in gcc4.2 so...
  • I downloaded the latest version of fink and fink commander.
  • I downloaded gcc4.8 through fink and the install was performed successfully.

Now I am stuck, the gfortran command still does not work (command not found), there is also no gcc-4.8 or gfortran-4.8 in usr/bin and so I cannot rename gcc. If I run gcc-4.8 I also get "command not found".

I have spent hours on these sites but still cannot solve the problem, can anyone help me?

2 Answers2

0

If you have installed fink in the default location then the gcc/gfortran/g++ packages should be be found in

/sw/bin

and called

/sw/bin/gcc-fsf-4.8
/sw/bin/gfortran-fsf-4.8 
/sw/bin/g++-fsf-4.8
0

Create a bash script, SelectGCC-4.8.sh, with the following:

sudo cd /usr/local/bin
sudo rm cc gcc c++ g++
sudo ln -s /sw/bin/gcc-fsf-4.8 cc
sudo ln -s /sw/bin/gcc-fsf-4.8 gcc
sudo ln -s /sw/bin/c++-fsf-4.8 c++
sudo ln -s /sw/bin/g++-fsf-4.8 g++

NOTE: only the first sudo will ask for your password

francescalus
  • 30,576
  • 16
  • 61
  • 96