[unable to compile MPICH v4.2.1 with GNU toolchain v13.2.0 @ macOS Sonoma v14.4.1]

Ryan Schmidt ryandesign at macports.org
Tue May 14 02:35:46 UTC 2024


On May 13, 2024, at 10:07, Maxim Abalenkov wrote:
> 
>> If you want to build anything from source on macOS, use clang unless there is an extremely good reason to use gcc.
> 
> When you say clang, do you recommend using Apple’s clang or clang from MacPorts?

Whichever you like. Whichever works for you. Apple's clang is convenient because it is already installed. If it does not work for you, you can try a MacPorts clang. Take care to understand that the MacPorts clang ports are versions of llvm.org clang which is different from Apple clang. They have different version numbering schemes and sometimes different capabilities. 

> One extremely good reason to use gcc is the ability to have a Fortran compiler. I need an MPICH distribution with Fortran compiler wrappers and Fortran modules.

The MacPorts mpich port offers this via its several sub ports, for example the mpich-gcc13 sub port. Yes, this uses gcc13, but in this case it has hopefully already been tested and verified to be working by a MacPorts contributor. 


>> You said in the subject line that you're using gcc 13.2.0 but that's not confirmed by the log. When I researched this error recently, I found that this bug was fixed in gcc 11.1 which makes me think you are actually trying to use a gcc version older than that. See https://trac.macports.org/ticket/69632
> 
> I set gcc to point to mp-gcc13 with a MacPorts command:
> 
>     sudo port select --set gcc mp-gcc13

That should work. 

> In my Perl script I ensure FC, CC and CXX environment variables point to compilers in /opt/local/bin/{gcc,g++,gfortran}. Is there any other way to verify that I’m using the right version of GNU compilers?

You can run "gcc --version" to verify. If it says you are indeed running gcc 13 then I cannot explain the error. What I found before said that the problem had been fixed in gcc 11.1. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20240513/18bc8fb3/attachment.htm>


More information about the macports-users mailing list