RE: gtk+hs and libgmp
"Simon Marlow" <[EMAIL PROTECTED]> wrote, > > > That would be one solution, yes. On your system, if you > > remove /usr/lib/libgmp.a (and /usr/lib/libgmp.so if you have > > one), does it work? You only need these files if you intend > > to build any software which depends on having GMP version 2, > > which is unlikely since GMP 3 is source-compatible with GMP 2. > > > > Yes, that works. Still I would opt for the renaming to avoid this > > problem in the future. It really depends on the setup of the system. > > Another question: should packages like gtk+hs not add themselves to > > package.conf, so that gtkhs-config is not needed? Or is this method > > not yet proven. > > I've been discussing with Manuel how best to do this. > It's not straightforward, because you still want to be > able to do things like 'make install', and have several > versions of gtk+hs on your system at once. Nevertheless, adding package support is on the top of my list. Cheers, Manuel ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
> > That would be one solution, yes. On your system, if you > remove /usr/lib/libgmp.a (and /usr/lib/libgmp.so if you have > one), does it work? You only need these files if you intend > to build any software which depends on having GMP version 2, > which is unlikely since GMP 3 is source-compatible with GMP 2. > > Yes, that works. Still I would opt for the renaming to avoid this > problem in the future. It really depends on the setup of the system. > Another question: should packages like gtk+hs not add themselves to > package.conf, so that gtkhs-config is not needed? Or is this method > not yet proven. I've been discussing with Manuel how best to do this. It's not straightforward, because you still want to be able to do things like 'make install', and have several versions of gtk+hs on your system at once. Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Wed, 2001-10-31 at 15:49, Simon Marlow wrote: > > > Here is the output: > > 1. Main.out from a link that succeeds. > > 2. GtkHelloWorld.out, a sample program from gtk+hs, compiled with > > ghc -v -fglasgow-exts -lgtkHS GtkHelloWorld.hs `gtkhs-config > > --cflags` `gtkhs-config --libs` `gtk-config --cflags` > > `gtk-config --libs` > > > > In fact, you are right, there is a -L/usr/lib before -lgmp. > > Maybe the libgmp.a included > > with ghc should be renamed, for example libgmp_ghc.a > > That would be one solution, yes. On your system, if you remove /usr/lib/libgmp.a >(and /usr/lib/libgmp.so if you have one), does it work? You only need these files if >you intend to build any software which depends on having GMP version 2, which is >unlikely since GMP 3 is source-compatible with GMP 2. Yes, that works. Still I would opt for the renaming to avoid this problem in the future. It really depends on the setup of the system. Another question: should packages like gtk+hs not add themselves to package.conf, so that gtkhs-config is not needed? Or is this method not yet proven. -- Gérard Milmeister Tannenrauchstr. 35 8038 Zürich [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
> Here is the output: > 1. Main.out from a link that succeeds. > 2. GtkHelloWorld.out, a sample program from gtk+hs, compiled with > ghc -v -fglasgow-exts -lgtkHS GtkHelloWorld.hs `gtkhs-config > --cflags` `gtkhs-config --libs` `gtk-config --cflags` > `gtk-config --libs` > > In fact, you are right, there is a -L/usr/lib before -lgmp. > Maybe the libgmp.a included > with ghc should be renamed, for example libgmp_ghc.a That would be one solution, yes. On your system, if you remove /usr/lib/libgmp.a (and /usr/lib/libgmp.so if you have one), does it work? You only need these files if you intend to build any software which depends on having GMP version 2, which is unlikely since GMP 3 is source-compatible with GMP 2. Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Mon, 2001-10-29 at 20:24, Gérard Milmeister wrote: > > n.b. I send the message only to you, not to the mailing list because > of the attachments. Ooops... -- Gérard Milmeister Tannenrauchstr. 35 8038 Zürich [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Mon, 2001-10-29 at 11:11, Simon Marlow wrote: > > > On Sat, 2001-10-27 at 17:27, Manuel M. T. Chakravarty wrote: > > > Gérard Milmeister <[EMAIL PROTECTED]> wrote, > > > > > > > On Thu, 2001-10-25 at 13:53, Simon Marlow wrote: > > > > > It seems very strange that the libgmp in your GHC > > installation doesn't work. How did you install GHC? Do you > > have problems linking other programs, or just gtk+hs programs? > > > > > > > > > As far as I know, it happens only with gtk+hs. Small > > programs I have > > > > written are linked alright. > > > > > > Do these small programs actually use any arbitrary precision > > > arthimetic - ie, use the type Integer? > > > > > > Manuel > > Something like this? > > > > module Main where > > > > main = print (100::Integer) > > > > Yes, it works. > > I know that gtk+hs adds a -L/usr/lib option to the command line, which comes >originally from gtk-config. > > I'm still confused by what you said about GHC not linking with the libgmp.a in >/opt/ghc, and yet it still manages to link programs using arbitrary precision >integers somehow. Normally GHC won't look in /usr/local/lib for libraries, so it >won't even find your GMP 3 library at all. > > Hmm. All very mysterious. I think you'll need to send us output from ghc -v for a >link that failed and one that succeeded. > > Cheers, > Simon Here is the output: 1. Main.out from a link that succeeds. 2. GtkHelloWorld.out, a sample program from gtk+hs, compiled with ghc -v -fglasgow-exts -lgtkHS GtkHelloWorld.hs `gtkhs-config --cflags` `gtkhs-config --libs` `gtk-config --cflags` `gtk-config --libs` In fact, you are right, there is a -L/usr/lib before -lgmp. Maybe the libgmp.a included with ghc should be renamed, for example libgmp_ghc.a n.b. I send the message only to you, not to the mailing list because of the attachments. Regards, Glasgow Haskell Compiler, Version 5.02, for Haskell 98, compiled by GHC version 5.02 Using package config file: /opt/ghc/lib/ghc-5.02/package.conf Hsc static flags: -static -fignore-interface-pragmas -fomit-interface-pragmas -fdo-lambda-eta-expansion -flet-no-escape *** Checking old interface for hs = Just "Main.hs", hspp = Just "Main.hs": compilation IS NOT required *** Touching object file touch Main.o *** Linker gcc -v -o a.out -DDONT_WANT_WIN32_DLL_SUPPORT Main.o -L/opt/ghc/lib/ghc-5.02 -lHSstd -lHSstd_cbits -lHSrts -lm -lgmp -u PrelBase_Izh_static_info -u PrelBase_Czh_static_info -u PrelFloat_Fzh_static_info -u PrelFloat_Dzh_static_info -u PrelPtr_Ptr_static_info -u PrelWord_Wzh_static_info -u PrelInt_I8zh_static_info -u PrelInt_I16zh_static_info -u PrelInt_I32zh_static_info -u PrelInt_I64zh_static_info -u PrelWord_W8zh_static_info -u PrelWord_W16zh_static_info -u PrelWord_W32zh_static_info -u PrelWord_W64zh_static_info -u PrelStable_StablePtr_static_info -u PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelFloat_Fzh_con_info -u PrelFloat_Dzh_con_info -u PrelPtr_Ptr_con_info -u PrelStable_StablePtr_con_info -u PrelBase_False_closure -u PrelBase_True_closure -u PrelPack_unpackCString_closure -u PrelIOBase_stackOverflow_closure -u PrelIOBase_heapOverflow_closure -u PrelIOBase_NonTermination_closure -u PrelIOBase_BlockedOnDeadMVar_closure -u PrelWeak_runFinalizzerBatch_closure -! u __stginit_Prelude -u PrelMain_mainIO_closure -u __stginit_PrelMain Reading specs from /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/specs gcc version 2.95.3 20010315 (release) /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out -u PrelBase_Izh_static_info -u PrelBase_Czh_static_info -u PrelFloat_Fzh_static_info -u PrelFloat_Dzh_static_info -u PrelPtr_Ptr_static_info -u PrelWord_Wzh_static_info -u PrelInt_I8zh_static_info -u PrelInt_I16zh_static_info -u PrelInt_I32zh_static_info -u PrelInt_I64zh_static_info -u PrelWord_W8zh_static_info -u PrelWord_W16zh_static_info -u PrelWord_W32zh_static_info -u PrelWord_W64zh_static_info -u PrelStable_StablePtr_static_info -u PrelBase_Izh_con_info -u PrelBase_Czh_con_info -u PrelFloat_Fzh_con_info -u PrelFloat_Dzh_con_info -u PrelPtr_Ptr_con_info -u PrelStable_StablePtr_con_info -u PrelBase_False_closure -u PrelBase_True_closure -u PrelPack_unpackCString_closure -u PrelIOBase_stackOverflow_closure -u PrelIOBase_heapOverflow_closure -u PrelIOBase_NonTermination_closure -u PrelIOBase_BlockedOnDeadMVar_closure -u PrelWeak_runFinalizzerBatch_closure -u __st! ginit_Prelude -u PrelMain_mainIO_closure -u __stginit_PrelMain /usr/lib/crt1.o /usr/lib/crti.o /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtbegin.o -L/opt/ghc/lib/ghc-5.02 -L/opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3 -L/opt/gcc/lib Main.o -lHSstd -lHSstd_cbits -lHSrts -lm -lgmp -lgcc -lc -lgcc /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.3/crtend.o /usr/lib/crtn.o *** Deleting temp files Deleting: /tmp/ghc9560.s /tmp/ghc9560.hspp Warning: deleting non-existent /tmp/ghc9560.s
RE: gtk+hs and libgmp
> On Sat, 2001-10-27 at 17:27, Manuel M. T. Chakravarty wrote: > > Gérard Milmeister <[EMAIL PROTECTED]> wrote, > > > > > On Thu, 2001-10-25 at 13:53, Simon Marlow wrote: > > > > It seems very strange that the libgmp in your GHC > installation doesn't work. How did you install GHC? Do you > have problems linking other programs, or just gtk+hs programs? > > > > > > > As far as I know, it happens only with gtk+hs. Small > programs I have > > > written are linked alright. > > > > Do these small programs actually use any arbitrary precision > > arthimetic - ie, use the type Integer? > > > > Manuel > Something like this? > > module Main where > > main = print (100::Integer) > > Yes, it works. I know that gtk+hs adds a -L/usr/lib option to the command line, which comes originally from gtk-config. I'm still confused by what you said about GHC not linking with the libgmp.a in /opt/ghc, and yet it still manages to link programs using arbitrary precision integers somehow. Normally GHC won't look in /usr/local/lib for libraries, so it won't even find your GMP 3 library at all. Hmm. All very mysterious. I think you'll need to send us output from ghc -v for a link that failed and one that succeeded. Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Sat, 2001-10-27 at 17:27, Manuel M. T. Chakravarty wrote: > Gérard Milmeister <[EMAIL PROTECTED]> wrote, > > > On Thu, 2001-10-25 at 13:53, Simon Marlow wrote: > > > It seems very strange that the libgmp in your GHC installation doesn't work. >How did you install GHC? Do you have problems linking other programs, or just gtk+hs >programs? > > > > > As far as I know, it happens only with gtk+hs. Small programs I have > > written are linked alright. > > Do these small programs actually use any arbitrary precision > arthimetic - ie, use the type Integer? > > Manuel Something like this? module Main where main = print (100::Integer) Yes, it works. -- Gérard Milmeister Tannenrauchstr. 35 8038 Zürich [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
Gérard Milmeister <[EMAIL PROTECTED]> wrote, > On Thu, 2001-10-25 at 13:53, Simon Marlow wrote: > > It seems very strange that the libgmp in your GHC installation doesn't work. How >did you install GHC? Do you have problems linking other programs, or just gtk+hs >programs? > > > As far as I know, it happens only with gtk+hs. Small programs I have > written are linked alright. Do these small programs actually use any arbitrary precision arthimetic - ie, use the type Integer? Manuel ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Thu, 2001-10-25 at 13:53, Simon Marlow wrote: > It seems very strange that the libgmp in your GHC installation doesn't work. How >did you install GHC? Do you have problems linking other programs, or just gtk+hs >programs? > As far as I know, it happens only with gtk+hs. Small programs I have written are linked alright. -- Gérard Milmeister Tannenrauchstr. 35 8038 Zürich [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
> On Thu, 2001-10-25 at 12:04, Simon Marlow wrote: > > > > > The version in /opt/ghc/lib/ghc-5.02 should work, as should > /usr/local/lib/libgmp.so.3.1.1. The version in /usr/lib > looks like GMP 2, so that would cause the link errors. > > > > Make sure the link command line doesn't have -L/usr/lib on > it, or at least not before -L/usr/local/lib and > -L/opt/ghc/lib/ghc-5.02. > > > > Cheers, > > Simon > I tried to remove the libgmp.so from both /usr/local/lib and /usr/lib. > ghc doesn't seem to link with the one in /opt/ghc. Also when I give > /opt/ghc/lib/ghc-5.02/libgmp.a on the command line it doesn't > work... It > only works with /usr/local/lib/libgmp.so. I guess, that gmp is always > used, so I wonder that it works apart from gtk+hs. It seems very strange that the libgmp in your GHC installation doesn't work. How did you install GHC? Do you have problems linking other programs, or just gtk+hs programs? Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
On Thu, 2001-10-25 at 12:04, Simon Marlow wrote: > > The version in /opt/ghc/lib/ghc-5.02 should work, as should >/usr/local/lib/libgmp.so.3.1.1. The version in /usr/lib looks like GMP 2, so that >would cause the link errors. > > Make sure the link command line doesn't have -L/usr/lib on it, or at least not >before -L/usr/local/lib and -L/opt/ghc/lib/ghc-5.02. > > Cheers, > Simon I tried to remove the libgmp.so from both /usr/local/lib and /usr/lib. ghc doesn't seem to link with the one in /opt/ghc. Also when I give /opt/ghc/lib/ghc-5.02/libgmp.a on the command line it doesn't work... It only works with /usr/local/lib/libgmp.so. I guess, that gmp is always used, so I wonder that it works apart from gtk+hs. -- Gérard Milmeister Tannenrauchstr. 35 8038 Zürich [EMAIL PROTECTED] ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RE: gtk+hs and libgmp
> When trying to compile the examples in gtk+hs, I get the > following link > errors: > /opt/ghc/lib/ghc-5.02/libHSstd.a(PrelFloat__413.o): In > function `shP2_2_alt': > PrelFloat__413.o(.text+0x2b0): undefined reference to `__gmpz_cmp_si' > etc.. > When linking simple programs, this doesn't occur. > I have the following gmp's installing: > /usr/lib/libgmp.so.2.0.2 > /usr/local/lib/libgmp.so.3.1.1 > /opt/ghc/lib/ghc-5.02/libgmp.a > It seems that the programs only link with the version in > /usr/local/lib. > I tried putting this path in 'library_dirs' for package 'gmp' in > 'package.conf', but to no avail. Only when I explicitly put > '/usr/local/lib/libgmp.so' in 'extra_ld_opts' for package 'gmp' > did it work. The version in /opt/ghc/lib/ghc-5.02 should work, as should /usr/local/lib/libgmp.so.3.1.1. The version in /usr/lib looks like GMP 2, so that would cause the link errors. Make sure the link command line doesn't have -L/usr/lib on it, or at least not before -L/usr/local/lib and -L/opt/ghc/lib/ghc-5.02. Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/glasgow-haskell-users