[mpich-discuss] Install errors on MAC OS Sonoma: "error: expected declaration specifiers or ‘...’ before string constant"

Zhou, Hui zhouh at anl.gov
Fri Mar 1 22:37:46 CST 2024


I don't know what is causing the error, but here are a few work arounds:


  1.
You may try configure with --with-device=ch3​. It uses an older device that is in maintenance mode, but likely it will work for you.
  2.  Try install libfabric separately and configure mpich with --with-libfabric=prefix​
  3.
You may try brew install libfabric​ or brew install mpich​.

--
Hui


________________________________
From: Douglas G Dommermuth via discuss <discuss at mpich.org>
Sent: Friday, March 1, 2024 6:09 PM
To: discuss at mpich.org <discuss at mpich.org>
Cc: Douglas G Dommermuth <dgd at mit.edu>
Subject: [mpich-discuss] Install errors on MAC OS Sonoma: "error: expected declaration specifiers or ‘...’ before string constant"

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
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd
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 util/info.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
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 &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ./include/osx/osd.h:182,
                 from ./include/ofi_osd.h:60,
                 from util/info.c:38:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:114:33: error: expected declaration specifiers or ‘...’ before string constant
  114 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.performWhileLocked() for async-safe scoped locking")
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:140:33: error: expected declaration specifiers or ‘...’ before string constant
  140 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.tryPerformWhileLocked() for async-safe scoped locking")
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/os/lock.h:154:33: error: expected declaration specifiers or ‘...’ before string constant
  154 | OS_SWIFT_UNAVAILABLE_FROM_ASYNC("Use OSAllocatedUnfairLock.performWhileLocked() for async-safe scoped locking")
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/osx/osd.h: In function ‘pthread_spin_lock’:
./include/osx/osd.h:194:9: warning: implicit declaration of function ‘os_unfair_lock_lock’ [-Wimplicit-function-declaration]
  194 |         os_unfair_lock_lock(lock);
      |         ^~~~~~~~~~~~~~~~~~~
./include/osx/osd.h: In function ‘pthread_spin_unlock’:
./include/osx/osd.h:200:9: warning: implicit declaration of function ‘os_unfair_lock_unlock’ [-Wimplicit-function-declaration]
  200 |         os_unfair_lock_unlock(lock);
      |         ^~~~~~~~~~~~~~~~~~~~~
./include/osx/osd.h: In function ‘pthread_spin_trylock’:
./include/osx/osd.h:206:16: warning: implicit declaration of function ‘os_unfair_lock_trylock’ [-Wimplicit-function-declaration]
  206 |         return os_unfair_lock_trylock(lock) ? 0 : EBUSY;
      |                ^~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [util/info.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

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.

Thank you, Doug.






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20240302/17f9c73d/attachment.html>


More information about the discuss mailing list