MacOS install gfortran issues

Good morning - I am having some issues installing GULP 5.2 on MacOS using the gfortran compiler installed through home-brew gcc v.10.2.

When executing ./mkgulp it appears to get through to destroy.F90, where an error is then thrown:

**Error:** Rank mismatch between actual argument at **(1)** and actual argument at (2) (scalar and rank-1)**../destroy.F90:266:23:**

I have seen a few issues regarding this and gcc v10 elsewhere online, but I can’t seem to find an obvious workaround. I’m not that familiar with fortran; has anyone else come across this problem?

I’m afraid this is a “feature” of gfortran version 10. Strict checking of array ranks was added and so this means that where a row or column of a 2D array gets passed to a subroutine that expects a 1D array then the compiler gives an error (even though the code would actually work).
The solutions to the issue are:

  1. Use a version of gfortran earlier than 10 (8 and 9 have both been tested and work fine)
  2. Wait for the release of version 6.0 where I have added work arounds by copying to dummy arrays before passing so that gfortran version 10 is happy.
1 Like

Thanks Julian - I went back to gfortran-8.2, which I installed from a standalone installer which is available here for anyone who is interested.

I initially tried using homebrew to install gcc@9, but this caused problems as the compiler is then called as ‘gfortran-9’. I tried to change this in ./mkgulp, this didn’t work. I also tried making an alias in ~/.zsh:
alias 'gfortran'='gfortran-9'

The alias worked, but the compiler still failed. I suspect something to do with `make’. Not sure what I missed - but appears to be working with v.8.2 standalone from gcc.

Thanks for the information. I’m not aware of any issues with gfortran version 9 but if you can provide more details of what goes wrong then I can investigate.