how ghc finds libgmp.so when linking

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how ghc finds libgmp.so when linking

Johannes Waldmann-2
Hi.

I have some obsolete libgmp in /usr/lib,
and the correct one in /usr/local/lib,
but ghc does not find it,
resp., finds the /usr/lib one earlier,
and this is missing some symbols

/usr/local/lib/ghc-7.10.3/integ_2aU3IZNMF9a7mQ0OzsZ0dS/libHSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS.a(wrappers.o):
In function `integer_gmp_mpn_xor_n':
wrappers.c:(.text+0x1761): undefined reference to `__gmpn_xor_n'

when I put  ghc ... -optl -Wl,--verbose   I see that:

SEARCH_DIR("/usr/i486-linux-gnu/lib32"); SEARCH_DIR("/usr/local/lib32");
SEARCH_DIR("/lib32"); SEARCH_DIR("/usr/lib32");
SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib");
SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");

but that's apparently not what's happening.

Is  ghc  changing this, and how can I work around it?

- J.W.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: how ghc finds libgmp.so when linking

Johannes Waldmann-2
more data:

when I compile with  -optl -L/usr/local/lib,
then the correct library is found,

when I put  ("ld flags", "-L/usr/local/lib")
in ghc-7.10.3/settings, then it's not,

when I put ("C compiler link flags", "-L/usr/local/lib")
in settings, then it is.

So, I can leave it at that.
But I still don't know how this came to be.
I built this ghc-7.10.3 from source.

- J.W.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: how ghc finds libgmp.so when linking

Dominic Steinitz-2
Johannes Waldmann <johannes.waldmann <at> htwk-leipzig.de> writes:

>
> more data:
>
> when I compile with  -optl -L/usr/local/lib,
> then the correct library is found,
>
> when I put  ("ld flags", "-L/usr/local/lib")
> in ghc-7.10.3/settings, then it's not,
>
> when I put ("C compiler link flags", "-L/usr/local/lib")
> in settings, then it is.
>
> So, I can leave it at that.
> But I still don't know how this came to be.
> I built this ghc-7.10.3 from source.
>
> - J.W.
>

I get

ld: warning: directory not found for option '-L/opt/local/lib/'

when using hmatrix but I have no idea why.
Perhaps the error messages are not related.



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe