caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Adrien Nader <adrien@notk.org>
To: Jonathan Protzenko <jonathan.protzenko@gmail.com>
Cc: Bikal Gurung <bikal.gurung@lemaetech.co.uk>,
	caml-list@inria.fr, David Allsopp <dra-news@metastack.com>
Subject: Re: [Caml-list] Ocaml on windows
Date: Mon, 24 Jun 2013 19:18:30 +0200	[thread overview]
Message-ID: <20130624171830.GA32244@notk.org> (raw)
In-Reply-To: <51C81B39.8040400@gmail.com>

Hi,

On Mon, Jun 24, 2013, Jonathan Protzenko wrote:
> On Mon 24 Jun 2013 12:01:06 PM CEST, Bikal Gurung wrote:
> > Hi David,
> >
> > Thank you for your response. I have installed the official windows
> > port of ocaml at http://protz.github.io/ocaml-installer/ . However, it
> > mentions that MinGW/Msys is no longer supported. I rather use
> > Mingw/Msys as well.
> There are quite a few things that make working with msys painful, which 
> is the reason why I switched the installer to cygwin. The installer 
> still is a 32-bit native windows program, and still generates 32-bit 
> native windows programs. It's just that cygwin is an easy way to get a 
> toolchain and a unix-like development environment, which ocaml kind of 
> needs in order to work right (without it, you only get bytecode 
> compilation).
> - The main problem is that OCaml is, by default, configured to search 
> executables from the toolchain with the i686-pc-mingw-whatever prefix, 
> that is, the one that the mingw-w64 compilers have, when installed 
> through cygwin.
> - The second biggest problem is with flexdll which, IIRC, hardcodes the 
> use of the mingw-w64 compilers (32-bit compilers from the mingw-w64 
> project). Msys, on the other hand, uses the mingw compilers (the 
> original mingw project), and the location of the libraries / 
> executables is slightly different, or maybe flexdll doesn't auto-detect 
> the right locations for crt2.o and friends, meaning it's painful as you 
> have to manually export FLEXLINKFLAGS. At some point, it became almost 
> impossible to have that combination working. I think flexdll started to 
> hardcode the i686-pc-mingw prefix at some point, and there's no 
> ready-made, easy to install mingw-w64/msys bundle available, as far as 
> I know.

Well, msys doesn't really require one toolchain or another: you can have
mingw-w64 (either i686-w64-mingw32 or x86_64-w64-mingw32) with msys
afaik.
However msys comes from mingw.org which is the "main" site for
i686-pc-mingw32 so that doesn't make things very balanced.

Note that there is a very recent "MSYS2" project which is updated in
pretty much every respect (newer GCC, forked from a newer Cygwin which
has 64b support, ...). It's very very recent and might become a variant
of cygwin but so far there are differences in the behaviour wanted from
it compared to cygwin which means that having the two of them merged
will involve some work and discussions.

> - OCamlbuild relies on bash being available in the path to run its 
> external commands ; an easy way to have this is to have a cygwin 
> development environment. This is a know issue that no one has stepped 
> up to fix on windows.

Cygwin, or msys.

However with msys you need bash and coreutils (ocamlbuild uses "cp" in a
few places for instance, but that's trivial to fix) and all the deps
(regex, termcap, and several others).
An "easy" way to install msys would probably be mingw-get from
mingw.org, which for its default repos would use the toolchain from
mingw.org too (fun stuff).

Btw, the issue is that windows' exec*() functions take an array of
strings, then merges all these strings and had that new string to the
process on startup. This means that in order to have the arguments split
as you had hoped them to be, you need to apply some rules (which I don't
have at hand right now).

Generally speaking, I'd like to have some more code in mingw-w64 to
alleviate the need for bash.

> - Finally, the quoting conventions, IIRC, are subtly different between 
> mingw/msys and cygwin, and OCaml is tailored to cygwin.

Can you elaborate on that? I've used msys for ocaml in the past and
haven't had issues.

-- 
Adrien Nader

  parent reply	other threads:[~2013-06-24 17:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-24  9:07 Bikal Gurung
     [not found] ` <E51C5B015DBD1348A1D85763337FB6D9CC8677FE@Remus.metastack.local>
2013-06-24 10:01   ` Bikal Gurung
2013-06-24 10:11     ` Jonathan Protzenko
2013-06-24 12:10       ` Malcolm Matalka
2013-06-24 17:18       ` Adrien Nader [this message]
2013-06-25  8:40     ` David Allsopp
2013-06-26 18:17       ` Adrien Nader
2013-06-26 19:55         ` David Allsopp
2013-06-24 17:21 ` Adrien Nader
2013-06-24 20:16   ` AW: " Gerd Stolpmann
2013-06-26 18:29     ` Adrien Nader
2013-06-26 18:46       ` Wojciech Meyer
     [not found] <20130626113838.0643281793@sympa.inria.fr>
2013-06-26 12:02 ` r.3
2013-06-26 17:45   ` Bikal Gurung
2013-06-26 17:55     ` David Allsopp
2013-06-26 18:07       ` Bikal Gurung
2013-06-26 18:28         ` Wojciech Meyer
2013-06-26 18:12       ` Adrien Nader
2013-06-26 19:54     ` Alain Frisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130624171830.GA32244@notk.org \
    --to=adrien@notk.org \
    --cc=bikal.gurung@lemaetech.co.uk \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.com \
    --cc=jonathan.protzenko@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).