Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#15578 closed defect (fixed)

gmp: universal build is broken (t-get_d test fails)

Reported by: ryandesign (Ryan Schmidt) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.7.0
Keywords: Cc: illogic-al@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: gmp

Description

I enabled the universal variant of gmp in r37327 because it seemed to build, but the test suite fails:

creating t-scan
make  check-TESTS
PASS: t-asmtype
PASS: t-aors_1
PASS: t-divrem_1
PASS: t-fat
mpn_get_d wrong on 2^n
    bit      0
    exp      0
    want_bit 0
    sign     0
    n        =0x1
    nsize    1
    want     =[00 00 00 00 00 00 F0 3F] 1
    got      =[FE 07 00 00 00 00 00 00] 1.0108583113911904294e-320
FAIL: t-get_d
PASS: t-instrument
PASS: t-iord_u
PASS: t-mp_bases
PASS: t-perfsqr
PASS: t-scan
==================================
1 of 10 tests failed
Please report to gmp-bugs@swox.com
==================================
make[4]: *** [check-TESTS] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2

I'm asking the developers for help with this problem.

Change History (12)

comment:1 Changed 12 years ago by ryandesign (Ryan Schmidt)

The developers have not been helpful and I haven't had sufficient time to look into this so I just disabled the universal variant again for now in r37785.

comment:2 Changed 12 years ago by illogic-al@…

Hi. I just "fixed" gmp to allow for universal builds in a recent check-in. I didn't realize this ticket was here. But, now that it's all said and done, I'd like to keep it as is until I test out some software which requires it. I'll report back on what happens when run on a ppc and intel machine.

comment:3 Changed 12 years ago by illogic-al@…

Cc: illogic-al@… added

Cc Me!

comment:4 Changed 12 years ago by ryandesign (Ryan Schmidt)

Port: gmp added

Removed universal variant again because it does not produce a viable gmp. See notes in duplicate #16935. The gmp developers are hostile towards the use of Apple gcc in general; they are unlikely to support a universal build. Please see the above referenced conversation I had with the developers of gmp in which they did not even know what a universal binary was.

comment:5 Changed 12 years ago by illogic-al@…

Unfortunate, but understandable. I tested the app using gmp (KCalc) and from my limited testing it worked fine. I saw the other bug about the UB failing compilation on ppc however so that doesn't help much. Do you think I should try to do that builds for each arch separately, as with cairo? We could provide each generated file in the port's file directory, then copy it over after configure right? I don't actually _need_ this Portfile to build as a universal (since I know how now) but I think it works when it does get built that way, so we might as well give it a shot i think. Also I think I'll bug the gmp people again. :-)

comment:6 Changed 12 years ago by blb@…

One issue I noticed was the gmp.h header file, which as (among other things) __GMP_HAVE_HOST_CPU_FAMILY_powerpc, on Intel it's 0, PowerPC it's a 1, so the header file is technically not universal...

comment:7 in reply to:  6 ; Changed 12 years ago by ryandesign (Ryan Schmidt)

Replying to blb@…:

One issue I noticed was the gmp.h header file, which as (among other things) __GMP_HAVE_HOST_CPU_FAMILY_powerpc, on Intel it's 0, PowerPC it's a 1, so the header file is technically not universal...

Right. We've overcome things like that in other ports; see the glib2 port for example.

It would be nice to have a universal gmp. We would need to see if gmp can be cross-compiled at all. If it can, then we still have the problem that probably the test suite cannot be run for the non-native architecture (at least, the Intel parts can probably not be tested on PowerPC; the PowerPC parts might be testable on Intel via Rosetta). I have learned the hard way (and it is stated in the gmp documentation) that the test suite must must must pass before you can use the built gmp. Otherwise you're just asking for trouble.

comment:8 in reply to:  7 Changed 12 years ago by illogic-al@…

Replying to ryandesign@…:

It would be nice to have a universal gmp. We would need to see if gmp can be cross-compiled at all. If it can, then we still have the problem that probably the test suite cannot be run for the non-native architecture (at least, the Intel parts can probably not be tested on PowerPC; the PowerPC parts might be testable on Intel via Rosetta). I have learned the hard way (and it is stated in the gmp documentation) that the test suite must must must pass before you can use the built gmp. Otherwise you're just asking for trouble.

Ok so the app I've tested, kcalc, links to a universal libgmp. I've tested on intel and ppc (rosetta) and nothing crashes. I'll ask the gmp developers this weekend.

comment:9 Changed 12 years ago by blb@…

Cc: mcalhoun@… added

Is this still an issue with gmp using muniversal?

comment:10 Changed 12 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

As it stands now, gmp can build universal:
On an Intel Mac: ppc/i386, ppc/x86_64, or i386/x86_64
On a PPC Mac: ppc/ppc64

All the tests pass on the configurations I can test.

This is not quite ideal (no ppc/i386/x86_64 or 4-way universal), but there are no plans to improve the situation.

I would vote this ticket be closed.

comment:11 Changed 12 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: newclosed

I built an i386/x86_64 universal and it passed all tests, so that's good. It's better than no universal at all. I'll close this for now.

comment:12 Changed 12 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.