English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Yet Another Compilation Question: lablgtk for windows + cygwin-mingw
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-05 (14:40)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Yet Another Compilation Question: lablgtk for windows + cygwin-mingw
> I'm keep trying compiling ocaml to be able to produce optimized code.
> When I try to configure lablgtk, it complains about not to find
> gtk-config. I know there is such an executable under linux, but I
> couldn't find this for the cygwin environment.
> While reading the manual, I realized, that I cannot exactly know what is
> the difference between cygwin and mingw, because the mingw compilation
> needs cygwin. My idea is to provide fallbacks for some utility, which
> doesn't exists for mingw.

I can't help you with the GTK issues, but let me try to clarify the
Mingw/Cygwin issue.  Mingw, at least as we use it in OCaml, is just an
option on the Cygwin compilers and tools that instruct them to
generate executables that do not depend on the Cygwin DLLs, but use
standard Microsoft libraries instead.  However, it is still possible,
and indeed recommended, to use the full Cygwin development environment
to build those Cygwin-free executables.  Think of it as a
cross-compiler: from within the Cygwin environment, you generate
executables that can run without the Cygwin environment.

So, I think there is no need to "provide fallbacks for some
utilities", at least if these utilities are used only during the build
process: just install the full Cygwin environment and be done with it.

> And I don't understand why cygwin compiled
> code is faster, because such tiny utilities like grep, sed, awk runs
> _VERY_ slowly on my Duron.

Yes, file accesses are a bit slow under Cygwin, due to the Unix
emulation layer they have to cross.  The OCaml bytecode interpreter is
faster than in the native Win32 port, though, because it is compiled
by gcc and takes advantage of gcc-specific tricks.

> The distributed binary ocaml version is for MSVC, am I right?


> Can I hack this version to use my mingw-gcc compiler?

No.  To install the Mingw version of OCaml, you need to compile OCaml
from sources.  

One last, general comment.  (Climbing on my soapbox.)  The GNU
compilers, OCaml, GTK. lablgtk, etc, are all software projects that
are developed primarily under Unix, and then ported to Windows.  While
each of these ports are done carefully and with considerable ingenuity,
Windows is not Unix and minor differences or inconsistencies remain in
each port.  These minor issues are usually workable when you use only
one port, but can become a real headache when you pile up port over
port over port.  What I am coming at is that unless you like to suffer
and are ready to solve these issues yourself, it doesn't make much
sense to develop an OCaml+lablgtk+GTK program under Windows.  

Hope this helps,

- Xavier Leroy
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners