<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hello Ryan et al.,<div><br></div><div>Thank you for your quick reply.</div><div><br></div><div><blockquote type="cite"><div dir="auto">If you want to build anything from source on macOS, use clang unless there is an extremely good reason to use gcc.</div></blockquote><br></div><div>When you say clang, do you recommend using Apple’s clang or clang from MacPorts? 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.</div><div><br></div><div><blockquote type="cite"><div dir="auto">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 <a href="https://trac.macports.org/ticket/69632">https://trac.macports.org/ticket/69632</a></div></blockquote><br></div><div>I set gcc to point to mp-gcc13 with a MacPorts command:</div><div><br></div><div> sudo port select --set gcc mp-gcc13</div><div><br></div><div>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?</div><div><br></div><div><blockquote type="cite"><div dir="auto">In your script the flag -I /opt/local/include/unistring/cdefs.h will not help anything because /opt/local/include/unistring/cdefs.h is not a directory that contains headers.</div></blockquote><br></div><div>This was my futile attempt to ‘include’ the correct ‘cdefs.h’ header file, that was causing problems. Thank you for your help and have a great day ahead!</div><div><br></div><div>—</div><div>Best wishes,</div><div>Maxim</div><div><br id="lineBreakAtBeginningOfMessage"><div>
<meta charset="UTF-8"><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Maxim Abalenkov \\ maxim.abalenkov@gmail.com<br>+44 7 486 486 505 \\ www.maxim.abalenkov.uk</div></div></div>
</div>
<div><br><blockquote type="cite"><div>On 13 May 2024, at 14:51, Ryan Schmidt <ryandesign@macports.org> wrote:</div><br class="Apple-interchange-newline"><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div dir="auto"><div dir="ltr"></div><div dir="ltr">On May 13, 2024, at 05:36, Maxim Abalenkov wrote:</div><div dir="ltr"><blockquote type="cite"><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="content-type" content="text/html; charset=utf-8">Dear all,<div><br></div><div>How are you? I hope all is well with you. I need help please. I’m struggling to compile MPICH v4.2.1 (from source code) with the GNU toolchain v13.2.0 @ macOS Sonoma v14.4.1. Please see my configuration and installation Perl script attached. I also attach a full log of the compilation errors. I recently installed GNU toolchain via MacPorts. When the script proceeds to compilation, it crashes with the following error messages:</div><div><br></div><div><div>Compiling MPICH...</div><div>In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/_types.h:32,</div><div> from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/_types.h:27,</div><div> from /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/pthread.h:55,</div><div> from ../../../modules/yaksa/src/util/yaksu_atomics.c:6:</div><div>/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:30: error: missing ')' after "__has_attribute"</div><div> 554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)</div><div> | ^</div><div>/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/sys/cdefs.h:554:31: error: ':' without preceding '?'</div><div> 554 | #if __has_cpp_attribute(clang::unsafe_buffer_usage)</div></div><div><br></div><div>I suspect that Apple compilers’ header files are picked up erroneously. Is this normal for GNU toolchain to rely on Apple SDK’s header files? I’m new to Apple CPUs. Would you please educate me, what is the suggested way of installing software on Apple M? processors from source? Or should I just save the pain and install my code using Apple’s native toolchain? Thank you for your help and have a productive week ahead!</div></div></blockquote><br><div>If you want to use mpich, the easiest solution is to use MacPorts to install it. </div><div><br></div><div>If you want to build anything from source on macOS, use clang unless there is an extremely good reason to use gcc. </div><div><br></div><div>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 <a href="https://trac.macports.org/ticket/69632">https://trac.macports.org/ticket/69632</a></div><div><br></div><div>In your script the flag -I /opt/local/include/unistring/cdefs.h will not help anything because /opt/local/include/unistring/cdefs.h is not a directory that contains headers. </div></div></div></blockquote></div><br></div></body></html>