0

I'm trying to install Boost on my macbook, the problem i'm getting is that there is no clear/outdated way of install boost with GCC instead Clang. I installed GCC-12 using homebrew, and use that for my C++ code projects, and changed the symlink from Clang GCC to Homebrew GCC.

Installing boost with homebrew seemed easy, but there is no way to define which GCC it uses. So the install defaults to Clang, making my GCC project not work with Boost. I also tried compiling it with B2, but the tutorials out there are old and deprecated.

Using brew with the -cc=gcc=12 does not work either and results in error: boost: no bottle available!

I'd love to make this library included standard in GCC so I can use with my makefiles for example too, since -isystem /usr/local/Cellar/boost/1.80.0/include does work.

If anybody knows, thanks!

SHEI LAN
  • 1
  • 1
  • Are you providing `-isystem /usr/local/Cellar/boost/1.80.0/include` to `g++-12`? If you need the lib files (since most of Boost is header-only), did you build them as per https://stackoverflow.com/questions/5346454/building-boost-with-different-gcc-version ? – Eljay Nov 10 '22 at 14:29
  • Tried using that way, but there is no user-config.jam. The Clang built boost can't be used by GCC sadly. Or how do you mean the `-isystem /usr/local/Cellar/boost/1.80.0/include` command – SHEI LAN Nov 10 '22 at 14:42
  • I added the `-isystem /usr/local/Cellar/boost/1.80.0/include` command to `GCC file.cpp` , that way it does compile. But this way does not make it possible to compile it with my makefiles. – SHEI LAN Nov 10 '22 at 15:16
  • have you tried https://stackoverflow.com/questions/41473478/specify-compiler-homebrew-install – Alan Birtles Nov 10 '22 at 15:16
  • [`--cc`](https://docs.brew.sh/Manpage#install-options-formulacask-) still seems to be a current option – Alan Birtles Nov 10 '22 at 15:20
  • using`--cc=gcc-12` results in a `Error: boost: no bottle available!` – SHEI LAN Nov 10 '22 at 15:22
  • try adding `--build-bottle` – Alan Birtles Nov 10 '22 at 20:16
  • Try macports :) – Victor Gubin Nov 11 '22 at 13:54

0 Answers0