Boost logo

Boost Users :

From: Daniel Lord (daniel_at_[hidden])
Date: 2008-02-26 12:04:37


Lothar,I'll test your code on my systems when I get a chance and report.

Meanwhile, you can easily test the architecture of any file using the "file"
command in the shell.

Note that, on my system (shown below), some of the boost filesystem
libraries are dual-architecture and some are not. This is consistent with
how some projects build--they build individual binaries for a single
architecture and then use "lipo" to stick them together. So you need to be
sure you are linking in a dual-architecture version of the library and not a
single architecture version. Perhaps that is you problem?

$sudo find /usr/local/lib -regex ".*libboost_filesystem.*" -exec file {} \;
Password:
/usr/local/lib/libboost_filesystem-1_34_1.a: current ar archive
/usr/local/lib/libboost_filesystem-1_34_1.dylib: Mach-O dynamically linked
shared library i386
/usr/local/lib/libboost_filesystem-d-1_34_1.a: current ar archive
/usr/local/lib/libboost_filesystem-d-1_34_1.dylib: Mach-O dynamically linked
shared library i386
/usr/local/lib/libboost_filesystem-d.a: current ar archive
/usr/local/lib/libboost_filesystem-gcc40-1_34.1.34.0.dylib: Mach-O universal
binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-1_34.1.34.0.dylib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-1_34.1.34.0.dylib (for architecture
i386): Mach-O dynamically linked shared library i386

/usr/local/lib/libboost_filesystem-gcc40-1_34.a: Mach-O universal binary
with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-1_34.a (for architecture ppc): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-1_34.a (for architecture
i386): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-1_34.dylib: Mach-O universal binary
with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-1_34.dylib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-1_34.dylib (for architecture
i386): Mach-O
dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.1.34.0.dylib: Mach-O
universal binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.1.34.0.dylib (for
architecture ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.1.34.0.dylib (for
architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.a: Mach-O universal binary
with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.a (for architecture
ppc): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.a (for architecture
i386): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.dylib: Mach-O universal
binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.dylib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-d-1_34.dylib (for architecture
i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.1.34.0.dylib: Mach-O
universal binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.1.34.0.dylib (for
architecture ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.1.34.0.dylib (for
architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.a: Mach-O universal binary
with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.a (for architecture
ppc): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.a (for architecture
i386): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.dylib: Mach-O universal
binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.dylib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-mt-1_34.dylib (for architecture
i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.1.34.0.dylib: Mach-O
universal binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.1.34.0.dylib (for
architecture ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.1.34.0.dylib (for
architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.a: Mach-O universal
binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.a (for architecture
ppc): current
ar archive
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.a (for architecture
i386): current ar archive
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.dylib: Mach-O universal
binary with 2 architectures
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.dylib (for architecture
ppc7400): Mach-O dynamically linked shared library ppc
/usr/local/lib/libboost_filesystem-gcc40-mt-d-1_34.dylib (for architecture
i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libboost_filesystem-mt-1_34_1.a: current ar archive
/usr/local/lib/libboost_filesystem-mt-1_34_1.dylib: Mach-O dynamically
linked shared library i386
/usr/local/lib/libboost_filesystem-mt-d-1_34_1.a: current ar archive
/usr/local/lib/libboost_filesystem-mt-d-1_34_1.dylib: Mach-O dynamically
linked shared library i386
/usr/local/lib/libboost_filesystem-mt-d.a: current ar archive
/usr/local/lib/libboost_filesystem-mt.a: current ar archive
/usr/local/lib/libboost_filesystem.a: current ar archive

Some time ago, I created a make file that builds a simple fat32, fat64, and
quad-arch program loading a static and dynamic lib as an exercise to figure
out how to do so with make and lipo. The results show what the
multi-architecture libraries should report using "file" on them:

hello: Mach-O universal binary with 4 architectures
hello (for architecture i386): Mach-O executable i386
hello (for architecture ppc7400): Mach-O executable ppc
hello (for architecture ppc64): Mach-O 64-bit executable ppc64
hello (for architecture x86_64): Mach-O 64-bit executable x86_64
hello.fat32.o: Mach-O universal binary with 2 architectures
hello.fat32.o (for architecture i386): Mach-O object i386
hello.fat32.o (for architecture ppc7400): Mach-O object ppc
hello.fat64.o: Mach-O universal binary with 2 architectures
hello.fat64.o (for architecture ppc64): Mach-O 64-bit object ppc64
hello.fat64.o (for architecture x86_64): Mach-O 64-bit object x86_64
hello_fat32: Mach-O universal binary with 2 architectures
hello_fat32 (for architecture i386): Mach-O executable i386
hello_fat32 (for architecture ppc7400): Mach-O executable ppc
hello_fat64: Mach-O universal binary with 2 architectures
hello_fat64 (for architecture ppc64): Mach-O 64-bit executable ppc64
hello_fat64 (for architecture x86_64): Mach-O 64-bit executable x86_64
libuniversal.fat32.dylib: Mach-O universal binary with 2 architectures
libuniversal.fat32.dylib (for architecture i386): Mach-O object i386
libuniversal.fat32.dylib (for architecture ppc7400): Mach-O object ppc
libuniversal.fat64.dylib: Mach-O universal binary with 2 architectures
libuniversal.fat64.dylib (for architecture ppc64): Mach-O 64-bit object
ppc64
libuniversal.fat64.dylib (for architecture x86_64): Mach-O 64-bit object
x86_64
libuniversal.i386.dylib: Mach-O object i386
libuniversal.ppc64.dylib: Mach-O 64-bit object ppc64
libuniversal.ppc7400.dylib: Mach-O object ppc
libuniversal.x86_64.dylib: Mach-O 64-bit object x86_64
libworld.fat32.a: Mach-O universal binary with 2 architectures
libworld.fat32.a (for architecture i386): Mach-O object i386
libworld.fat32.a (for architecture ppc7400): Mach-O object ppc
libworld.fat64.a: Mach-O universal binary with 2 architectures
libworld.fat64.a (for architecture ppc64): Mach-O 64-bit object ppc64
libworld.fat64.a (for architecture x86_64): Mach-O 64-bit object x86_64
libworld.i386.a: Mach-O object i386
libworld.ppc64.a: Mach-O 64-bit object ppc64
libworld.ppc7400.a: Mach-O object ppc
libworld.x86_64.a: Mach-O 64-bit object x86_64

On 2/26/08, Lothar May <boost_at_[hidden]> wrote:
>
> Hi Daniel,
>
> compiling boost is successful on my system, too. Are boost exceptions
> caught using your build? Is your build universal?
>
> > I missed the thread on this, but I'll help you out if I can--just
> > bring me up to speed.
>
> Sample test code is this:
>
> --cut here--
>
> #include <iostream>
> #include <boost/filesystem.hpp>
>
> using namespace std;
> using namespace boost::filesystem;
>
> int
> main()
> {
> try
> {
> directory_iterator i("does_not_exist");
> } catch(...)
> {
> cout << "This is never printed on MacOS 10.5." << endl;
> }
> return 0;
> }
>
> --cut here--
>
> Best regards,
>
> Lothar
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net