Using 'address-model-32_64' on Mac OS 10.6

I've recently upgraded to a Mac with 64bit firmware and Snow Leopard. I've noticed all applications compiled with g++ now default to 64 bit libs (x86_64), including boost. Thanks by the way for the fixes to boost 1.41 that allow successful 3- way arch compilation on osx again! Now I'm trying to just build two- way arches. I'm now trying to compile boost (I happen to be using trunk), and am noticing that passing 'address-model-32_64' does not seem to have the effect I'd expect. If the flag is passed the only affect I notice is that the build directories include it 'address-model-32_64' in the path, but notably the '-arch -i386 -arch x86_64' flags are not properly added to the CXXFLAGS and LINKFLAGS. Therefore the compiled dynamic libraries are still single architecture, x86_64. Passing 'architecture=combined' does prompt these flags, but includes the 'arch ppc' flag as well which I don't want. So, is it a bug that using address-model alone does not work or am I am misunderstanding something? Thanks for any clarification. Cheers, Dane

Hello Dane,
On Mon, Jan 11, 2010 at 7:49 AM, Dane Springmeyer
I'm now trying to compile boost (I happen to be using trunk), and am noticing that passing 'address-model-32_64' does not seem to have the effect I'd expect. If the flag is passed the only affect I notice is that the build directories include it 'address-model-32_64' in the path, but notably the '-arch -i386 -arch x86_64' flags are not properly added to the CXXFLAGS and LINKFLAGS. Therefore the compiled dynamic libraries are still single architecture, x86_64.
Passing 'architecture=combined' does prompt these flags, but includes the 'arch ppc' flag as well which I don't want. So, is it a bug that using address-model alone does not work or am I am misunderstanding something?
First check that you are using address-model=32_64, not address-model-32_64. Not sure whether the second works, but the first one is what I know for sure that works (works = just specifies the option in this case). To have Intel-only universal binary with IA32 and Intel64 architectures, use architecture=x86 along with address-model=32_64. The possible architectures for toolset=darwin are combined, x86, power and arm, and you have to always specify one of these explicitly if you are already specifying address-model, since there is no "fallback" architecture choice Boost.Build does when you don't specify one (i.e. simply no flags are set in that case and therefore g++ is used without any arch flags, i.e. outputting whatever is the default of the compiler on the build machine / os version / compiler version). On the other hand, specifying architecture and omitting address-model defaults to "32" (in fact, there is only 64 and 32_64, and everything else is a fallback case behaving like if "32" was specified and had its supposed meaning). Another question is whether there should be, for usability purposes, a default for architecture when address-model is specified. I currently have no opinion on what (if) the default should be :-). HTH, Boris

On Jan 10, 2010, at 11:37 PM, Boris Dušek wrote:
Hello Dane,
On Mon, Jan 11, 2010 at 7:49 AM, Dane Springmeyer
wrote: I'm now trying to compile boost (I happen to be using trunk), and am noticing that passing 'address-model-32_64' does not seem to have the effect I'd expect. If the flag is passed the only affect I notice is that the build directories include it 'address-model-32_64' in the path, but notably the '-arch -i386 -arch x86_64' flags are not properly added to the CXXFLAGS and LINKFLAGS. Therefore the compiled dynamic libraries are still single architecture, x86_64.
Passing 'architecture=combined' does prompt these flags, but includes the 'arch ppc' flag as well which I don't want. So, is it a bug that using address-model alone does not work or am I am misunderstanding something?
First check that you are using address-model=32_64, not address-model-32_64.
Right, I spelled it wrong when re-typing in the email, but have it right in the bjam command.
Not sure whether the second works, but the first one is what I know for sure that works (works = just specifies the option in this case).
To have Intel-only universal binary with IA32 and Intel64 architectures, use architecture=x86 along with address-model=32_64.
Great, that did it! Thanks so much! Dane
participants (2)
-
Boris Dušek
-
Dane Springmeyer