Boost logo

Boost Users :

Subject: [Boost-users] Build boost on OSX 10.9 with GCC 4.8
From: Jürgen Simon (simon_at_[hidden])
Date: 2014-04-15 16:10:16


I have a somewhat specific problem. I need to build Boost 1.55 with the GCC 4.8 compiler on the mac. I have installed gcc-4.8 using homebrew. Using the GCC compiler instead of clang is non-negotiable in my case, because I require OpenMP which is not implemented in clang yet. Given that, I tried to build boost this way:

export CC=/usr/local/Cellar/gcc48/4.8.2/bin/gcc-4.8
export CXX=/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8
export LD=/usr/local/Cellar/gcc48/4.8.2/bin/g++-4.8

./ —with-toolset=gcc-4.8

gives an error:

Building Boost.Build engine with toolset gcc-4.8...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

apparently it does not recognize the gcc-4.8 toolkit. Using gcc instead does create the b2 script, but running the script as is also created trouble:

./ —with-toolset=gcc

common.mkdir bin.v2/libs/atomic/build/gcc-4.2.1
common.mkdir bin.v2/libs/atomic/build/gcc-4.2.1/release
common.mkdir bin.v2/libs/atomic/build/gcc-4.2.1/release/threading-multi
gcc.compile.c++ bin.v2/libs/atomic/build/gcc-4.2.1/release/threading-multi/lockpool.o
In file included from libs/atomic/src/lockpool.cpp:3:
In file included from ./boost/atomic.hpp:12:
In file included from ./boost/atomic/atomic.hpp:17:
In file included from ./boost/atomic/detail/platform.hpp:22:
./boost/atomic/detail/gcc-atomic.hpp:961:64: error: no matching constructor for initialization of 'storage_type' (aka 'boost::atomics::detail::storage128_type')
    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)

specifying the toolkit gcc-4.8 here does actually do something:

./ —with-toolset=gcc
./b2 -d 2 toolset=gcc-4.8

but it results in linker errors, like the following two examples:

"g++-4.8" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config" -o "stage/lib/libboost_iostreams.dylib" -Wl,-h -Wl,libboost_iostreams.dylib -shared -Wl,--start-group "bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/file_descriptor.o" "bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/mapped_file.o" "bin.v2/libs/iostreams/build/gcc-4.8/release/threading-multi/bzip2.o" -Wl,-Bstatic -Wl,-Bdynamic -lbz2 -Wl,--end-group

ld: unknown option: -R

"g++-4.8" -o "bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/libboost_atomic.dylib" -Wl,-h -Wl,libboost_atomic.dylib -shared -Wl,--start-group "bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group

ld: unknown option: -h

I tried for two days without success to get GCC-4.8 and Boost to play ball together on the Mac. What am I missing?

Kind Regards,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at