From becoggins at hotmail.com Tue Dec 7 02:56:08 2021 From: becoggins at hotmail.com (Brian E. Coggins) Date: Tue Dec 7 02:53:57 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test Message-ID: Hi Boris, I?m trying to set up ODB on a new M1 Mac running Monterey 12.0.1, Xcode 13.1, and Homebrew GCC 11. Build2 built fine, and ODB compiled fine, but the test fails as follows: $ bpkg test odb test odb-2.5.0-b.21/tests/testscript{testscript} odb-2.5.0-b.21/tests/testscript:18:1: error: odb-2.5.0-b.21/odb/odb stderr doesn't match regex info: stderr: odb-2.5.0-b.21/tests/test/plugin/stderr-2 info: stderr regex: odb-2.5.0-b.21/tests/test/plugin/stderr-2.regex clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/usr/local/include' clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1' clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/include' clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include' clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include' clang: error: unknown argument: '-fplugin-arg-odb-svc-path=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)' clang: error: unknown argument: '-fplugin-arg-odb-database=sqlite' clang: error: unknown argument: '-fplugin-arg-odb-trace' clang: error: unknown argument: '-fplugin-arg-odb-svc-file=dummy.hxx' info: test id: plugin info: while testing odb-2.5.0-b.21/dir{tests/} info: while testing dir{odb-2.5.0-b.21/} info: failed to test dir{odb-2.5.0-b.21/} Any ideas? Seeing those clang errors makes me think ODB is trying to invoke g++ (clang) instead of g++-11? Here?s how I set up the build: $ bpkg create -d odb-gcc-11 cc config.cxx=g++-11 config.cc.coptions=-O3 config.bin.rpath=/usr/local/lib config.install.root=/usr/local $ cd odb-gcc-11 $ bpkg build odb@https://pkg.cppget.org/1/beta Thanks, Brian From boris at codesynthesis.com Wed Dec 8 06:31:00 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 8 06:28:37 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test In-Reply-To: References: Message-ID: Brian E. Coggins writes: > I?m trying to set up ODB on a new M1 Mac running Monterey 12.0.1, > Xcode 13.1, and Homebrew GCC 11. Build2 built fine, and ODB compiled > fine, but the test fails as follows: > > [...] > > Any ideas? Seeing those clang errors makes me think ODB is trying > to invoke g++ (clang) instead of g++-11? Yes, it looks like the ODB buildfile thinks for some reason that you are cross-compiling and thus uses just 'g++' for the GCC driver. To shed some light on what's going on here could you perform the following test and send the output of the last two commands: mdkir /tmp/test cd test /tmp/test cat <buildfile using cxx print "'\$cxx.signature'" print "'\$build.host' '\$build.host.cpu' '\$build.host.system'" print "'\$cxx.target' '\$cxx.target.cpu' '\$cxx.target.system'" EOF b config.cxx=g++-11 b config.cxx=clang++ From becoggins at hotmail.com Wed Dec 8 08:18:19 2021 From: becoggins at hotmail.com (Brian E. Coggins) Date: Wed Dec 8 08:16:07 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test In-Reply-To: References: Message-ID: Yes, here we are: $ b config.cxx=g++-11 'gcc version 11.2.0 (Homebrew GCC 11.2.0_3)' 'aarch64-apple-darwin21.1.0' 'aarch64' 'darwin' 'x86_64-apple-darwin21' 'x86_64' 'darwin' : error: unknown target dir{./} in buildfile $ b config.vxx=clang++ 'Apple clang version 13.0.0 (clang-1300.0.29.3)' 'aarch64-apple-darwin21.1.0' 'aarch64' 'darwin' 'aarch64-apple-darwin21.1.0' 'aarch64' 'darwin' : error: unknown target dir{./} in buildfile > On 8 Dec 2021, at 06:31, Boris Kolpackov wrote: > > Brian E. Coggins writes: > >> I?m trying to set up ODB on a new M1 Mac running Monterey 12.0.1, >> Xcode 13.1, and Homebrew GCC 11. Build2 built fine, and ODB compiled >> fine, but the test fails as follows: >> >> [...] >> >> Any ideas? Seeing those clang errors makes me think ODB is trying >> to invoke g++ (clang) instead of g++-11? > > Yes, it looks like the ODB buildfile thinks for some reason that you > are cross-compiling and thus uses just 'g++' for the GCC driver. > > To shed some light on what's going on here could you perform the > following test and send the output of the last two commands: > > mdkir /tmp/test > cd test /tmp/test > > cat <buildfile > using cxx > print "'\$cxx.signature'" > print "'\$build.host' '\$build.host.cpu' '\$build.host.system'" > print "'\$cxx.target' '\$cxx.target.cpu' '\$cxx.target.system'" > EOF > > b config.cxx=g++-11 > b config.cxx=clang++ From boris at codesynthesis.com Wed Dec 8 08:54:41 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Dec 8 08:52:16 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test In-Reply-To: References: Message-ID: Brian E. Coggins writes: > $ b config.cxx=g++-11 > 'gcc version 11.2.0 (Homebrew GCC 11.2.0_3)' > 'aarch64-apple-darwin21.1.0' 'aarch64' 'darwin' > 'x86_64-apple-darwin21' 'x86_64' 'darwin' Thanks! So you are cross-compiling: GCC is targeting x86_64, not aarch64 (aka arm64) that is running host. I wonder if there is a way to get Homebrew GCC that targets aarch64? From becoggins at hotmail.com Thu Dec 9 14:53:44 2021 From: becoggins at hotmail.com (Brian E. Coggins) Date: Fri Dec 10 08:04:04 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test In-Reply-To: References: Message-ID: On 8 Dec 2021, at 08:54, Boris Kolpackov wrote: > > Thanks! So you are cross-compiling: GCC is targeting x86_64, not > aarch64 (aka arm64) that is running host. I wonder if there is a > way to get Homebrew GCC that targets aarch64? As a matter of fact, there is, but I had to start with figuring out why the newly installed GCC 11 was cross-compiling. I set up this new M1 laptop using Apple's migration tool to move things from an older Intel laptop, which worked fantastically on the whole, but I hadn?t thought carefully about what Homebrew would do. It turns out that a Homebrew installation begun on x86_64 and migrated to aarch64 will continue to download x86_64 packages, running them under Rosetta 2. On reflection, that makes sense?it allows one to maintain an x86_64 world within an aarch64 machine?but it wasn?t my initial expectation. To get an aarch64 GCC, one needs to create an independent native Homebrew installation. This is as easy as running the Homebrew installer again from a terminal; when run on aarch64 it ignores any existing x86_64 installation and builds a new aarch64 one. Homebrew is putting all aarch64 installations under /opt/Homebrew and all x86_64 installations under /usr/local/Homebrew, so they can coexist. Unfortunately, Homebrew doesn?t have much documentation on all of that at this point. Once I had the new aarch64 Homebrew, I could install a native GCC 11. With that done, everything builds and works fine. From boris at codesynthesis.com Fri Dec 10 08:13:37 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Dec 10 08:11:10 2021 Subject: [odb-users] ODB 2.5.0-b.21 Failing Test In-Reply-To: References: Message-ID: Brian E. Coggins writes: > Once I had the new aarch64 Homebrew, I could install a native GCC 11. > With that done, everything builds and works fine. Fantastic! And thanks for describing your findings: I've spend some time searching the web trying to understand if Homebrew GCC can target aarch64 but couldn't find anything conclusive.