gfortran on MacOS X
If you just want to use the precompiled gfortran, use
APT/RPM as follows.
How to Install a Precompiled Binary
A binary package is available as an RPM which can be installed using
# apt-get update
# apt-get install gcc
# apt-get clean
Notice that this will replace your default gcc compilers (gcc and g++), which is necessary to allow mixed use of C, C++, and FORTRAN for a single application.
The default gcc compilers can be switched by using the "update-altarnatives" command as follows
and answering the questions:
# update-alternatives --config gcc
- As a general rule, you should make sure
that optimization does not change your results.
- Avoid too many else if's in the same
level. You sometimes need to nest them, if the compiler abends.
- gfortran forbids jumping into a different
- gfortran does not initialize a "BLOCK DATA"
even if you declare it "EXTERNAL". In order to force it, say "blkdat",
initialized, I needed a trick like
- gfortran now returns IOSTAT=5002 (instead of IOSTAT=3 as with gcc-4.2 or older), when the EOF is
reached for an random access file, which behavior is different from
that of g77.
- gcc, g++, and gfortran now use system's
math library (libm.dylib), whenever possible, which sometimes causes a
problem, since some functions in libm behave differently from those
used to be supplied by gcc-associated libraries (a typical example is
"csqrt": see cernlib page).
- Here is a sample FCFLAGS I usually use to compile my legacy
FCFLAGS = -fno-automatic
to Keisuke Fujii's HEP on X Page
firstname.lastname@example.org Dec. 28, 2016