Discussion:
Install boost on OS X via homebrew with c++11 and libc++
c***@gmail.com
2012-09-12 11:10:01 UTC
Permalink
I'm trying to install boost on OS X with c++11 and libc++. I'm using
homebrew (boost formular with the --build-from-source argument) and
have tried various options with adding stuff like

* toolset=clang
* cxxflags="-stdlib=libc++ -std=c++11"
* cxxflags="-stdlib=libc++"
* linkflags="-stdlib=libc++ -std=c++11"
* linkflags="-stdlib=libc++"

as arguments to bjam, but it all fails.

Now... The "toolset" part doesn't do anything to make it fail though,
its the cxx- and linkflags part that does.

This is what I get when it fails

clang-darwin.archive
bin.v2/libs/exception/build/clang-darwin-4.2.1/release/link-
static/threading-multi/libboost_exception-mt.a
common.copy /usr/local/Cellar/boost/1.50.0/lib/libboost_exception-mt.a
clang-darwin.compile.c++
bin.v2/libs/wave/build/clang-darwin-4.2.1/release/link-
static/threading-multi/cpplexer/re2clex/cpp_re.o
clang-darwin.archive
bin.v2/libs/wave/build/clang-darwin-4.2.1/release/link-static/threading-multi/libboost_wave-mt.a
common.copy /usr/local/Cellar/boost/1.50.0/lib/libboost_wave-mt.a
...failed updating 2 targets...
...skipped 4 targets...
...updated 10592 targets...
Error: #<BuildError: Failed executing: ./bjam toolset=clang
cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
--prefix=/usr/local/Cellar/boost/1.50.0 --
libdir=/usr/local/Cellar/boost/1.50.0/lib -j2 --layout=tagged
--user-config=user-config.jam threading=multi install>

How do I get boost installed on OS X Mountain Lion with c++11 and
libc++ preferably via homebrew for the ease it adds.


Sincerely,
Christoffer Buchholz
Steven Watanabe
2012-09-13 04:14:03 UTC
Permalink
AMDG
Post by c***@gmail.com
I'm trying to install boost on OS X with c++11 and libc++. I'm using
homebrew (boost formular with the --build-from-source argument) and
have tried various options with adding stuff like
<snip>
This is what I get when it fails
<snip>
...failed updating 2 targets...
...skipped 4 targets...
...updated 10592 targets...
How do I get boost installed on OS X Mountain Lion with c++11 and
libc++ preferably via homebrew for the ease it adds.
Almost everything built correctly as you
can see from the summary. Some library probably
doesn't compile with this compiler/standard library
combination. However, I can't tell which one,
since you snipped the actual error message and
only showed the end of the build log.

In Christ,
Steven Watanabe
c***@gmail.com
2012-09-13 06:06:46 UTC
Permalink
I opted for trying to compile it without homebrew to see if that
worked, and it worked better; now I also got up to the latest version
of boost, not 1.50 which homebrew used.

I call b2 with these arguments:

./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++"
linkflags="-std=c++11 -stdlib=libc++" link=static

and it compiles all file. Then I have this[1] piece of code which I
try to compile with:

clang++ -std=c++11 -stdlib=libc++ -g -Wall -v
-I/Users/cb/Downloads/boost_1_51_0 tests/arithmetic.cpp -o
tests/arithmetic
/Users/cb/Downloads/boost_1_51_0/stage/lib/libboost_unit_test_framework.a

And it fails miserably, giving me this[2] error.

Any ideas?

[1]: https://gist.github.com/3710079
[2]: https://gist.github.com/3712206
Post by Steven Watanabe
AMDG
Post by c***@gmail.com
I'm trying to install boost on OS X with c++11 and libc++. I'm using
homebrew (boost formular with the --build-from-source argument) and
have tried various options with adding stuff like
<snip>
This is what I get when it fails
<snip>
...failed updating 2 targets...
...skipped 4 targets...
...updated 10592 targets...
How do I get boost installed on OS X Mountain Lion with c++11 and
libc++ preferably via homebrew for the ease it adds.
Almost everything built correctly as you
can see from the summary. Some library probably
doesn't compile with this compiler/standard library
combination. However, I can't tell which one,
since you snipped the actual error message and
only showed the end of the build log.
In Christ,
Steven Watanabe
_______________________________________________
Boost-users mailing list
http://lists.boost.org/mailman/listinfo.cgi/boost-users
c***@gmail.com
2012-09-13 08:23:17 UTC
Permalink
This guy figure the fault: http://stackoverflow.com/a/12402121/499997

To summarize, it set a define for using the dynamic library, but I
compiled and linked it statically.
Post by c***@gmail.com
I opted for trying to compile it without homebrew to see if that
worked, and it worked better; now I also got up to the latest version
of boost, not 1.50 which homebrew used.
./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++"
linkflags="-std=c++11 -stdlib=libc++" link=static
and it compiles all file. Then I have this[1] piece of code which I
clang++ -std=c++11 -stdlib=libc++ -g -Wall -v
-I/Users/cb/Downloads/boost_1_51_0 tests/arithmetic.cpp -o
tests/arithmetic
/Users/cb/Downloads/boost_1_51_0/stage/lib/libboost_unit_test_framework.a
And it fails miserably, giving me this[2] error.
Any ideas?
[1]: https://gist.github.com/3710079
[2]: https://gist.github.com/3712206
Post by Steven Watanabe
AMDG
Post by c***@gmail.com
I'm trying to install boost on OS X with c++11 and libc++. I'm using
homebrew (boost formular with the --build-from-source argument) and
have tried various options with adding stuff like
<snip>
This is what I get when it fails
<snip>
...failed updating 2 targets...
...skipped 4 targets...
...updated 10592 targets...
How do I get boost installed on OS X Mountain Lion with c++11 and
libc++ preferably via homebrew for the ease it adds.
Almost everything built correctly as you
can see from the summary. Some library probably
doesn't compile with this compiler/standard library
combination. However, I can't tell which one,
since you snipped the actual error message and
only showed the end of the build log.
In Christ,
Steven Watanabe
_______________________________________________
Boost-users mailing list
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Loading...