BLD: fortran: only use -std=legacy for gfortran#21917
BLD: fortran: only use -std=legacy for gfortran#21917tylerjereddy merged 1 commit intoscipy:mainfrom
-std=legacy for gfortran#21917Conversation
Support in other compilers for this flag is quite patchy, leading to build errors and requiring workarounds in distros - see for example: - scipy#19447 - mesonbuild/meson#12306 - https://github.com/conda-forge/scipy-feedstock/blob/1a8ff378bebd3f0b0bc6a2d1662a77d194ac59a1/recipe/bld.bat#L25 - https://github.com/spack/spack/blob/73316c3e286d548b22dc65667810e4631479c3ea/var/spack/repos/builtin/packages/py-scipy/package.py#L235-L238 Compilers that do not support it include at least Flang and AOCC (the AMD Fortran compiler). This should be fixed upstream in Meson by not passing the flag for compilers that don't support it, and then we can revert this change. But for now it's very useful to avoid bothering users of these compilers with having to override that flag manually. This does give the following warning with `gfortran` now, but that can't be helped unfortunately: ``` WARNING: Consider using the built-in option for language standard version instead of using "-std=legacy". ```
tylerjereddy
left a comment
There was a problem hiding this comment.
I verified that the main branch of SciPy fails to build on a DOE supercomputer with AMD clang version 16.0.3 (CLANG: AOCC_4.1.0-Build#270 2023_07_10) because of the Fortran flag removed here.
I checked that a clean build succeeds in the same environment on this feature branch.
I did see quite a few build warnings and testing issues with AOCC (errors like libstdc++.so.6: version GLIBCXX_3.4.30' not found` from testsuite). The latter is usually some environment setup issue.. I rarely use that compiler toolchain. In any case, I at least confirmed an improved situation with changes in this feature branch.
Using PrgEnv-aocc/8.5.0 and
export CXX=clang++
export CC=clang
export FC=flang
The spammed warnings were of this nature:
[1321/1462] Compiling Fortran object scipy/interpolate/libfitpack_lib.a.p/fitpack_fpcurf.f.o
clang-16: warning: argument unused during compilation: '-MD' [-Wunused-command-line-argument]
clang-16: warning: argument unused during compilation: '-MQ scipy/interpolate/libfitpack_lib.a.p/fitpack_fpcurf.f.o' [-Wunused-command-line-argument]
clang-16: warning: argument unused during compilation: '-MF scipy/interpolate/libfitpack_lib.a.p/fitpack_fpcurf.f.o.d' [-Wunused-command-line-argument]
|
CI fail in benchmarks almost certainly not related. |
|
thanks Ralf |
Support in other compilers for this flag is quite patchy, leading to build errors and requiring workarounds in distros - see for example:
Compilers that do not support it include at least Flang and AOCC (the AMD Fortran compiler).
This should be fixed upstream in Meson by not passing the flag for compilers that don't support it, and then we can revert this change. But for now it's very useful to avoid bothering users of these compilers with having to override that flag manually.
This does give the following warning with
gfortrannow, but that can't be helped unfortunately: