GHC and GLUT

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

GHC and GLUT

Wolfgang Jeltsch
Hello,

I just wanted to compile the Gears example from the HOpenGL's GLUT source but
it didn't work.  I got the following messages:

        Chasing modules from: Gears.hs
        Compiling Main             ( Gears.hs, Gears.o )
        Linking ...
        /usr/bin/ld: cannot find -lSM
        collect2: ld returned 1 exit status

I use Debian GNU/Linux 3.1 (sarge) and have the following packages installed:

        ghc6 (6.2.2-3)
        ghc6-hopengl (6.2.2-3)
        ghc6-prof (6.2.2-3)

Anyone who can help me?

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Jared Updike
>         Linking ...
>         /usr/bin/ld: cannot find -lSM
>         collect2: ld returned 1 exit status

I've had GHC (ld actually) die for similar things like "cannot find
-lgmp". Here is how I fixed it.

Make sure you have libSM, the X Session Management Library, and make
sure that it is in a place where ld looks. You can usually test what
ld (the linker) sees by typing "ldconfig -p | grep -i libsm" for
example, to see if it knows about libsm and what it calls it.

You can then symlink ("ln -s ...") the right libraries if they exists
but have the wrong name (for example, libsm-xyz.a instead of plain
libsm.a) If you don't have libsm somewhere on you system, try using
aptitude, synaptic or apt-get to add libSM; if that doesn't work, you
may need the development libs/include files, as I had happen to me
once for some other library I forget at the moment...

Good luck,
  Jared.

--
[hidden email]
http://www.updike.org/~jared/
reverse ")-:"
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Wolfgang Jeltsch
In reply to this post by Wolfgang Jeltsch
Am Freitag, 6. Januar 2006 21:13 schrieb Wolfgang Jeltsch:

> Hello,
>
> I just wanted to compile the Gears example from the HOpenGL's GLUT source
> but it didn't work.  I got the following messages:
>
> Chasing modules from: Gears.hs
> Compiling Main             ( Gears.hs, Gears.o )
> Linking ...
> /usr/bin/ld: cannot find -lSM
> collect2: ld returned 1 exit status
>
> I use Debian GNU/Linux 3.1 (sarge) and have the following packages
> installed:
>
> ghc6 (6.2.2-3)
> ghc6-hopengl (6.2.2-3)
> ghc6-prof (6.2.2-3)
>
> Anyone who can help me?
>
> Best wishes,
> Wolfgang

I tried it now with the haskell-unsafe backports:

        ghc6 (6.4.1-1~stable)
        ghc6-hopengl (6.4.1-1~stable)
        ghc6-prof (6.4.1-1~stable)

Alas, the same problem.

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Wolfgang Jeltsch
In reply to this post by Wolfgang Jeltsch
Am Freitag, 6. Januar 2006 21:24 schrieb Mark T.B. Carroll:
> Does installing the libsm-dev package help?
>
> -- Mark

Thank you, Mark and Jared.

Installing the libsm-dev package resulted in ld outputting a similar error
message for -lXmu.  After also installing libxmu-dev, linking was possible.

Are libsm-dev and/or libxmu-dev needed for every Haskell GLUT application or
just for certain examples?  If they are always needed, some package has not
declared all its dependencies.  In this case, which package is the one with
the dependency declaration bug?

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Wolfgang Jeltsch
In reply to this post by Wolfgang Jeltsch
Hello again,

now that I had installed libsm-dev and libxmu-dev, building a Gears binary
worked well.  Since the problem didn't seem related to the GHC version, I
deinstalled the GHC backports and installed GHC from sarge again which is
6.2.2.

However, with GHC 6.2.2 I got these error messages during compiling Gears.hs:

        /tmp/ghc10821.hc: In function `sfcm_ret':
        /tmp/ghc10821.hc:1098: warning: assignment discards qualifiers from pointer
        target type
        /tmp/ghc10821.hc: In function `sfcf_ret':
        /tmp/ghc10821.hc:1216: warning: assignment discards qualifiers from pointer
        target type
        /tmp/ghc10821.hc: In function `sfc8_ret':
        /tmp/ghc10821.hc:1334: warning: assignment discards qualifiers from pointer
        target type
        /tmp/ghc10821.hc: In function `Main_info_entry':
        /tmp/ghc10821.hc:1443: warning: assignment discards qualifiers from pointer
        target type

What does this have to say?

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Glynn Clements
In reply to this post by Wolfgang Jeltsch

Wolfgang Jeltsch wrote:

> > Does installing the libsm-dev package help?
> >
> > -- Mark
>
> Thank you, Mark and Jared.
>
> Installing the libsm-dev package resulted in ld outputting a similar error
> message for -lXmu.  After also installing libxmu-dev, linking was possible.
>
> Are libsm-dev and/or libxmu-dev needed for every Haskell GLUT application or
> just for certain examples?  If they are always needed, some package has not
> declared all its dependencies. In this case, which package is the one with
> the dependency declaration bug?

GLUT uses XmuLookupStandardColormap from libXmu. libXmu requires
libXt, which in turn requires libSM.

As that's the only Xmu function which GLUT uses, I would have thought
that it would be worth making the effort to remove that particular
dependency from GLUT.

Insofar as it's a bug, it's in the dependency list for GLUT.
Ultimately, the correct dependency list for the Haskell GLUT package
is "GLUT, plus whatever GLUT happens to require on your particular
system". But I don't know whether the dependency list can be generated
dynamically.

--
Glynn Clements <[hidden email]>
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Ian Lynagh
In reply to this post by Wolfgang Jeltsch
On Fri, Jan 06, 2006 at 10:12:34PM +0100, Wolfgang Jeltsch wrote:
>
> Installing the libsm-dev package resulted in ld outputting a similar error
> message for -lXmu.  After also installing libxmu-dev, linking was possible.
>
> Are libsm-dev and/or libxmu-dev needed for every Haskell GLUT application or
> just for certain examples?  If they are always needed, some package has not
> declared all its dependencies.  In this case, which package is the one with
> the dependency declaration bug?

ghc6-hopengl; It's already fixed in unstable.


Thanks
Ian

_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Wolfgang Jeltsch
In reply to this post by Glynn Clements
Am Freitag, 6. Januar 2006 22:48 schrieben Sie:
> Wolfgang Jeltsch wrote:
> [...]

> > Are libsm-dev and/or libxmu-dev needed for every Haskell GLUT application
> > or just for certain examples?  If they are always needed, some package
> > has not declared all its dependencies. In this case, which package is the
> > one with the dependency declaration bug?
>
> GLUT uses XmuLookupStandardColormap from libXmu. libXmu requires
> libXt, which in turn requires libSM.
>
> As that's the only Xmu function which GLUT uses, I would have thought
> that it would be worth making the effort to remove that particular
> dependency from GLUT.
>
> Insofar as it's a bug, it's in the dependency list for GLUT.
> Ultimately, the correct dependency list for the Haskell GLUT package
> is "GLUT, plus whatever GLUT happens to require on your particular
> system". But I don't know whether the dependency list can be generated
> dynamically.

If the ordinary C GLUT has the libXmu dependency, the dependency bug is in the
C GLUT Debian packages not in ghc6-hopengl.

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell
Reply | Threaded
Open this post in threaded view
|

Re: GHC and GLUT

Wolfgang Jeltsch
In reply to this post by Wolfgang Jeltsch
Am Montag, 9. Januar 2006 10:56 schrieb Axel Simon:

> On Fri, 2006-01-06 at 22:37 +0100, Wolfgang Jeltsch wrote:
> > Hello again,
> >
> > now that I had installed libsm-dev and libxmu-dev, building a Gears
> > binary worked well.  Since the problem didn't seem related to the GHC
> > version, I deinstalled the GHC backports and installed GHC from sarge
> > again which is 6.2.2.
> >
> > However, with GHC 6.2.2 I got these error messages during compiling
> > Gears.hs:
> >
> > /tmp/ghc10821.hc: In function `sfcm_ret':
> > /tmp/ghc10821.hc:1098: warning: assignment discards qualifiers from
> > pointer target type
> > /tmp/ghc10821.hc: In function `sfcf_ret':
> > /tmp/ghc10821.hc:1216: warning: assignment discards qualifiers from
> > pointer target type
> > /tmp/ghc10821.hc: In function `sfc8_ret':
> > /tmp/ghc10821.hc:1334: warning: assignment discards qualifiers from
> > pointer target type
> > /tmp/ghc10821.hc: In function `Main_info_entry':
> > /tmp/ghc10821.hc:1443: warning: assignment discards qualifiers from
> > pointer target type
> >
> > What does this have to say?
>
> You probably already got an answer. It's to do with const modifiers that
> ghc cannot produce correctly since FFI declarations do not take const
> modifiers. There was a discussion about this, but all solutions were too
> intrusive with respect to the net gain (removing some warnings).

So the warnings are harmless?  But why don't they occur with GHC 6.4?

> Axel.

Best wishes,
Wolfgang
_______________________________________________
Haskell mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell