Yann Morvan | 5 May 01:07 2004
Picon
Picon

GHC 6.2.1 Binding Completeness

Hello,
I am doing the implementation for my computer graphics research project in
Haskell, I recently installed the last version of GHC (6.2.1) that comes
with the new OpenGL binding. I was just starting to port my code to it,
but I have trouble finding some basic functionnalities (like glTexImage2D for 
instance).
Is that binding incomplete ? If yes when will it be finished ?
If no when will the redbook examples be ported to it ?
I am reduced to greping the code of the binding for calls to the C openGL
functions and suspect that I am missing things.
Thank you very much for your help,

	Yann Morvan 
Sven Panne | 5 May 18:24 2004
Picon

Re: [HOpenGL] GHC 6.2.1 Binding Completeness

[ I'm cross-posting this, perhaps some kind soul has binary snapshots available. ]

Yann Morvan wrote:
> [...] I recently installed the last version of GHC (6.2.1) that comes
> with the new OpenGL binding. I was just starting to port my code to it,
> but I have trouble finding some basic functionnalities (like glTexImage2D for 
> instance). Is that binding incomplete ?

Alas, no, the OpenGL binding on the release branch is not complete.

> If yes when will it be finished ? If no when will the redbook examples be ported to it ?

The story is quite a bit different on the main branch, the binding is almost
finished there, you get OpenGL 1.5 plus a few dozen extensions. The only missing
bit is currently NURBS, but it's already halfway there. We generally don't
merge new features onto the release branch, only bug fixes, hence the difference.

Currently there are "official" releases including this, but if you can tell a
bit about your intended platform, perhaps somebody else on the GHC/Hugs mailing
lists can help (Linux, WinDoze, MacOS X and Solaris reportedly work). I can offer
bleeding edge snapshots of Hugs and GHC including the latest and greatest OpenGL/GLUT
binding compiled for x86 Linux (SuSE 9.1, don't know if the RPMs work on other platforms).

Another option is building GHC and/or Hugs from CVS for yourself, which is not
that hard nowadays (at least if you have enough GB and GHz :-), see:

    http://haskell.org/ghc/docs/latest/html/building/building-guide.html

> I am reduced to greping the code of the binding for calls to the C openGL
> functions and suspect that I am missing things.
(Continue reading)

Hugh Rayner | 15 May 04:32 2004
Picon
Picon

Textures in Haskell OpenGL

Hi, I'm using ghc OpenGL on a MacOS X box,
and everything is working fine,
except that I have no idea 
how to load textures,
and I can't find any examples anywhere on the internet
that load textures except ones using the old API.

Does anyone have an example I could look at?
Sven Panne | 15 May 17:54 2004
Picon

Re: Textures in Haskell OpenGL

Hugh Rayner wrote:
> Hi, I'm using ghc OpenGL on a MacOS X box,

Which Haskell system are you using exactly (GHC or Hugs? Which version? Did you
build it for yourself?)

> and everything is working fine,
> except that I have no idea 
> how to load textures,

Alas, the OpenGL binding shipped with GHC 6.2.1 (built from GHC's STABLE CVS branch)
doesn't support any texturing.

> and I can't find any examples anywhere on the internet
> that load textures except ones using the old API.
> 
> Does anyone have an example I could look at?

The main branch of the fptools CVS repository, where the next major versions of GHC,
Hugs and NHC get their libraries from, has complete support for OpenGL 1.5 (only NURBS
support is still missing). All texturing examples from the Red Book have been ported,
too, I've attached a few to this mail to provide a feeling of the "flavour" of the
binding. Haddock docs of the libraries in the main branch are available at:

    http://haskell.org/HOpenGL/newAPI/

I don't have access to a MacOS box, so I can't provide you with a binary snapshot
of the bleeding edge versions of GHC and/or Hugs. Perhaps somebody on this list
can help (Wolfgang?). Another route would be building GHC and/or Hugs for yourself,
just add "--enable-hopengl" at the configuration stage. Perhaps the stuff at
(Continue reading)

Weeble | 18 May 18:30 2004

Compiling HOpenGL under recent versions of GHC

Hi there,
    I just recently installed Gentoo Linux with the intention of using 
HOpenGL. Unfortunately I'm having problems compiling - something seems 
to use a "_casm_" directive (I think) and GHC complains that this isn't 
valid. So far as I can tell it was removed from the language a while 
ago. Anyway, is this an expected problem or have I misconfigured 
something? If this isn't a known problem I'll try again and carefully 
document what I do. Thanks.

Regards,
    Weeble.
Sven Panne | 18 May 19:25 2004
Picon

Re: Compiling HOpenGL under recent versions of GHC

[ I've CC'd to Andres as his function(?) as the GHC Gentoo maintainer/packager. ]

Weeble wrote:
>    I just recently installed Gentoo Linux with the intention of using 
> HOpenGL. Unfortunately I'm having problems compiling - something seems 
> to use a "_casm_" directive (I think) and GHC complains that this isn't 
> valid. [...]

It looks like you're using one of the old versions (1.0x) of HOpenGL from
http://haskell.org/HOpenGL, which are not supported anymore. The development
takes place in the fptools CVS repository now, so GHC, Hugs and NHC can use
it more easily. I don't know much about Gentoo Linux, but it looks like that
there is a GHC 6.2.1 in dev-lang/ghc. This is almost what you want... :-) It
already contains some basic OpenGL functionality, but being on a release branch,
it doesn't have all the features of the CVS main branch (full OpenGL 1.5 support
apart from NURBS, API docs at http://haskell.org/HOpenGL/newAPI/). So you are
basically left with 2 options:

    * Wait for the official release of GHC 6.4, but this will probably take some time.

    * Build GHC from the CVS main branch or the nightly snapshots (available at
      http://www.haskell.org/ghc/dist/current/dist/). I've got no idea how to do
      this via the ebuild system, but perhaps Andres Loeh can help. He seems to
      be the maintainer/packager for GHC on Gentoo.

If you can live without a properly packaged GHC version, simply doing things by
hand is not that hard nowadays (given that you have sufficiently recent versions
of Alex, Happy and Haddock installed):

    cd fptools   (or whatever the toplevel directory is called)
(Continue reading)

Andres Loeh | 18 May 20:08 2004
Picon

Re: Compiling HOpenGL under recent versions of GHC

> [ I've CC'd to Andres as his function(?) as the GHC Gentoo 
> maintainer/packager. ]

>    * Build GHC from the CVS main branch or the nightly snapshots (available 
>    at
>      http://www.haskell.org/ghc/dist/current/dist/). I've got no idea how 
>      to do
>      this via the ebuild system, but perhaps Andres Loeh can help. He seems 
>      to
>      be the maintainer/packager for GHC on Gentoo.

I have a ghc-cvs ebuild for personal use which I can share.

http://dev.gentoo.org/~kosmikus/ghc-cvs-6.3.ebuild

You can download the ebuild, place it in your local portage overlay,
for instance in /usr/local/dev-lang/ghc, create a digest, and then
emerge it to build an up-to-date ghc from cvs.

Please note that I do not officially support this build, so if you
have problems, please do not write bug reports to Gentoo, but ask me
personally.

There's a small problem even then:

Just a few days ago, I wanted to test HOpenGL for something and
noticed the following (which happens both with the CVS version and
with 6.2.1): 

$ ghci-cvs -package OpenGL
(Continue reading)

Sven Panne | 18 May 22:20 2004
Picon

Re: Compiling HOpenGL under recent versions of GHC

Andres Loeh wrote:
> [...] There's a small problem even then:
> 
> Just a few days ago, I wanted to test HOpenGL for something and
> noticed the following (which happens both with the CVS version and
> with 6.2.1): 
> 
> $ ghci-cvs -package OpenGL
>    ___         ___ _
>   / _ \ /\  /\/ __(_)
>  / /_\// /_/ / /  | |      GHC Interactive, version 6.3, for Haskell 98.
> / /_\\/ __  / /___| |      http://www.haskell.org/ghc/
> \____/\/ /_/\____/|_|      Type :? for help.
> 
> Loading package base ... linking ... done.
> Loading package OpenGL ... ghc-6.3: can't load .so/.DLL for: GLU
> (/usr/lib/libGLU.so: undefined symbol: glPixelStorei)
> 
> I noticed that a similar problem has been discussed a while ago on the
> hopengl mailing list, and according to that thread, I found a
> solution, namely to edit ghc's package.conf file and to make sure
> that -lGL comes before -lGLU in extra_ld_opts. [...]

*sigh* This seems to be a NeverEnding Story (tm)...  :-P  It works fine on my
SuSE x86 Linux (8.2 and 9.1) Just to be sure: What exactly does work and what
doesn't on Gentoo?

    * Building an executable using OpenGL with GHC 6.2.1
    * Calling ghci (6.2.1) with "-package OpenGL"
    * and the same two tests with the current CVS HEAD
(Continue reading)

Sven Panne | 18 May 22:34 2004
Picon

Re: Compiling HOpenGL under recent versions of GHC

I wrote:
> [....] Meanwhile I'll try to dig out a few old emails on this topic. [...]

I've found the relevant thread on this mailing list:

    http://www.haskell.org//pipermail/hopengl/2003-December/000459.html

In a nutshell: It seems to be the case that the OpenGL-related dynamic libs
on Gentoo are broken, they are probably missing some dependency information.
Could you confirm this?

Cheers,
    S.
Andres Loeh | 18 May 23:49 2004
Picon

Re: Compiling HOpenGL under recent versions of GHC

> I wrote:
> >[....] Meanwhile I'll try to dig out a few old emails on this topic. [...]
> 
> I've found the relevant thread on this mailing list:
> 
>    http://www.haskell.org//pipermail/hopengl/2003-December/000459.html
> 
> In a nutshell: It seems to be the case that the OpenGL-related dynamic libs
> on Gentoo are broken, they are probably missing some dependency information.
> Could you confirm this?

Thanks for the pointer -- I had seen some other thread, but not this
one. The dependencies still seem to be "broken" in Gentoo, but
apparently SuSE also patches, so it's really broken somewhere else.

So, if I understand the situation correctly: reversing the library
order in package.conf may work for ghci, and might not do any further
harm under Linux at all, but generally is not a good solution because
it breaks compilation on some other platforms. Therefore it would be
better to integrate the dependencies between the libararies properly
into the .so files.

How that can be done, I have no clue -- I really am no C programmer;
but you gave the hint with the SuSE source rpm, so I have a place to
start.

I will try to investigate further ...

Andres
(Continue reading)


Gmane