<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I don't know what is causing the error, but here are a few work arounds:</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<ol start="1" style="margin-top: 0px; margin-bottom: 0px; list-style-type: decimal;" data-editing-info="{"orderedStyleType":1,"unorderedStyleType":1}" data-listchain="__List_Chain_93">
<li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">You may try configure with
<code>--with-device=ch3</code>​. It uses an older device that is in maintenance mode, but likely it will work for you.</span></div>
</li><li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Try install libfabric separately and configure mpich with
<code>--with-libfabric=prefix</code>​</span></li><li style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">You may try
<code>brew install libfabric</code>​ or <code>brew install mpich</code>​.</span></div>
</li></ol>
<div><br>
</div>
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">--
<br>
</span></div>
<div><span style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Hui<br>
</span></div>
<div><br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Douglas G Dommermuth via discuss <discuss@mpich.org><br>
<b>Sent:</b> Friday, March 1, 2024 6:09 PM<br>
<b>To:</b> discuss@mpich.org <discuss@mpich.org><br>
<b>Cc:</b> Douglas G Dommermuth <dgd@mit.edu><br>
<b>Subject:</b> [mpich-discuss] Install errors on MAC OS Sonoma: "error: expected declaration specifiers or ‘...’ before string constant"</font>
<div> </div>
</div>
<div>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
I am compiling mpich 4. 2. 0 on a MacBook Air Apple M1 running macOS Sonoma 14. 3. 1. I am using gcc and gfortran versions 13. 2. 0. I get the following errors when I build MPICH: /Applications/Xcode. app/Contents/Developer/usr/bin/make all-am depbase=`echo
</div>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerStart</div>
<div dir="ltr" id="x_pfptBannerf85tzev" style="display:block!important; text-align:left!important; margin:16px 0px 16px 0px!important; padding:8px 16px 8px 16px!important; border-radius:4px!important; min-width:200px!important; background-color:#D0D8DC!important; background-color:#D0D8DC; border-top:4px solid #90a4ae!important; border-top:4px solid #90a4ae">
<div id="x_pfptBannerf85tzev" style="float:left!important; display:block!important; margin:0px 0px 1px 0px!important; max-width:600px!important">
<div id="x_pfptBannerf85tzev" style="display:block!important; visibility:visible!important; background-color:#D0D8DC!important; color:#000000!important; color:#000000; font-family:'Arial',sans-serif!important; font-family:'Arial',sans-serif; font-weight:bold!important; font-weight:bold; font-size:14px!important; line-height:18px!important; line-height:18px">
This Message Is From an External Sender </div>
<div id="x_pfptBannerf85tzev" style="display:block!important; visibility:visible!important; background-color:#D0D8DC!important; color:#000000!important; color:#000000; font-weight:normal; font-family:'Arial',sans-serif!important; font-family:'Arial',sans-serif; font-size:12px!important; line-height:18px!important; line-height:18px; margin-top:2px!important">
This message came from outside your organization. </div>
</div>
<div style="clear:both!important; display:block!important; visibility:hidden!important; line-height:0!important; font-size:0.01px!important; height:0px">
 </div>
</div>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<style>
<!--
#x_pfptBannerf85tzev
        {display:block!important;
        visibility:visible!important;
        opacity:1!important;
        background-color:#D0D8DC!important;
        max-width:none!important;
        max-height:none!important}
-->
</style>
<div style="line-break:after-white-space">
<div><span style="font-size:12px">I am compiling mpich 4.2.0 on a MacBook Air Apple M1 running macOS Sonoma 14.3.1.   I am using gcc and gfortran versions 13.2.0.   I get the following errors when I build MPICH:</span><br>
<font color="#5856d6"><span style="font-size:12px"><br>
</span></font></div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div><span style="font-family:Monaco; font-size:x-small">/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am</span></div>
<div><span style="font-family:Monaco; font-size:x-small">depbase=`echo util/info.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\</span></div>
<div><span class="x_x_Apple-tab-span" style="font-family:Monaco; white-space:pre"></span><span style="font-size:x-small; font-family:Monaco">gcc -DHAVE_CONFIG_H -I.  -I./include -D_GNU_SOURCE -D__USE_XOPEN2K8 -DSYSCONFDIR=\"/Users/douglasdommermuth/mpich2/mpich2-install/etc\"
 -DRDMADIR=\"@rdmadir@\" -DPROVDLDIR=\"/Users/douglasdommermuth/mpich2/mpich2-install/lib/libfabric\" -I./prov/sockets/include -I./prov/sockets   -Wall -O2 -DNDEBUG    -MT util/info.o -MD -MP -MF $depbase.Tpo -c -o util/info.o util/info.c &&\</span></div>
<div><span class="x_x_Apple-tab-span" style="font-family:Monaco; white-space:pre"></span><span style="font-size:x-small; font-family:Monaco">mv -f $depbase.Tpo $depbase.Po</span></div>
<div><span style="font-family:Monaco; font-size:x-small">In file included from ./include/osx/osd.h:182,</span></div>
<div><span style="font-family:Monaco; font-size:x-small">                 from ./include/ofi_osd.h:60,</span></div>
<div><span style="font-family:Monaco; font-size:x-small">                 from util/info.c:38:</span></div>
<div><span style="font-family:Monaco; font-size:x-small">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:114:33: error: expected declaration specifiers or ‘...’ before string constant</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  114 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.performWhileLocked() for async-safe scoped locking")</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:140:33: error: expected declaration specifiers or ‘...’ before string constant</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  140 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.tryPerformWhileLocked() for async-safe scoped locking")</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:154:33: error: expected declaration specifiers or ‘...’ before string constant</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  154 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.performWhileLocked() for async-safe scoped locking")</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h: In function ‘pthread_spin_lock’:</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h:194:9: warning: implicit declaration of function ‘os_unfair_lock_lock’ [-Wimplicit-function-declaration]</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  194 |         os_unfair_lock_lock(lock);</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |         ^~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h: In function ‘pthread_spin_unlock’:</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h:200:9: warning: implicit declaration of function ‘os_unfair_lock_unlock’ [-Wimplicit-function-declaration]</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  200 |         os_unfair_lock_unlock(lock);</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |         ^~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h: In function ‘pthread_spin_trylock’:</span></div>
<div><span style="font-family:Monaco; font-size:x-small">./include/osx/osd.h:206:16: warning: implicit declaration of function ‘os_unfair_lock_trylock’ [-Wimplicit-function-declaration]</span></div>
<div><span style="font-family:Monaco; font-size:x-small">  206 |         return os_unfair_lock_trylock(lock) ? 0 : EBUSY;</span></div>
<div><span style="font-family:Monaco; font-size:x-small">      |                ^~~~~~~~~~~~~~~~~~~~~~</span></div>
<div><span style="font-family:Monaco; font-size:x-small">make[3]: *** [util/info.o] Error 1</span></div>
<div><span style="font-family:Monaco; font-size:x-small">make[2]: *** [all] Error 2</span></div>
<div><span style="font-family:Monaco; font-size:x-small">make[1]: *** [all-recursive] Error 1</span></div>
<div><span style="font-family:Monaco; font-size:x-small">make: *** [all] Error 2</span></div>
</blockquote>
<div>
<div style="line-break:after-white-space">
<div style="margin:0px; font-style:normal; font-variant-caps:normal; font-stretch:normal; line-height:normal; font-size-adjust:none; font-kerning:auto; font-variant-alternates:normal; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-east-asian:normal; font-feature-settings:normal">
<span style="font-variant-ligatures:no-common-ligatures; font-size:12px"><br>
</span></div>
</div>
<span style="font-size:12px">It looks like errors in macOS’s command line tools.    I don’t know how to circumvent the problem.  Various text and  log files are attached in mpich2.tar.gz.   A copy of the lock.h code is also included in the zip file.</span><br>
<font color="#5856d6"><span style="font-size:12px"><br>
</span></font><span style="font-size:12px">Thank you, Doug.</span><br>
<font color="#5856d6"><span style="font-size:12px"><br>
</span></font>
<blockquote type="cite">
<div style="line-break:after-white-space">
<div></div>
</div>
</blockquote>
</div>
</div>
<div style="line-break:after-white-space">
<div><br>
<font color="#5856d6"><br>
<span style="font-size:12px"><br>
</span></font>
<div style="line-break:after-white-space">
<div></div>
<div>
<div><br>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</body>
</html>