Opened 15 years ago
Closed 15 years ago
#19747 closed defect (fixed)
ghc 6.10.3_1: can't locate file for: -lgmp on Tiger
Reported by: | dmathers@… | Owned by: | gwright@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.7.1 |
Keywords: | Cc: | marcin.zalewski@…, ryandesign (Ryan Carsten Schmidt), h8spawn@…, gale@… | |
Port: | ghc |
Description
When I try to upgrade ghc I get: ld: library not found for -lgmp
It looks like the culprit is: -L/opt/local/lib
My macports in installed in /ports
Change History (21)
comment:1 Changed 15 years ago by mf2k (Frank Schima)
Owner: | changed from macports-tickets@… to gwright@… |
---|
comment:2 Changed 15 years ago by marcin.zalewski@…
comment:4 Changed 15 years ago by marcin.zalewski@…
This fixed it for me (edit in Portfile):
199c199 < reinplace "s|XXPATH_TO_GMP_LIBRARYXX|${prefix}/lib|" ${worksrcpath}/compiler/ghc.cabal.in --- > # reinplace "s|XXPATH_TO_GMP_LIBRARYXX|${prefix}/lib|" ${worksrcpath}/compiler/ghc.cabal.in 203,204d202 < reinplace "s|/opt/local/lib|${prefix}/lib|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf <
I am not sure if the first edit is actually necessary, but I do not want to recompile my GHC anymore. :)
comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign@… added |
---|
comment:6 Changed 15 years ago by marcin.zalewski@…
BTW, I should have added that I had problems on PowerPC. It seems that the Intel version is using a different ghc to bootstrap.
comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
I am seeing the issue as well on Intel.
comment:8 Changed 15 years ago by h8spawn@…
I'm having the same problem with a really fresh port installation. That is on Mac OS X 10.4, Intel with Xcode 2.5, after doing
sudo port -f uninstall installed sudo rm -rf /Library/Tcl/macports1.0/ /Library/Receipts/MacPorts-1.* /opt rm -r ~/.macports/
and reinstalling MacPorts,
sudo port install ghc
fails with:
Preprocessing library ghc-6.10.3... /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: can't locate file for: -lgmp collect2: ld returned 1 exit status linking dist-stage1/build/Fingerprint_hsc_make.o failed
By the way, a similar (identical?) bug for ghc 6.10.1 was reported as ticket #17321
and considered fixed a few months ago.
comment:10 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in r52187 (maintainer timeout). Thanks to Marcin Zalewski for identifying the problem.
comment:11 follow-up: 12 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The problem seems fixed when prefix is not /opt/local, but when it is, it still doesn't work.
comment:12 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to ryandesign@…:
The problem seems fixed when prefix is not /opt/local, but when it is, it still doesn't work.
I'm still getting "can't locate file for: -lgmp" both when prefix is /opt/local and when it isn't, on two Intel Macs with Tiger. Stephan above is also using Tiger on Intel. But my fix from r52187 above fixed it for an Intel Mac with non-/opt/local prefix on Leopard.
comment:13 Changed 15 years ago by gale@…
On Mac OS X 10.4.11 Intel:
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: can't locate file for: -lgmp
It has now become quite clear that the prefix is not the problem here. Please change the summary of this ticket to:
ghc 6.10.3_1 can't locate file for: -lgmp
comment:15 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)
Summary: | ghc 6.10.3 using hard coded /opt/local → ghc 6.10.3_1: can't locate file for: -lgmp on Tiger |
---|
comment:16 Changed 15 years ago by gwright@…
It may be that build.mk needs to have SRC_CC_OPTS set to include -L${prefix}/lib. As noted earlier, Tiger/pcc and Tiger/intel use different bootstrap compilers. The ghc 6.6 bootstrap compiler needed a lot of help to ensure that the right libraries and header files were found.
I'll look back at the old versions to see if anything changed.
comment:17 follow-ups: 18 19 Changed 15 years ago by gwright@…
OK, I have reports that ghc 6.10.3 revision 4 builds successfully on both Tiger/ppc and Tiger/intel. Revision 4 backs out one of the changes in r51205, putting back the patch originally added to work around this problem. There were changes introduced upstream to 6.10.3 which were supposed to make this patch unnecessary, but they were apparently not tested with different bootstrap compilers to see if they actually worked.
If people still have trouble, they should build with the new variant cabal_configure_debug as so:
$ sudo port ghc clean $ sudo port -dv ghc build +cabal_configure_debug 2>&1 | tee build.log
and send the output. The new variant patches the Makefiles to provide useful output from cabal's configuration phase, which is otherwise completely silent.
Unless I get further reports on this problem I will close this in the next few days.
comment:18 Changed 15 years ago by gale@…
Replying to gwright@…:
That should be:
$ sudo port ghc clean $ sudo port -dv build ghc +cabal_configure_debug 2>&1 | tee build.log
comment:19 follow-up: 20 Changed 15 years ago by h8spawn@…
The current revision builds fine for me on Tiger/Intel.
comment:20 Changed 15 years ago by gwright@…
Replying to h8spawn@…:
The current revision builds fine for me on Tiger/Intel.
Thanks for the information! It looks as if revision 4 (and later) fix the problem.
comment:21 Changed 15 years ago by gwright@…
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I get the same problem with fresh build of the whole port tree.