Preferring gfortran over g77 on OS X and other distributions?

f2py, by default, seems to prefer g77 (no longer maintained, deprecated, speedy, doesn't support Fortran 90 or Fortran 95) over gfortran (maintained, slower, Fortran 90 and Fortran 95 support). This causes problems when we try to compile Fortran 90 extensions using f2py on platforms where both g77 and gfortran are installed without manually switching the compiler's flags. It is a very minor edit to the fcompiler/__init__.py file to prefer gfortran over g77 on OS X, and I can think of almost no reason not to do so, since the Vectorize framework (OS X tuned LAPACK/BLAS) appears to be ABI compatible with gfortran. I am not sure what the situation is on the distributions that numpy is trying to support, but my feeling is that g77 should not be preferred when gfortran is available. Regards, Aron

On Mon, Jun 18, 2012 at 9:47 AM, Aron Ahmadia <aron@ahmadia.net> wrote:
f2py, by default, seems to prefer g77 (no longer maintained, deprecated, speedy, doesn't support Fortran 90 or Fortran 95) over gfortran (maintained, slower, Fortran 90 and Fortran 95 support).
This causes problems when we try to compile Fortran 90 extensions using f2py on platforms where both g77 and gfortran are installed without manually switching the compiler's flags. It is a very minor edit to the fcompiler/__init__.py file to prefer gfortran over g77 on OS X, and I can think of almost no reason not to do so, since the Vectorize framework (OS X tuned LAPACK/BLAS) appears to be ABI compatible with gfortran. I am not sure what the situation is on the distributions that numpy is trying to support, but my feeling is that g77 should not be preferred when gfortran is available.
On Windows g77 is still the default. But indeed, on OS X gfortran is the recommended Fortran compiler. A PR for this would be useful. Ralf

I've promoted gfortran to be the default compiler on OS X over vendor compilers (to be more compatible with Linux), and made a similar adjustment for the platform detection. I've promoted gfortran over g77 but not vendor compilers on the other 'nixes. I left the Windows compiler options alone. https://github.com/numpy/numpy/pull/325 A On Wed, Jun 27, 2012 at 10:46 PM, Ralf Gommers <ralf.gommers@googlemail.com>wrote:
On Mon, Jun 18, 2012 at 9:47 AM, Aron Ahmadia <aron@ahmadia.net> wrote:
f2py, by default, seems to prefer g77 (no longer maintained, deprecated, speedy, doesn't support Fortran 90 or Fortran 95) over gfortran (maintained, slower, Fortran 90 and Fortran 95 support).
This causes problems when we try to compile Fortran 90 extensions using f2py on platforms where both g77 and gfortran are installed without manually switching the compiler's flags. It is a very minor edit to the fcompiler/__init__.py file to prefer gfortran over g77 on OS X, and I can think of almost no reason not to do so, since the Vectorize framework (OS X tuned LAPACK/BLAS) appears to be ABI compatible with gfortran. I am not sure what the situation is on the distributions that numpy is trying to support, but my feeling is that g77 should not be preferred when gfortran is available.
On Windows g77 is still the default. But indeed, on OS X gfortran is the recommended Fortran compiler. A PR for this would be useful.
Ralf
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On Wed, Jun 27, 2012 at 11:26 PM, Aron Ahmadia <aron@ahmadia.net> wrote:
I've promoted gfortran to be the default compiler on OS X over vendor compilers (to be more compatible with Linux), and made a similar adjustment for the platform detection. I've promoted gfortran over g77 but not vendor compilers on the other 'nixes. I left the Windows compiler options alone.
Aron made this change for {mac, linux, posix, sun, irix, aix} in his PR. I think it's a good idea for {mac, linux} and perhaps posix, and to leave the other platforms alone. Does anyone else have an opinion on this? Ralf On Wed, Jun 27, 2012 at 10:46 PM, Ralf Gommers <ralf.gommers@googlemail.com>wrote:
On Mon, Jun 18, 2012 at 9:47 AM, Aron Ahmadia <aron@ahmadia.net> wrote:
f2py, by default, seems to prefer g77 (no longer maintained, deprecated, speedy, doesn't support Fortran 90 or Fortran 95) over gfortran (maintained, slower, Fortran 90 and Fortran 95 support).
This causes problems when we try to compile Fortran 90 extensions using f2py on platforms where both g77 and gfortran are installed without manually switching the compiler's flags. It is a very minor edit to the fcompiler/__init__.py file to prefer gfortran over g77 on OS X, and I can think of almost no reason not to do so, since the Vectorize framework (OS X tuned LAPACK/BLAS) appears to be ABI compatible with gfortran. I am not sure what the situation is on the distributions that numpy is trying to support, but my feeling is that g77 should not be preferred when gfortran is available.
On Windows g77 is still the default. But indeed, on OS X gfortran is the recommended Fortran compiler. A PR for this would be useful.
Ralf
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Aron made this change for {mac, linux, posix, sun, irix, aix} in his PR. I think it's a good idea for {mac, linux} and perhaps posix, and to leave the other platforms alone. Does anyone else have an opinion on this?
Ralf, that sounds good to me. If you feel that we should leave sun, irix, and aix alone, we should probably leave out posix as well. If everyone concurs, I'll issue a new PR adjusting mac and linux. A

On Fri, Jul 6, 2012 at 11:15 AM, Aron Ahmadia <aron@ahmadia.net> wrote:
Aron made this change for {mac, linux, posix, sun, irix, aix} in his PR. I
think it's a good idea for {mac, linux} and perhaps posix, and to leave the other platforms alone. Does anyone else have an opinion on this?
Ralf, that sounds good to me. If you feel that we should leave sun, irix, and aix alone, we should probably leave out posix as well.
If everyone concurs, I'll issue a new PR adjusting mac and linux.
You can just make the change in the existing PR. Either add a new commit, or amend the existing one and force push. Multiple PRs for the same issue makes things harder to follow. Ralf
participants (2)
-
Aron Ahmadia
-
Ralf Gommers