Boost Install on Mac OS X using GCC

Hello, I'm trying to install boost on mac using the gcc compiler. I encounter these errors during installation for all libraries: "g++" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" -o "stage/lib/libboost_prg_exec_monitor.dylib" -Wl,-h -Wl,libboost_prg_exec_monitor.dylib -shared -Wl,--start-group "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/execution_monitor.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/debug.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/cpp_main.o" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group ...failed gcc.link.dll stage/lib/libboost_prg_exec_monitor.dylib... gcc.link.dll stage/lib/libboost_unit_test_framework.dylib ld: unknown option: -R collect2: ld returned 1 exit status I have no experience at all using boost in mac, and it is necessary that I use gcc. I am wondering if anyone could point me to a solution regarding this. Thanks, Andrew

I would try the auto installer from boostpro.org. Cheers, Simon From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Andrew Sent: Friday, January 14, 2011 12:20 PM To: boost-users@lists.boost.org Subject: [Boost-users] Boost Install on Mac OS X using GCC Hello, I'm trying to install boost on mac using the gcc compiler. I encounter these errors during installation for all libraries: "g++" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" -o "stage/lib/libboost_prg_exec_monitor.dylib" -Wl,-h -Wl,libboost_prg_exec_monitor.dylib -shared -Wl,--start-group "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/execution_monitor.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/debug.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/cpp_main.o" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group ...failed gcc.link.dll stage/lib/libboost_prg_exec_monitor.dylib... gcc.link.dll stage/lib/libboost_unit_test_framework.dylib ld: unknown option: -R collect2: ld returned 1 exit status I have no experience at all using boost in mac, and it is necessary that I use gcc. I am wondering if anyone could point me to a solution regarding this. Thanks, Andrew

At Fri, 14 Jan 2011 17:19:46 +0000, Andrew wrote:
Hello, I'm trying to install boost on mac using the gcc compiler. I encounter these errors during installation for all libraries:
"g++" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib" -Wl,-R -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" -o "stage/lib/libboost_prg_exec_monitor.dylib" -Wl,-h -Wl,libboost_prg_exec_monitor.dylib -shared -Wl,--start-group "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/execution_monitor.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/debug.o" "/Users/andrew/boost/boost/bin.v2/libs/test/build/gcc-4.2.1/release/threading-multi/cpp_main.o" -Wl,-Bstatic -Wl,-Bdynamic -Wl,--end-group
...failed gcc.link.dll stage/lib/libboost_prg_exec_monitor.dylib... gcc.link.dll stage/lib/libboost_unit_test_framework.dylib ld: unknown option: -R collect2: ld returned 1 exit status
I have no experience at all using boost in mac, and it is necessary that I use gcc. I am wondering if anyone could point me to a solution regarding this.
Try adding toolset=darwin to your bjam command-line. HTH, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

On Fri, 14 Jan 2011 09:19:46 -0800, Andrew
I have no experience at all using boost in mac, and it is necessary that I use gcc. I am wondering if anyone could point me to a solution regarding this.
Thanks, Andrew
Have you looked into MacPorts (macports.org)? Even if you don't want to use the framework, you can take a peek at their config script for boost. Mostafa

On Fri, 14 Jan 2011 09:19:46 -0800, Andrew
wrote: I have no experience at all using boost in mac, and it is necessary that I
use gcc. I am wondering if anyone could point me to a solution regarding this.
Thanks, Andrew
Have you looked into MacPorts (macports.org)? Even if you don't want to use the framework, you can take a peek at their config script for boost.
Mostafa
Thanks for the insight everyone, i was trying to build bjam explicitly using gcc, however everything seems to work fine with darwin, so it seems
On Sat, Jan 15, 2011 at 8:09 AM, Mostafa
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hello, I'm trying to install boost on mac using the gcc compiler. I encounter these errors during installation for all libraries:
I am getting the same errors [2], however, the suggested solution of using the darwin toolset isn't option, because I need to pass the -std=c++0x flag on the command line to bjam for C++0x support. I am trying to build Boost with the latest g++ 4.6.1 on Mac OS X Snow Leopard: ./bootstrap.sh --with-toolset=gcc ./bjam cxxflags=-std=c++0x This was suggest by Vincente on stackoverflow [1]. Does anyone know a workaround for this problem? Matthias [1] http://stackoverflow.com/questions/2887707/how-to-build-boost-with-c0x-suppo... [2] bjam build error snippet: gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/gzip.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/bzip2.o gcc.link.dll stage/lib/libboost_iostreams.dylib ld: unknown option: -R collect2: ld returned 1 exit status "g++" -Wl,-R -Wl,"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib" -Wl,-R -Wl,"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" -o "stage/lib/libboost_iostreams.dylib" -Wl,-h -Wl,libboost_iostreams.dylib -shared -Wl,--start-group "bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/file_descriptor.o" "bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/mapped_file.o" "bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/zlib.o" "bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/gzip.o" "bin.v2/libs/iostreams/build/gcc-4.6.1/release/threading-multi/bzip2.o" -Wl,-Bstatic -Wl,-Bdynamic -lbz2 -lz -Wl,--end-group ...failed gcc.link.dll stage/lib/libboost_iostreams.dylib... gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.6.1/release/threading-multi/../src/tr1/pch.hpp.gch gcc.compile.c++ bin.v2/libs/math/build/gcc-4.6.1/release/threading-multi/assoc_laguerre.o gcc.compile.c++ bin.v2/libs/math/build/gcc-4.6.1/release/threading-multi/assoc_legendre.o

In short, I could resolve the issue as follows: (1) Create a file user-config.jam in the boost root with the following contents: using darwin : std0x : "/opt/local/bin/g++" : <cxxflags>-std=gnu++0x ; (2) Because non-Apple versions of g++ do not support -no-cpp-precomp, we need to remove this option in file tools/build/v2/tools/darwin.jam. In line 485, change flags darwin.compile OPTIONS : -no-cpp-precomp -gdwarf-2 ; to flags darwin.compile OPTIONS : -gdwarf-2 ; (3) Now build Boost with ./bootstrap.sh ./bjam --with-toolset=darwin-std0x Obviously this is not a clean solution, but my Boost Build knowledge is quite limited to come up with the right approach. What would be the right way to do fix this? Matthias
participants (6)
-
Andrew
-
Dave Abrahams
-
Matthias Vallentin
-
Mostafa
-
Simon Mpasi
-
Vladimir Prus