[odb-users] Re: macOS Sonoma Include (and Lib?) Issues

Boris Kolpackov boris at codesynthesis.com
Wed Dec 6 06:55:36 EST 2023


Brian E. Coggins <becoggins at hotmail.com> writes:

> error: process g++-13 exited with code 1
>   info: command line: g++-13 -I/Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/pregenerated -I/Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25 -I/Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25 -I/usr/local/Cellar/gcc/13.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/13/plugin/include -DODB_GXX_NAME="g++-13" -DODB_BUILD2 -I/Users/brian/Software/odb-build/odb-gcc-13/libcutl-1.11.0-b.9+1 -I/Users/brian/Software/odb-build/odb-gcc-13/libcutl-1.11.0-b.9+1 -DLIBCUTL_SHARED -I/Users/brian/Software/odb-build/odb-gcc-13/libstudxml-1.1.0-b.10+2 -I/Users/brian/Software/odb-build/odb-gcc-13/libstudxml-1.1.0-b.10+2 -DLIBSTUDXML_SHARED -O3 -std=c++23 -fdiagnostics-color -finput-charset=UTF-8 -o odb-2.5.0-b.25/odb/source.dylib.o -c -x c++ /Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/source.cxx
>   info: while updating odb-2.5.0-b.25/odb/objs{source}
>   info: while updating odb-2.5.0-b.25/odb/libus{odb}
>   info: while updating odb-2.5.0-b.25/odb/plugin{odb}
>   info: while updating odb-2.5.0-b.25/dir{odb/}
>   info: while updating dir{odb-2.5.0-b.25/}
> c++ odb-2.5.0-b.25/odb/cxx{common} -> odb-2.5.0-b.25/odb/objs{common}
> In file included from /Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/gcc-fwd.hxx:24,
>                  from /Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/context.hxx:7,
>                  from /Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/common.hxx:12,
>                  from /Users/brian/Software/odb-build/odb-gcc-13/odb-2.5.0-b.25/odb/common.cxx:4:
> /usr/local/Cellar/gcc/13.2.0/lib/gcc/current/gcc/x86_64-apple-darwin23/13/plugin/include/system.h:703:10: fatal error: gmp.h: No such file or directory
>   703 | #include <gmp.h>
>       |          ^~~~~~~

gmp is a dependency of GCC in Homebrew so you should have gotten this
header installed (somewhere under /usr/local/) and it normally gets
found automatically. At least that worked out of the box up to an
including GCC 13.1.0 on Mac OS Ventura 13.4:

https://cppget.org/?builds=odb&pv=2.5.0-b.25&tc=macos_*-gcc_13*

If you do find gmp.h there, you can try adding a manual -I to its
location.


> (I also realize I may not have been completely clear in my original
>  message. The problem wasn't that gcc couldn't find headers like iostream
>  and needed a -I flag; homebrew g++-13 can find those out of the box.
>  Rather, the problem is that those headers are stubs that invoke system
>  headers in the Apple SDK, and homebrew gcc didn’t seem to know how to find
>  that Apple SDK. I think the export SYSROOT trick may have solved that for
>  most of the headers. Except, evidently, this gmp.h, whatever that is.)

This looks like it's either Homebrew GCC that is broken on Sonoma or your
setup is broken (maybe makes sense to do a clean re-install of Homebrew?)
If it is the former, then it makes sense to report this to Homebrew (unless
it is already reported). If you do file or find an issue for this, please
share the link so that we can track it.



More information about the odb-users mailing list