Errors compiling Boost.Log on OS X

Hi all, I'm trying to build the recently-added-to-trunk Boost.Log on OS X and smacking into an error when it includes unsupported.cpp. I've google'd around a bit and seen from the macports guys that Boost.Context doesn't currently build for 32-bit architecture, but I can't even get it to build for just 64-bit. Has anyone had success yet with Boost.Log on OS X, or has some insight into how to get this working before it makes it into 1.54? Building with clang against libc++ / C++11, here is the error: clang-darwin.compile.c++ bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/lockpool.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG -I"." -c -o "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp" RmTemps bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a(clean) rm -f "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a" clang-darwin.archive bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a "ar" rc "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a" "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/lockpool.o" "ranlib" -cs "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a" common.copy stage/lib/libboost_atomic.a cp "bin.v2/libs/atomic/build/clang-darwin-osx/release/link-static/threading-multi/libboost_atomic.a" "stage/lib/libboost_atomic.a" clang-darwin.compile.c++ bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/error_code.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -O3 -finline-functions -Wno-inline -Wall -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/error_code.o" "libs/system/src/error_code.cpp" RmTemps bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a(clean) rm -f "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a" clang-darwin.archive bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a "ar" rc "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a" "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/error_code.o" "ranlib" -cs "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a" common.copy stage/lib/libboost_system.a cp "bin.v2/libs/system/build/clang-darwin-osx/release/link-static/threading-multi/libboost_system.a" "stage/lib/libboost_system.a" clang-darwin.compile.c++ bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/chrono.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -Wextra -Wno-long-long -Wno-variadic-macros -pedantic -O3 -finline-functions -Wno-inline -Wall -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/chrono.o" "libs/chrono/src/chrono.cpp" clang-darwin.compile.c++ bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/thread_clock.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -Wextra -Wno-long-long -Wno-variadic-macros -pedantic -O3 -finline-functions -Wno-inline -Wall -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/thread_clock.o" "libs/chrono/src/thread_clock.cpp" clang-darwin.compile.c++ bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/process_cpu_clocks.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -Wextra -Wno-long-long -Wno-variadic-macros -pedantic -O3 -finline-functions -Wno-inline -Wall -pedantic -DBOOST_ALL_NO_LIB=1 -DBOOST_All_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG -I"." -c -o "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/process_cpu_clocks.o" "libs/chrono/src/process_cpu_clocks.cpp" RmTemps bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a(clean) rm -f "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a" clang-darwin.archive bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a "ar" rc "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a" "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/chrono.o" "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/thread_clock.o" "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/process_cpu_clocks.o" "ranlib" -cs "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a" /usr/bin/ranlib: file: bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a(thread_clock.o) has no symbols ranlib: file: bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a(thread_clock.o) has no symbols common.copy stage/lib/libboost_chrono.a cp "bin.v2/libs/chrono/build/clang-darwin-osx/release/link-static/threading-multi/libboost_chrono.a" "stage/lib/libboost_chrono.a" clang-darwin.compile.c++ bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o "xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c -o "bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o" "libs/context/src/unsupported.cpp" libs/context/src/unsupported.cpp:7:2: error: "platform not supported" #error "platform not supported" ^ 1 error generated. ...failed updating 1 target...

On Fri, Apr 26, 2013 at 10:58 PM, Rich E
I'm trying to build the recently-added-to-trunk Boost.Log on OS X and smacking into an error when it includes unsupported.cpp. I've google'd around a bit and seen from the macports guys that Boost.Context doesn't currently build for 32-bit architecture, but I can't even get it to build for just 64-bit.
I have to disagree with what I think you're saying here. The Boost.Context at the tip of boost trunk (rev 84065) builds fine for me on OS X 10.7.4 in both 32 and 64 bit. I'm using Xcode 4.3.3, gcc 4.2.1, these commands: ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/test ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/example address-model=64 works too. The example programs seem to run correctly.
Has anyone had success yet with Boost.Log on OS X, or has some insight into how to get this working before it makes it into 1.54?
I'm building it now. Will let you know what I find.

On Sun, Apr 28, 2013 at 10:37 AM, Nat Linden
I'm using Xcode 4.3.3, gcc 4.2.1, these commands:
./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/test ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/example
Sorry, I should have been clearer in that I'm using clang with libc++
(current Xcode version, 4.6.2), as this is now standard on OS X and
required by our software framework. I posted the output of my build
failure above, which shows exactly what commands I'm using, but I'll list
my config here as well.
I have the following in my user-config.jam:
using clang : osx
: xcrun clang -stdlib=libc++ -std=c++11
;
To just build context, I do:
./bootstrap.sh --with-libraries=context
./b2 -a toolset=clang-osx link=static threading=multi stage
(added threading=multi to match your commands, I get the same result
without)
and immediately the output is:
lang-darwin.compile.c++
bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o
libs/context/src/unsupported.cpp:7:2: error: "platform not supported"
#error "platform not supported"
^
1 error generated.
"xcrun" "clang" "-stdlib=libc++" "-std=c++11" -x c++ -O3 -O3
-finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I"." -c
-o
"bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o"
"libs/context/src/unsupported.cpp"
...failed clang-darwin.compile.c++
bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o...
...skipped

[Adding [Context] to subject line to catch Oliver's attention]
On Sun, Apr 28, 2013 at 5:18 PM, Rich E
On Sun, Apr 28, 2013 at 10:37 AM, Nat Linden
wrote: I'm using Xcode 4.3.3, gcc 4.2.1, these commands:
./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/test ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/example
Sorry, I should have been clearer in that I'm using clang with libc++ (current Xcode version, 4.6.2), as this is now standard on OS X and required by our software framework.
My situation is the opposite of yours: I can't yet upgrade.
I have the following in my user-config.jam:
using clang : osx : xcrun clang -stdlib=libc++ -std=c++11 ;
To just build context, I do:
./bootstrap.sh --with-libraries=context ./b2 -a toolset=clang-osx link=static threading=multi stage
With Xcode 4.3.3, the above produces warnings but no errors.
lang-darwin.compile.c++ bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o libs/context/src/unsupported.cpp:7:2: error: "platform not supported" #error "platform not supported" ^ 1 error generated.
Unfortunately this source file tells me nothing about the conditions that lead to its being compiled. I see in libs/context/build/Jamfile.v2 the following: alias asm_context_sources : unsupported.cpp ; (the only reference I found to 'unsupported' in boost/context or libs/context). bjam is a black box to me. I must defer to those who do understand it.

Am 29.04.2013 14:50 schrieb "Nat Linden"
[Adding [Context] to subject line to catch Oliver's attention]
On Sun, Apr 28, 2013 at 5:18 PM, Rich E
wrote: On Sun, Apr 28, 2013 at 10:37 AM, Nat Linden
wrote: I'm using Xcode 4.3.3, gcc 4.2.1, these commands:
./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/test ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/example
Sorry, I should have been clearer in that I'm using clang with libc++ (current Xcode version, 4.6.2), as this is now standard on OS X and
required
by our software framework.
My situation is the opposite of yours: I can't yet upgrade.
I have the following in my user-config.jam:
using clang : osx : xcrun clang -stdlib=libc++ -std=c++11 ;
To just build context, I do:
./bootstrap.sh --with-libraries=context ./b2 -a toolset=clang-osx link=static threading=multi stage
With Xcode 4.3.3, the above produces warnings but no errors.
lang-darwin.compile.c++
bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o
libs/context/src/unsupported.cpp:7:2: error: "platform not supported" #error "platform not supported" ^ 1 error generated.
Unfortunately this source file tells me nothing about the conditions that lead to its being compiled. I see in libs/context/build/Jamfile.v2 the following:
alias asm_context_sources : unsupported.cpp ;
(the only reference I found to 'unsupported' in boost/context or libs/context). bjam is a black box to me. I must defer to those who do understand it.
seams that multi-lib should be build - AFAIK boost.build doesn't support it yet.

Thanks for looking into this, much appreciated!
Oliver, would you mind clarifying why 'multi-lib' needs to be built? I
assume you're referring to the threading=multi, and by the way we haven't
been using that when building the other boost binaries for our project.
I think I figured out the problem, Boost.Context seems to require
"address-model=64" to be in the b2 command, regardless of my settings in
user-config.jam. Adding that and everything, including Boost.Log, built
fine.
For the records, this is how I'm building Boost.Log universal binaries for
Max OS X 10.8.3:
// in user-config.jam:
using clang : osx
: xcrun clang -arch i386 -arch x86_64 -stdlib=libc++ -std=c++11
;
./boostrap.sh --with-libraries=log
./b2 -a -d+2 -q toolset=clang-osx link=static address-model=64 stage
cheers,
Rich
On Mon, Apr 29, 2013 at 9:51 AM, Oliver Kowalke
Am 29.04.2013 14:50 schrieb "Nat Linden"
: [Adding [Context] to subject line to catch Oliver's attention]
On Sun, Apr 28, 2013 at 5:18 PM, Rich E
wrote: On Sun, Apr 28, 2013 at 10:37 AM, Nat Linden
wrote:
I'm using Xcode 4.3.3, gcc 4.2.1, these commands:
./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/test ./b2 variant=debug address-model=32 architecture=x86 link=static threading=multi libs/context/example
Sorry, I should have been clearer in that I'm using clang with libc++ (current Xcode version, 4.6.2), as this is now standard on OS X and required by our software framework.
My situation is the opposite of yours: I can't yet upgrade.
I have the following in my user-config.jam:
using clang : osx : xcrun clang -stdlib=libc++ -std=c++11 ;
To just build context, I do:
./bootstrap.sh --with-libraries=context ./b2 -a toolset=clang-osx link=static threading=multi stage
With Xcode 4.3.3, the above produces warnings but no errors.
lang-darwin.compile.c++
bin.v2/libs/context/build/clang-darwin-osx/release/link-static/threading-multi/unsupported.o
libs/context/src/unsupported.cpp:7:2: error: "platform not supported" #error "platform not supported" ^ 1 error generated.
Unfortunately this source file tells me nothing about the conditions that lead to its being compiled. I see in libs/context/build/Jamfile.v2 the following:
alias asm_context_sources : unsupported.cpp ;
(the only reference I found to 'unsupported' in boost/context or libs/context). bjam is a black box to me. I must defer to those who do understand it.
seams that multi-lib should be build - AFAIK boost.build doesn't support it yet.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

2013/4/29 Rich E
Oliver, would you mind clarifying why 'multi-lib' needs to be built? I assume you're referring to the threading=multi, and by the way we haven't been using that when building the other boost binaries for our project
MaxOSX allows to bundle a 32bit and 64bit version of a library into one file whic hcan not be done in one compilation of boost.context (contains assembler)

Okay, but from the build commands I provided above, I am building just this
thing (and successfully using it now), 32+64bit static binaries. Am I doing
it wrong?
On Mon, Apr 29, 2013 at 1:45 PM, Oliver Kowalke
2013/4/29 Rich E
Oliver, would you mind clarifying why 'multi-lib' needs to be built? I assume you're referring to the threading=multi, and by the way we haven't been using that when building the other boost binaries for our project
MaxOSX allows to bundle a 32bit and 64bit version of a library into one file whic hcan not be done in one compilation of boost.context (contains assembler)
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Am 29.04.2013 22:30 schrieb "Rich E"
Okay, but from the build commands I provided above, I am building just
this thing (and successfully using it now), 32+64bit static binaries. Am I doing it wrong? Don't know - I don't own/use MAC - I got the info that the compiler defines a macro for 32bit while you specify 64bit at command prompt - that's because of the universal lib/binary stuff.
participants (3)
-
Nat Linden
-
Oliver Kowalke
-
Rich E