Building Boost on OSX

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Building Boost on OSX

Bioxydyn Dev

Hi,

I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on OSX and also at building custom boost binaries.

I followed the instructions at http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html up to and including section 4. I then installed boost build as described in section 5.2.1.

To keep things simple I thought I'd just build the thread library for now as follows:

/usr/local/bin/boost-build/bin/b2 install --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage --with-thread toolset=gcc-4.5 variant=debug --layout=versioned --build-type=complete -q

and I get the output shown below. If I omit the q option to allow the build to proceed it builds a number of .a files. 

I have installed gcc-4.5 on my Mac. 

What is causing the error  'ld: unknown option: -h' and do I need to worry about the dylib files that the build is trying to create. A google search indicates that these are Xcode dynamic library files. I'm not sure if I need these or not as I'm confused about why .so files weren't created. 

Can anyone please help?

Regards

Joe  


Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : building
    - timer                    : not building
    - wave                     : not building

...patience...
...patience...
...found 21638 targets...
...updating 10650 targets...
common.mkdir ~
common.mkdir ~/development
common.mkdir ~/development/cots
common.mkdir ~/development/cots/boost
common.mkdir ~/development/cots/boost/lib
common.mkdir /tmp/build-boost
common.mkdir /tmp/build-boost/boost
common.mkdir /tmp/build-boost/boost/bin.v2
common.mkdir /tmp/build-boost/boost/bin.v2/libs
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi
gcc.compile.c++ /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/error_code.o
gcc.link.dll /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib
ld: unknown option: -h
collect2: ld returned 1 exit status

    "g++-4.5"    -o "/tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib" -Wl,-h -Wl,libboost_system-gcc45-mt-d-1_54.dylib -shared -Wl,--start-group "/tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/error_code.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g 

...failed gcc.link.dll /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib...
...failed updating 1 target...
...updated 15 targets...




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Steven Watanabe-4
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:

> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev



On Mon, Aug 19, 2013 at 4:57 PM, Steven Watanabe <[hidden email]> wrote:
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:
> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

Please explain. Why would I do that when I've installed gcc separately and not using what came installed on the machine?

regards

Joe.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev



On Tue, Aug 20, 2013 at 7:34 AM, Bioxydyn Dev <[hidden email]> wrote:



On Mon, Aug 19, 2013 at 4:57 PM, Steven Watanabe <[hidden email]> wrote:
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:
> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

Please explain. Why would I do that when I've installed gcc separately and not using what came installed on the machine?

From the boost build documentation:

Apple Darwin gcc
The darwin module supports the version of gcc that is modified and provided by Apple. The configuration is essentially identical to that of the gcc module.
The darwin toolset can generate so called "fat" binaries—binaries that can run support more than one architecture, or address mode. To build a binary that can run both on Intel and PowerPC processors, specify architecture=combined. To build a binary that can run both in 32-bit and 64-bit modes, specify address-model=32_64. If you specify both of those properties, a "4-way" fat binary will be generated.

 
I've installed gcc separately. I'm not using Apple's modified version.
 
regards

Joe.



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev
In reply to this post by Bioxydyn Dev
On Mon, Aug 19, 2013 at 4:19 PM, Bioxydyn Dev <[hidden email]> wrote:

Hi,

I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on OSX and also at building custom boost binaries.

I followed the instructions at http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html up to and including section 4. I then installed boost build as described in section 5.2.1.

To keep things simple I thought I'd just build the thread library for now as follows:

/usr/local/bin/boost-build/bin/b2 install --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage --with-thread toolset=gcc-4.5 variant=debug --layout=versioned --build-type=complete -q

and I get the output shown below. If I omit the q option to allow the build to proceed it builds a number of .a files. 

I have installed gcc-4.5 on my Mac. 

What is causing the error  'ld: unknown option: -h' and do I need to worry about the dylib files that the build is trying to create. A google search indicates that these are Xcode dynamic library files. I'm not sure if I need these or not as I'm confused about why .so files weren't created. 

Can anyone please help?

Regards

Joe  


Component configuration:

    - atomic                   : not building
    - chrono                   : not building
    - context                  : not building
    - coroutine                : not building
    - date_time                : not building
    - exception                : not building
    - filesystem               : not building
    - graph                    : not building
    - graph_parallel           : not building
    - iostreams                : not building
    - locale                   : not building
    - log                      : not building
    - math                     : not building
    - mpi                      : not building
    - program_options          : not building
    - python                   : not building
    - random                   : not building
    - regex                    : not building
    - serialization            : not building
    - signals                  : not building
    - system                   : not building
    - test                     : not building
    - thread                   : building
    - timer                    : not building
    - wave                     : not building

...patience...
...patience...
...found 21638 targets...
...updating 10650 targets...
common.mkdir ~
common.mkdir ~/development
common.mkdir ~/development/cots
common.mkdir ~/development/cots/boost
common.mkdir ~/development/cots/boost/lib
common.mkdir /tmp/build-boost
common.mkdir /tmp/build-boost/boost
common.mkdir /tmp/build-boost/boost/bin.v2
common.mkdir /tmp/build-boost/boost/bin.v2/libs
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug
common.mkdir /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi
gcc.compile.c++ /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/error_code.o
gcc.link.dll /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib
ld: unknown option: -h
collect2: ld returned 1 exit status

    "g++-4.5"    -o "/tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib" -Wl,-h -Wl,libboost_system-gcc45-mt-d-1_54.dylib -shared -Wl,--start-group "/tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/error_code.o"  -Wl,-Bstatic  -Wl,-Bdynamic  -Wl,--end-group -g 

...failed gcc.link.dll /tmp/build-boost/boost/bin.v2/libs/system/build/gcc-4.5/debug/threading-multi/libboost_system-gcc45-mt-d-1_54.dylib...
...failed updating 1 target...
...updated 15 targets...


Some more information:

notice: Loading user-config configuration file 'user-config.jam' from '/Users/joe/development/cots/boost/tools/build/v2'.
notice: [cmdline-cfg] toolset gcc-4.5 not previously configured; attempting to auto-configure now
notice: will use 'g++-4.5' for gcc, condition <toolset>gcc-4.5
notice: using gcc libraries :: <toolset>gcc-4.5 :: /usr/local/bin /usr/local/lib /usr/local/lib32 /usr/local/lib64
notice: using gcc archiver :: <toolset>gcc-4.5 :: ar
notice: using gcc ranlib :: <toolset>gcc-4.5 :: ranlib
warning: toolset gcc initialization: can not find tool windres
warning: initialized from
notice: using rc compiler :: <toolset>gcc-4.5 :: as

Are these warnings significant?

I've been trying to figure this out for two days now without success. All I want to do is build boost using a version of FSF gcc that I've installed on my mac (not the (darwin) one that came pre-installed). Can it really be so difficult?

If I select toolset=darwin as suggested by Steven it does build the shared lib successfully using 'g++' for darwin, condition <toolset>darwin-4.2.1. This is not what I want.

Regards

Joe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Marshall Clow-2
In reply to this post by Bioxydyn Dev
On Aug 19, 2013, at 11:58 PM, Bioxydyn Dev <[hidden email]> wrote:
On Tue, Aug 20, 2013 at 7:34 AM, Bioxydyn Dev <[hidden email]> wrote:



On Mon, Aug 19, 2013 at 4:57 PM, Steven Watanabe <[hidden email]> wrote:
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:
> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

Please explain. Why would I do that when I've installed gcc separately and not using what came installed on the machine?

From the boost build documentation:

Apple Darwin gcc
The darwin module supports the version of gcc that is modified and provided by Apple. The configuration is essentially identical to that of the gcc module.
The darwin toolset can generate so called "fat" binaries—binaries that can run support more than one architecture, or address mode. To build a binary that can run both on Intel and PowerPC processors, specify architecture=combined. To build a binary that can run both in 32-bit and 64-bit modes, specify address-model=32_64. If you specify both of those properties, a "4-way" fat binary will be generated.

 
I've installed gcc separately. I'm not using Apple's modified version.

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

-- Marshall

Marshall Clow     Idio Software   <[hidden email]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev
On Tue, Aug 20, 2013 at 4:17 PM, Marshall Clow <[hidden email]> wrote:
On Aug 19, 2013, at 11:58 PM, Bioxydyn Dev <[hidden email]> wrote:
On Tue, Aug 20, 2013 at 7:34 AM, Bioxydyn Dev <[hidden email]> wrote:



On Mon, Aug 19, 2013 at 4:57 PM, Steven Watanabe <[hidden email]> wrote:
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:
> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

Please explain. Why would I do that when I've installed gcc separately and not using what came installed on the machine?

From the boost build documentation:

Apple Darwin gcc
The darwin module supports the version of gcc that is modified and provided by Apple. The configuration is essentially identical to that of the gcc module.
The darwin toolset can generate so called "fat" binaries—binaries that can run support more than one architecture, or address mode. To build a binary that can run both on Intel and PowerPC processors, specify architecture=combined. To build a binary that can run both in 32-bit and 64-bit modes, specify address-model=32_64. If you specify both of those properties, a "4-way" fat binary will be generated.

 
I've installed gcc separately. I'm not using Apple's modified version.

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

Joe


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Marshall Clow-2

On Aug 20, 2013, at 10:28 AM, Bioxydyn Dev <[hidden email]> wrote:

On Tue, Aug 20, 2013 at 4:17 PM, Marshall Clow <[hidden email]> wrote:
On Aug 19, 2013, at 11:58 PM, Bioxydyn Dev <[hidden email]> wrote:
On Tue, Aug 20, 2013 at 7:34 AM, Bioxydyn Dev <[hidden email]> wrote:



On Mon, Aug 19, 2013 at 4:57 PM, Steven Watanabe <[hidden email]> wrote:
AMDG

On 08/19/2013 08:19 AM, Bioxydyn Dev wrote:
> I'm trying to build boost 1.54 on OSX 10.8.4. I'm a newbie at building on
> OSX and also at building custom boost binaries.
>
> I followed the instructions at
> http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.htmlup
> to and including section 4. I then installed boost build as described
> in
> section 5.2.1.
>
> To keep things simple I thought I'd just build the thread library for now
> as follows:
> /usr/local/bin/boost-build/bin/b2 install
> --prefix=~/development/cots/boost/ --build-dir=/tmp/build-boost stage
> --with-thread toolset=gcc-4.5 variant=debug --layout=versioned
> --build-type=complete -q
>

use toolset=darwin, not toolset=gcc.

Please explain. Why would I do that when I've installed gcc separately and not using what came installed on the machine?

From the boost build documentation:

Apple Darwin gcc
The darwin module supports the version of gcc that is modified and provided by Apple. The configuration is essentially identical to that of the gcc module.
The darwin toolset can generate so called "fat" binaries—binaries that can run support more than one architecture, or address mode. To build a binary that can run both on Intel and PowerPC processors, specify architecture=combined. To build a binary that can run both in 32-bit and 64-bit modes, specify address-model=32_64. If you specify both of those properties, a "4-way" fat binary will be generated.

 
I've installed gcc separately. I'm not using Apple's modified version.

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

Because it doesn't understand -h?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

because they're both (helpfully) named "ld" ?
and because if you just download and build gcc, I believe that you don't get a standalone linker.
[ At least I didn't when building gcc 4.7.2 and 4.8 ]

-- Marshall

Marshall Clow     Idio Software   <[hidden email]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev



On Tue, Aug 20, 2013 at 8:05 PM, Marshall Clow <[hidden email]> wrote:

On Aug 20, 2013, at 10:28 AM, Bioxydyn Dev <[hidden email]> wrote:

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

Because it doesn't understand -h?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

because they're both (helpfully) named "ld" ?
and because if you just download and build gcc, I believe that you don't get a standalone linker.
[ At least I didn't when building gcc 4.7.2 and 4.8 ]

Please elaborate. Why would it not come with a linker? That doesn't make any sense? How can I check which one it's using.

I also stumbled across your C++ musings and Xcode stuff. Very helpful. From what I've managed to ascertain it looks like if I want to develop for OS X then I should install the latest version of Xcode. Would you agree?

Joe


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Marshall Clow-2

On Aug 20, 2013, at 1:30 PM, Bioxydyn Dev <[hidden email]> wrote:

On Tue, Aug 20, 2013 at 8:05 PM, Marshall Clow <[hidden email]> wrote:

On Aug 20, 2013, at 10:28 AM, Bioxydyn Dev <[hidden email]> wrote:

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

Because it doesn't understand -h?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

because they're both (helpfully) named "ld" ?
and because if you just download and build gcc, I believe that you don't get a standalone linker.
[ At least I didn't when building gcc 4.7.2 and 4.8 ]

Please elaborate. Why would it not come with a linker? That doesn't make any sense?

I didn't say that.
I said it didn't come with a *standalone* linker.

if you do:
g++ junk.cpp -o junk
it will compile and link.  (g++ knows how to link)

If you do:
g++ -c junk,cpp -o junk.o
ld junk.o -o junk
the first command will produce an object file (junk.o)
and the second will produce an executable (using ld).

b2 issues separate compile and link commands (like the second example)

How can I check which one it's using.

ld -v is a good place to start.

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-136
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)

You can also look at the output from running b2 - it should print the commands that it uses.
b2 -n will print the commands w/o executing them.

I also stumbled across your C++ musings and Xcode stuff. Very helpful.

Thanks.

From what I've managed to ascertain it looks like if I want to develop for OS X then I should install the latest version of Xcode. Would you agree?

Yes. Note that there's a "command-line tools" package inside of Xcode that you'll want to install (look in preferences).
It's much easier than fussing with gcc - even if you are using MacPorts, etc.

-- Marshall

Marshall Clow     Idio Software   <[hidden email]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Building Boost on OSX

Bioxydyn Dev
On 20 August 2013 23:52, Marshall Clow <[hidden email]> wrote:

On Aug 20, 2013, at 1:30 PM, Bioxydyn Dev <[hidden email]> wrote:

On Tue, Aug 20, 2013 at 8:05 PM, Marshall Clow <[hidden email]> wrote:

On Aug 20, 2013, at 10:28 AM, Bioxydyn Dev <[hidden email]> wrote:

But I suspect that you _are_ using Apple's linker (ld), and it does not understand -h.

Why do you suspect that Apple's linker is being invoked?

Because it doesn't understand -h?

And why would it not invoke GCC's linker when I've specified the toolset=gcc?

because they're both (helpfully) named "ld" ?
and because if you just download and build gcc, I believe that you don't get a standalone linker.
[ At least I didn't when building gcc 4.7.2 and 4.8 ]

Please elaborate. Why would it not come with a linker? That doesn't make any sense?

I didn't say that.
I said it didn't come with a *standalone* linker.

if you do:
g++ junk.cpp -o junk
it will compile and link.  (g++ knows how to link)

If you do:
g++ -c junk,cpp -o junk.o
ld junk.o -o junk
the first command will produce an object file (junk.o)
and the second will produce an executable (using ld).

b2 issues separate compile and link commands (like the second example)

How can I check which one it's using.

ld -v is a good place to start.

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-136
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)

You can also look at the output from running b2 - it should print the commands that it uses.
b2 -n will print the commands w/o executing them.

I also stumbled across your C++ musings and Xcode stuff. Very helpful.

Thanks.

From what I've managed to ascertain it looks like if I want to develop for OS X then I should install the latest version of Xcode. Would you agree?

Yes. Note that there's a "command-line tools" package inside of Xcode that you'll want to install (look in preferences).
It's much easier than fussing with gcc - even if you are using MacPorts, etc.

-- Marshall

Just to let you know, Marshall, I followed your advice and got it working using clang. Thanks for your help.

I had some trouble with dynamic libs when running the example code but I fixed that by using install_name_tool to change the install name of the boost library.

cheers

Joe.



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build