Tuesday, May 30, 2023

Installing GFortran in MacPorts

 After some googling, I discovered the pages on how to install gcc and gfortran in MacPorts.

There are several versions of gcc available, but all except version 12 returned a warning that their installation would fail.  This is probably a MacOS Ventura thing -- is version 12 the version for Ventura?

sudo port install gcc12 

worked without too much fuss, not to long to install, and gfortran seems to be part of /usr/local/bin

bin/gfortran-mp-12

bin/gcc-mp-12

One can alias these in the .cshrc file, or can ask macports to do it.  From 

"I had to combine these two answers as follows: sudo port install gcc11 +gfortran; sudo port select --set gcc mp-gcc11 
– pidloop
 Jan 19, 2022 at 23:12"

The spelling of this port command for aliasing is correct, even though the spelling of the executable file in the ./bin subdirectory is different

sudo port select --set gcc mp-gcc12

enables the command "gfortran" to find the gcc12 version of gfortran.



No comments:

 
Link