bjam --build-dir=./build32 --toolset=darwin address-model=32
architecture=x86 --stagedir=./stage32 stage
bjam --build-dir=./build64 --toolset=darwin address-model=64
architecture=x86 --stagedir=./stage64 stage
Damien
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost...@lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
> Hi,
> 32_64 fat compilation is broken out of the box in 1.40.0 on OS X 10.6.
This is known..
> Others reported this here:
> http://groups.google.com/group/boost-list/browse_thread/thread/06c7e1f932219a31#
... and apparently you know that it's known. Do you have any further insights to
this problem -- which seems, on the face of it, like a compiler bug? Could you
bring this up with Apple support?
- Volodya
> JungleCat wrote:
>
>> Hi,
>> 32_64 fat compilation is broken out of the box in 1.40.0 on OS X
>> 10.6.
>
> This is known..
>
>> Others reported this here:
>> http://groups.google.com/group/boost-list/browse_thread/thread/06c7e1f932219a31#
> ... and apparently you know that it's known. Do you have any further
> insights to
> this problem -- which seems, on the face of it, like a compiler bug?
> Could you
> bring this up with Apple support?
No insights yet but I believe this has to do with Xcode 3.2
introducing GCC 4.2 as the default compiler. I'll file an rdar if I
can confirm that it's their problem.
The error starts off when:
#include <exception>
is included from boost, date_time in my case:
/usr/include/c++/4.2.1/exception:42:28: error: bits/c++config.h: No
such file or directory
So:
/usr/include/c++/4.2.1/exception
Includes: bit/c++config.h
However bit/c++config.h doesn't exist, they are rooted in the /usr/
include/c++/4.2.1/i686-apple-darwin* /usr/include/c++/4.2.1/powerpc-
apple-darwin* and /usr/include/c++/4.2.1/x86_64-apple-darwin* folders.
I have not looked into the darwin.jam but I bet it's getting tricked
up with the SDK changes to paths, etc.. it's late, zzz..
Julian
On Sep 4, 2009, at 10:31 PM, Vladimir Prus wrote:
> This isn't a compiler problem as I was able to compile OpenSSL into
> 32_64.
>
> The error starts off when:
>
> #include <exception>
>
> is included from boost, date_time in my case:
>
> /usr/include/c++/4.2.1/exception:42:28: error: bits/c++config.h: No
> such file or directory
>
> So:
>
> /usr/include/c++/4.2.1/exception
>
> Includes: bit/c++config.h
>
> However bit/c++config.h doesn't exist, they are rooted in the /usr/
> include/c++/4.2.1/i686-apple-darwin* /usr/include/c++/4.2.1/powerpc-
> apple-darwin* and /usr/include/c++/4.2.1/x86_64-apple-darwin* folders.
>
> I have not looked into the darwin.jam but I bet it's getting tricked
> up with the SDK changes to paths, etc.. it's late, zzz..
This is an include path problem. Unfortunately I don't know anything
about bjam or the boost build process. However I do know where you
can find bits/c++config.h.
For each platform (32/64, 10.4/5/6) there is a platform-specific
directory, e.g.:
/usr/include/c++/4.2.1/i686-apple-darwin10/ // 32 bit Snow Leopard
/usr/include/c++/4.2.1/x86_64-apple-darwin10/ // 64 bit Snow Leopard
Inside of each of these you will find bits/c++config.h. So you need
an include path to /usr/include/c++/4.2.1/<correct platform>.
Happy hunting! ;-)
-Howard
Do you suggest such a path should be manually passed to compiler? Still
counts as compiler bug by my book :-/
- Volodya
I would have to see the command line being used to make any further
guesses as to where the problem lies. However on 10.6 I'm seeing the
following behavior:
$ cat test.cpp
#include <iostream>
int main()
{
std::cout << "Hello World\n";
}
$ g++ -arch i386 -arch x86_64 test.cpp
$ a.out
Hello World
$ nm -arch all a.out |grep a.out
a.out (for architecture i386):
a.out (for architecture x86_64):
-Howard
Julian
D
JungleCat wrote:
> ok, the problem is that you cannot compile c++ into ppc64 machine code
> on Snow Leopard because it doesn't ship with a ppc64 bit version of
> the SDK.
>
> The following is the culprit in darwin.jam
>
> arch-addr-flags darwin OPTIONS : combined : 64 : -arch x86_64 *-arch
> ppc64 *;
>> Boost...@lists.boost.org <mailto:Boost...@lists.boost.org>
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
> ------------------------------------------------------------------------
> OSX 10.6 doesn't install on a ppc Apple, I just tried it on my
> wife's G5. Not supported anymore.
This is the final transition to Intel, phase out PPC.
It was mainstream news: http://www.engadget.com/2009/06/10/snow-leopard-officially-puts-powerpc-macs-on-endangered-species/
There will need to be a rule changes to darwin.jam to fix this. If you
feel you want to hack it simply remove -arch ppc64 and build.
Julian
Then I compiled with architecture=x86 address-model=32_64 and got universal binaries as I needed:$ lipo -info lib/libboost_iostreams-xgcc42-mt.dylibArchitectures in the fat file: lib/libboost_iostreams-xgcc42-mt.dylib are: i386 ppc7400 x86_64$ lipo -info lib/libboost_iostreams-xgcc42-mt-1_40.dylibArchitectures in the fat file: lib/libboost_iostreams-xgcc42-mt-1_40.dylib are: i386 x86_64I also tried architecture=combined address-model=32_64 (after I removed -arch ppc64 from tools/darwin.jam), and confirmed that again, the "-m64" is what causes errors (I tested that it somehow forces 64-bit even if you previously specify 32-bit arch(s) with -arch option). With the same fix for -m64, this works:
> I think I got it with Snow Leopard and 32_64. First, looking at the lines
> with "arch-addr-flags", I realized what I really needed was architecture=x86
> address-model=32_64 instead of architecture=combined address-model=32_64 (I
> needed Intel-only binaries, but I tested this also works for
> architecture=combined if you remove the -arch ppc64 from
> tools/darwin.jam:307-317).
Just to clarify, you now have:
arch-addr-flags darwin OPTIONS : combined : 32_64 : -arch i386 -arch ppc -arch x86_64 ;
and that builds "3-way" fat binary, and if you put back
-arch ppc64
it makes the compiler unhappy? How can I check if a compile is affected by this problem/change?
Oh, bummer. I imagine that a simpler change would be to have:
if $(model) = 32
{
option = -m32 ;
}
else if $(model) = 64
{
option = -m64 ;
}
?
> On a side note, I hope boost.build will soon be in Python, which I know
> well, since then I am willing to learn Boost.Build and submit proper patches
> without hacks :-)
I'm working on that; expect more progress by next Monday.
Thanks for investigating the problems -- this was very helpful.
- Volodya
> architecture=combined if you remove the -arch ppc64 fromJust to clarify, you now have:
> tools/darwin.jam:307-317).
arch-addr-flags darwin OPTIONS : combined : 32_64 : -arch i386 -arch ppc -arch x86_64 ;
and that builds "3-way" fat binary, and if you put back
-arch ppc64
it makes the compiler unhappy? How can I check if a compile is affected by this problem/change?
Oh, bummer. I imagine that a simpler change would be to have:> if $(model) = 32
> {
> option = -m32 ;
> }
> else
> {
> if $(model) = 32_64
> {
> }
> else
> {
> option = -m64 ;
> }
> }
else if $(model) = 64
if $(model) = 32
{
option = -m32 ;
}
{
option = -m64 ;
}
?
I wrote a blog article about how we build the 4-way universal binaries
of Boost on Snow Leopard for our needs:
http://www.mani.de/backstage/?p=324
Regards,
Mani
> I followed all tricks mentioned in this list or other forums (e.g.
> removing the -m64 option), but nothing worked for us. Building 32-Bit
> and 64-Bit at the same time seems to be broken.
> But I managed how to build a 4-way universal binary on Snow Leopard:
> just build every architecture separately and afterwards put everything
> together using the lipo tool.
How does that agree with reports by others that 64-bit PPC is just
not supported with 10.5 SDK?
- Volodya
As far as I know 64-bit PPC is not supported by the 10.6 SDK (Snow
Leopard), but we are using the 10.5 SDK (Leopard).
When installing Xcode there are multiple SDKs installed.
Additionally we are using GCC 4.0 instead of 4.2, because we want to
support Mac OS X 10.4 (Tiger) as minimum OS. When compiling with GCC
4.2 the generated code is for "ppc7400" that means "G4 Macs" and
greater; but Tiger also runs on "G3 Macs". But this may not be of much
importance anymore.
If you look at our script you see that we're using the following
options for bjam:
toolset=darwin-4.0: Use darwin toolset with GCC 4.0.
macosx-version=10.5: Use the 10.5 SDK.
macosx-version-min=10.4: Minimum supported OS is 10.4.
Regards,
Mani
Nice write-up and I'm glad you've got things working.
I've been in this same situation as I am building univeral binaries
that need boost libs on both 10.5 and 10.6.
I've been able to do this in one build command using the patches here:
See also:
http://trac.macports.org/ticket/21408
Essentially it came down to:
1) providing the right set of -arch flags for a 10.5 or 10.6 (no -arch
ppc64) system.
2) avoiding the usage of the -m64 type flags (does Boost specifically
need these in any way?), since they seem to cause problems when
conflicting with the (multiple) apple only -arch flags that can be
used to build (all in one fell swoop) FAT universal libs.
-m32
-m64
Generate code for a 32-bit or 64-bit environment. The 32-
bit environment sets int, long and
pointer to 32 bits and generates code that runs on any
i386 system. The 64-bit environment sets
int to 32 bits and long and pointer to 64 bits and
generates code for AMD's x86-64 architecture.
For darwin only the -m64 option turns off the -fno-pic and
-mdynamic-no-pic options.
Dane