Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Caml toplevel and readline
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: Re: [Caml-list] Caml toplevel and readline
Pierre Weis wrote:
> 
> > > ledit is a tool written in camlp4 by Daniel de Raglaudre
> > > which allows line editing on any program.
> > >   http://cristal.inria.fr/~ddr/index-english.html
> >
> >       I've tried that and couldn't get it to work.
> > That goes for about half the C/Ocaml packages I've tried,
> > including, of all things, CamlImages.
> [...]
> > John (Max) Skaller, mailto:skaller@maxtal.com.au
> 
> Hi Max,
> 
> This is really a pity you've found half the Ocaml packages you've
> tried broken and impossible to install. I'm very sorry for that and I
> consider it a shame for us, as we consider ourselves as highly
> competent professionals ...

	Please note I said Ocaml/C packages. And I was NOT
refering to INRIA distributions particularly, but generally
available packages including those from third parties.

	Above it is said ledit is writtin in camlp4,
another package I've had trouble installing. I'm now using
the CDK release of Ocaml. Perhaps that comes bundled with p4:

root@pelican] ~/ledit/ledit-1.8>make
ocamlc -pp "camlp4r pa_extend.cmo q_MLast.cmo" -I `camlp4 -where` -c
pa_local.ml/bin/sh: camlp4: command not found
sh: camlp4r: command not found
Preprocessing error
make: *** [pa_local.cmo] Error 2

	No, it looks like it doesn't. So I build camlp4 (no problems).
Now I can build ledit (although it isn't clear that I should
run 'make install' to use it). I try 

	ledit ocaml

and I have line editing. So this time, I have no problems with
either camlp4 or ledit.

> Also for CamlImages, please report us your problems, we will help you
> and fix the library for everybody.

	OK. I try again. The .configure summary is surprising:

Language: ocaml version 3.01
Installed in: /usr/local/lib/ocaml/camlimages
External libraries: bmp png jpeg tiff xpm ps
Lablgtk: Not found

No Lablgtk? Hmm. I have gtk. (My WM is Enlightenment :-)

OK, try the make:

ocamlc  -I corelib -I ppm -I jpeg -I tiff -I bmp -I gif -I png -I xpm -I
xvthumb -I ps -I graphics -I freetype  -c corelib/camlimages.ml
File "corelib/camlimages.ml", line 24, characters 0-3:
Syntax error
make: *** [corelib/camlimages.cmo] Error 2

Oops. Without even looking, the code is probably using pre 3.01 syntax.
I'll check. Here's the file:

(* Supported libraries *)
let lib_gif = false
let lib_png = true
let lib_jpeg = true
let lib_tiff = true
let lib_freetype = 
let lib_ps = true

(* External files *)
let path_rgb_txt = "/usr/X11R6/lib/X11/rgb.txt"
let path_gs = "/usr/bin/gs"

(* They are written in ML, so always supported *)
let lib_ppm = true
let lib_bmp = true
let lib_xvthumb = true

(* Word size, used for the bitmap swapping memory management *)
let word_size = 4 


Well, the error isn't where the compiler says it is,
but the file is small, and the bug is easy to spot:
the line

	lib_freetype =

should have 'false' as the value, not a blank. I'll edit it.
OK, now it compiles. Try the test as indicated in the INSTALL notes:

>root@pelican] ~/camlimages-1.02/test>make test
ocamlc  -custom -I ../corelib -I ../gif -I ../jpeg -I ../tiff -I ../bmp
-I ../ppm -I ../png -I ../graphics -I ../freetype -I ../xpm -I
../xvthumb -I ../ps -cclib "-L../corelib -L../gif -L../jpeg -L../tiff
-L../png -L../freetype -L../xpm" img.cma graphics.cma graphic_image.cma
freetype.cma gif_img.cma jpeg_img.cma tiff_img.cma bmp_img.cma
ppm_img.cma png_img.cma xvthumb_img.cma xpm_img.cma ps_img.cma -o test
test.ml
/tmp/cc5Dv2bQ.o(.data+0x3c4): undefined reference to
`set_Instance_PixelSizes'
/tmp/cc5Dv2bQ.o(.data+0x3e4): undefined reference to
`get_Big_Glyph_Metrics'
/tmp/cc5Dv2bQ.o(.data+0x3f8): undefined reference to `get_Outline_BBox'
/tmp/cc5Dv2bQ.o(.data+0x3fc): undefined reference to
`get_Face_Properties'
/tmp/cc5Dv2bQ.o(.data+0x400): undefined reference to
`get_Outline_Contents'
collect2: ld returned 1 exit status
Error while building custom runtime system
make: *** [test] Error 2

Hmmm. I know nothing about building runtimes: I use the 
optimising compiler exclusively. 

> Last, please feel free to publicly cite in this mailing list the name
> of all the bogous libraries you've ever found in the INRIA
> distributions or Web sites. We'll be glad to hear about that and then
> to fix the faulty programs, or even remove them from our distributions
> if they are too bogous to be fixed.
> 
> Thank you for helping us to fix our bogous software.

Sigh. I am now using Ocaml to produce software I want other
people to use. I also happen to be using a literate
programming tool written in Python.

I am going to have to ask developers to

	a) download and install Python
	b) download and install interscript
	c) download and install Ocaml
	d) download and install any other third party
		packages I might be using
	e) download and install Felix
	f) download and install Boost (a public set of C++ libraries)

Luckily, Felix is a 'pure Ocaml' program: it only
includes a couple of minor hacks that might be
platform dependent, so at present, I probably don't
need anything under item (d).

I provide python scripts to build Felix -- but they'll
probably only work under Linux, and probably only
on my box. I'm going to have enough trouble making
everything work on other platforms (esp. Windows)
-- assuming the tool chain above is all correctly
installed.

So when people say 'use ledit' I have to ask:
Why should I have to? Why isn't this functionality
standard? 

Basically, I can't use Ocamlp4 in my project,
because it adds yet another step into the tool chain.
It looks frightening enough already. 

I do understand that Ocaml is basically a research project.
And it is a superb package for production use as well,
a rare combination! And I'm really happy that there is now
a comprehensive compilation of third party libraries,
(CDK) so that it is possible that step (d) above
can be kept empty.

-- 
John (Max) Skaller, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr