set default gcc among different versions

Gmail yangzf01 at gmail.com
Mon Nov 18 10:04:00 PST 2013


Hi vq

Thank you so much. I can run gfortran-mp-4.8 directly. In that case, I do not need to make it as default fortran compiler.

Thank you
Bruce
On Nov 18, 2013, at 1:11 AM, Lawrence Velázquez <larryv at macports.org> wrote:

> On Nov 18, 2013, at 2:00 AM, Gmail <yangzf01 at gmail.com> wrote:
> 
>> I have installed 2 versions of gcc. One is from Mac BUILT-IN. The other one is from macports. So how can I make the gcc installed by macports as the default gcc while I compile c program? BTW, in the /opt/local/bin directory, I can find gcc-mp-4.8 and gfortran-mp-4.8, instead of gcc and gfortran. I am not sure if this is correct.
> 
> That is correct. The executables are named that way to allow different versions of GCC to be installed simultaneously. You could just run those executables directly.
> 
> If you can't or won't do that, you can run "sudo port select --set gcc mp-gcc48" to create /opt/local/bin/{gcc,gfortran}, which will be symlinks to the actual executables.
> 
> vq

Thank you
Zhifeng (Bruce) Yang
Department of Earth and Atmospheric Sciences
University of Nebraska-Lincoln
Homepage : http://zyang01.com/



More information about the macports-users mailing list