COS - Fortran for Astronomy
gfortran 8.2 for Mojave from 'github' installs in 'HD/usr/local/bin' - check with 'which gfortran' or 'which gfortran-mp-6' on command line.
The Eclipse IDE that covers Fortran has a macOS install. We used the "Eclipse IDE for Scientific Computing " package available here Eclipse . Eclipse packages appear to come as separate apps that install as separate folders with in an overall 'eclipse' folder - in this case this package installs as 'parallel-2018-12'.
However as it calls the gfortran compiler to create the final build of the application, it requires some extra steps to 'find' gfortran, it does not appear to find the file from the normal 'PATH' assigned when the user logs into macOS.Note that the PATH environment variable the Eclipse uses can be different to the PATH set in your .profile !!
There are two ways to start the Eclipse app so it finds 'gfortran':
1. A script that starts Eclipse from the command line, after specifically adding a 'gfortran' location to '$PATH' before starting the app (after existing $PATH in this case), and allowing the Terminal window to then close without terminating Eclipse. Example below:
# We have left the hash exclamation mark in so that the script can be
echo "Start Eclipse with Fortran"
2. Modify the environment for the specific application. This involves editing the application Info.plist and adding an 'LSEnvironment' key. See the Photran 9.1 install guide here for more information.
For macOS 10.4.3 it is required to edit the Info.plist file for the Eclipse executable, and then re-register the Eclipse application with the Launch Service database.
a. In Finder, locate the Eclipse application and Right-click on it to 'Show Package Contents'.
b. Open the Contents folder.
c. Right-click on Info.plist, select Open With, and select Other. Choose TextEdit or say BBEdit, and click OK to open the file in the app.
d. Add an LSEnvironment dictionary below the <dict> line and above the <key>CFBundleExecutable</key> line. An example is shown below.
to the existing PATH. Save the file and exit the editor when done.
Finally we have to reregister the Eclipse app with Launch Services so it starts with correct paths. In Terminal type the following lines - with the 'eclipse' path as it applies to your system. Here it is in the User/Eclipse folder.
This page contains links to various Fortran related reference material. However we use the Fortran 95 standard in our programs at present.
Example screen shot of Kepler Orbits code running in Fortran. This is a macOS command line program.