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

Douglas G Dommermuth dgd at mit.edu
Fri Mar 1 18:09:07 CST 2024


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/cbdbe947/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpich2.tar.gz
Type: application/x-gzip
Size: 116882 bytes
Desc: mpich2.tar.gz
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20240302/cbdbe947/attachment-0001.gz>


More information about the discuss mailing list