ghc, FFI and autotools

Lloyd Allison Lloyd.Allison at infotech.monash.edu.au
Fri Nov 21 22:49:43 EST 2003


We are trying to build and call some Haskell code
in and from from the open-src spreadsheet "gn'meric".
It seems that it could be a good basis for experiments in FP + SSs.

We have worked through the simple FFI examples and
can create small C+Haskell stand-alone programs.

However, gnu'eric is quite a large program
and  autoconf|automake|...|libtools  are used to build it.
Consequently one does not have an entirely free hand
to just compile and link the pieces in any old way.
It has to fit in with the general build scheme.

There is a general pattern to 'eric's "plugins":
add a directory, e.g.

  ...../plugins/haskell/Makefile.am    --->Mafilefile.in--->Makefile
                       /functions.c    -- the plugin's code
                       /....

and we can make C-only plugins.

The next step, or "impasse" to give it the technical name, is to add

                       /functionsH.hs  -- Haskell called from functions.c


 ? Please has anybody used ghc in this type of environment before, and
 ? have advice on the exercise in general or on
 ? creating a *shared library* from C + Haskell code in particular ?


We[*] have tried a few things, so far with less than complete success,
and often featuring undefined labels,-( e.g.
  E Unable to open module file "/home/lloyd/gnumeric/install//lib/gnumeric/1.2.1-bonobo/plugins/haskell/plugin.la".
  E /home/lloyd/gnumeric/install//lib/gnumeric/1.2.1-bonobo/plugins/haskell/plugin.so: undefined symbol: GHCziInt_I8zh_con_info


Lloyd
--
Lloyd ALLISON,  CSSE, Monash University, Victoria, Australia 3800.
web: http://www.csse.monash.edu.au/~lloyd/    tel: +61 3 9905 5205
use: http://www.linux.org/  OpenOffice: http://www.openoffice.org/
PS. [*] Not a royal we.



More information about the Haskell mailing list