Opened 13 years ago

Last modified 13 years ago

#3683 new Bugs

Build fails on MacOS

Reported by: Dave Abrahams Owned by: Vladimir Prus
Milestone: Boost 1.42.0 Component: build
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

It looks like BB is using some option (-R) that's unknown to the default Mac toolset

$ bjam gcc --build-dir=/tmp/build --debug-configuration
notice: found boost-build.jam at /Users/dave/src/boost/boost-build.jam
notice: loading Boost.Build from /Users/dave/src/boost/tools/build/v2
notice: Searching /etc /Users/dave /Users/dave/src/boost/tools/build/v2 /usr/share/boost-build /Users/dave/src/boost/tools/build/v2/kernel /Users/dave/src/boost/tools/build/v2/util /Users/dave/src/boost/tools/build/v2/build /Users/dave/src/boost/tools/build/v2/tools /Users/dave/src/boost/tools/build/v2/contrib /Users/dave/src/boost/tools/build/v2/. for site-config configuration file site-config.jam .
notice: Loading site-config configuration file site-config.jam from /Users/dave/src/boost/tools/build/v2/site-config.jam .
notice: Searching /Users/dave /Users/dave/src/boost/tools/build/v2 /usr/share/boost-build /Users/dave/src/boost/tools/build/v2/kernel /Users/dave/src/boost/tools/build/v2/util /Users/dave/src/boost/tools/build/v2/build /Users/dave/src/boost/tools/build/v2/tools /Users/dave/src/boost/tools/build/v2/contrib /Users/dave/src/boost/tools/build/v2/. for user-config configuration file user-config.jam .
notice: Loading user-config configuration file user-config.jam from /Users/dave/user-config.jam .
docutils-dir=
tools-dir= /opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin
notice: will use 'g++' for gcc, condition <toolset>gcc-4.2
notice: using gcc libraries :: <toolset>gcc-4.2 :: /opt/local/bin /opt/local/lib /opt/local/lib32 /opt/local/lib64
notice: using gcc archiver :: <toolset>gcc-4.2 :: ar
warning: toolset gcc initialization: can not find tool windres
warning: initialized from /Users/dave/src/boost/tools/build/v2/build/project.jam:884
notice: using rc compiler :: <toolset>gcc-4.2 :: as
notice: will use 'g++' for gcc, condition <toolset>gcc-4.4
notice: using gcc libraries :: <toolset>gcc-4.4 :: /opt/local/bin /opt/local/lib /opt/local/lib32 /opt/local/lib64
notice: using gcc archiver :: <toolset>gcc-4.4 :: ar
warning: toolset gcc initialization: can not find tool windres
warning: initialized from /Users/dave/src/boost/tools/build/v2/build/project.jam:884
notice: using rc compiler :: <toolset>gcc-4.4 :: as
notice: iostreams: using prebuilt zlib
notice: iostreams: using prebuilt bzip2
notice: [python-cfg] Configuring python...
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command '"python" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg]   interpreter command: "python"
notice: [python-cfg]   include path: "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6"
notice: [python-cfg]   library path: "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib"
notice: [python-cfg] framework directory is "/opt/local/Library/Frameworks/Python.framework"
...patience...
...patience...
...found 2711 targets...
...updating 434 targets...
gcc.link /tmp/build/boost/bin.v2/libs/python/test/exec.test/gcc-4.2/debug/exec
ld: unknown option: -R
collect2: ld returned 1 exit status

    "g++" -L"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib" -L"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config" -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 "/tmp/build/boost/bin.v2/libs/python/test/exec.test/gcc-4.2/debug/exec" -Wl,--start-group "/tmp/build/boost/bin.v2/libs/python/test/exec.test/gcc-4.2/debug/exec.o" "/tmp/build/boost/bin.v2/libs/python/build/gcc-4.2/debug/link-static/libboost_python.a"  -Wl,-Bstatic -lpython2.6 -Wl,-Bdynamic -lpython2.6 -Wl,--end-group -g 


...failed gcc.link /tmp/build/boost/bin.v2/libs/python/test/exec.test/gcc-4.2/debug/exec...

Change History (4)

comment:1 by Vladimir Prus, 13 years ago

You should be using toolset=darwin -- unless you gcc is actually FSF gcc. Of course, it might be good if same 'gcc' toolset magically handle both FSF and Apple gcc, but it's a separate matter.

Does this help?

comment:2 by Vladimir Prus, 13 years ago

Ping? Should this issue be marked as resolved?

in reply to:  2 comment:3 by Dave Abrahams, 13 years ago

I can't even compile a single Boost.Python file with FSF emacs on MacOS X, but that's apparently a different problem, so you can close this one.

However, I saw this same problem come up on the mailing list last week, so maybe this ticket should be treated as a request for more clarity on MacOS. For example, the default toolset could be darwin, and if gcc is specified we could check that the actual tool in use isn't a darwin compiler.

comment:4 by Vladimir Prus, 13 years ago

I've implementing making darwing the default Boost.Build toolset on OSX. I still need to make similar change to bootstrap.sh (it overrides Boost.Build default) and make gcc.jam warn if used against Apple gcc.

For reference, Apple gcc identifies itself as follows:

bash-3.2$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)
Note: See TracTickets for help on using tickets.