iains / gcc-11-branch

GCC 11 for Darwin with experimental Arm64 support. Current release 11.5-darwin-r0 [July 2024]
GNU General Public License v2.0
2 stars 2 forks source link

ieee_arithmetic missing from gfortran? #2

Closed mathomp4 closed 2 years ago

mathomp4 commented 2 years ago

This possibly might be a "I built things wrong" but I thought I'd report. Namely, I wanted to build GCC 11.3 on my M1 MacBook. So I downloaded the tarball at:

https://github.com/iains/gcc-11-branch/releases/tag/gcc-11.3-darwin-r0

and built using:

cd gcc-11-branch-gcc-11.3-darwin-r0/
contrib/download_prerequisites
cd ..
mkdir build-gcc-11.3 && cd build-gcc-11.3
../gcc-11-branch-gcc-11.3-darwin-r0/configure --prefix=$HOME/installed/Core/gcc-gfortran/11.3.0 \
  --enable-languages=c,c++,fortran \
  --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk |& tee configure.log
make -j4 |& tee make.log
make install |& tee makeinstall.log

However, in trying to build pFUnit, I discovered that I seemed to not have built support for ieee_arithmetic:

❯ cat test.F90
program test
   use,intrinsic :: ieee_arithmetic
end program test
❯ gfortran test.F90
test.F90:2:20:

    2 |    use,intrinsic :: ieee_arithmetic
      |                    1
Fatal Error: Cannot find an intrinsic module named ‘ieee_arithmetic’ at (1)
compilation terminated.

Is there an option I should pass to the build to get this support?

mathomp4 commented 2 years ago

Note: My unsuccessful attempt to use the Homebrew-GCC-for-M1 version was able to use ieee_arithmetic so it's not like the M1 GCC can't...just my build here wasn't happy.

iains commented 2 years ago

I can repeat this on a cross-compiler from x86_64 (I don't actually have access to an m1 box right now). However all works as expected with the gcc-12.1 release, so it looks like I've missed or fluffed a back-port of something needed - I'll try to take a look over the weekend (unless @fxcoudert can point to what's missing immediately).

I have no problem with updating the 11.3 release branch with a critical fix (especially before it's released into the wild).

iains commented 2 years ago

mea culpa, I missed a back port.

https://github.com/iains/gcc-11-branch has the patch, if you would like to try it.

I have not bumped the release at this stage, since I cannot test this natively.

mathomp4 commented 2 years ago

mea culpa, I missed a back port.

https://github.com/iains/gcc-11-branch has the patch, if you would like to try it.

I have not bumped the release at this stage, since I cannot test this natively.

@iains Okay. I'll give it a try. Back in a bit as my wee macbook compiles!

mathomp4 commented 2 years ago

@iains I think you got it. a git clone of the repo seems happy. I'll keep going with my compiling of libraries...