Re: [OT] On `ad hominem' - OS X users
- From: Sherm Pendley <spamtrap@xxxxxxxxxxx>
- Date: Tue, 23 Sep 2008 00:06:15 -0400
Ilya Zakharevich <nospam-abuse@xxxxxxxxx> writes:
"Example"?! "A bug report"?! You assume too much about OS X people
building Math::Pari. I do not think I got ANY bug report (ie,
something following the procedure outlined in README/INSTALL) from
them during last several years...
Okay, here's the deal. The "generic" recipe - i.e. "perl Makefile.PL;
make; make test; sudo make install" fails because Mac OS X uses
so-called "fat" binaries that support four different architectures -
x86 and PPC, 32- and 64-bit.
For many apps and libraries, simply passing multiple -arch options to
GCC will produce such a "fat" binary. Perl on the latest Mac OS X
release is configured to do this with both i386 and ppc architectures,
both of them 32-bit.
But GP/Pari uses assembler by default, and chooses which assembler to
use at config time. Even if one specifies the architecture directly,
one can still only build for a single architecture at a time. But, as
I said, Mac OS X's Perl wants to build them all at once... The result
on my Intel Mac is x86 mnemonics being passed to the PPC assembler,
which naturally doesn't know what to do with them. I haven't tested
it, but presumably the reverse would be true when building on a PPC
Mac.
In theory, one could build the library twice; once natively, and once
cross-compiled. Then, a tool called "lipo" is used to "glue" the two
"skinny" libraries into one "fat" library. I didn't bother doing that,
for two reasons. First, the "perl Makefile.PL machine=none" recipe for
producing a C-only library works, and passes its tests on my machine.
Second, since I'm not a math geek, the C-only library that's produced
that way is good enough for me.
For what it's worth, libffi works around these issues by building all
of its assembler files regardless of what architecture it's being
built on or for, and uses #ifdef macros to conditionally compile only
the correct code. Thus, the decision is made at compile time rather
than config time, and it's made correctly for each of the multiple
compile passes that are made to produce a "fat" binary.
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
.
- Follow-Ups:
- Re: [OT] On `ad hominem' - OS X users
- From: Ilya Zakharevich
- Re: [OT] On `ad hominem' - OS X users
- References:
- Math::Pari in turmoil
- From: Ilya Zakharevich
- Re: Math::Pari in turmoil
- From: Sherm Pendley
- Re: Math::Pari in turmoil
- From: Ilya Zakharevich
- Re: Math::Pari in turmoil
- From: Sherm Pendley
- [OT] On `ad hominem' - OS X users
- From: Ilya Zakharevich
- Math::Pari in turmoil
- Prev by Date: [OT] On `ad hominem' - OS X users
- Next by Date: Re: [OT] On `ad hominem' - OS X users
- Previous by thread: [OT] On `ad hominem' - OS X users
- Next by thread: Re: [OT] On `ad hominem' - OS X users
- Index(es):
Relevant Pages
|