caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Török Edwin" <edwintorok@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Running ocaml programs on Windows
Date: Sun, 11 Sep 2011 16:46:57 +0300	[thread overview]
Message-ID: <4E6CBBD1.2000805@gmail.com> (raw)
In-Reply-To: <sympa.1315746812.597.143@inria.fr>

On 2011-09-11 16:35, jocelyn.serot@univ-bpclermont.fr wrote:
> Hello,
> 
> This may be a trivial question for people working on multiple platforms but,
> having worked for a long time only on Unix-like platforms (including Mac OS X),
> i'm a bit puzzled..
> 
> What is the "best" (simplest both for the programmer and, most importantly, the
> end user) way to develop a program in Ocaml in order to distribute it to people
> having only MS Windows platforms ? 
> 
> Is it possible to cross-compile (from what i've read, no)  ?

mingw32-ocaml can cross-compile, Debian and Fedora includes it.
You'll need to cross-compile all the OCaml (and native) libs you use though (Fedora might provide pre-cross-compiled libs, not sure).

Unfortunately there doesn't seem to be an easy way to cross-compile for Win64 in Debian
(might be possible if an mingw-w64-ocaml package is created based on mingw-w64), but 32-bit
executables run just there too.

> 
> Do i have to install a ocaml distribution on a machine running windows, compile
> my program with the installed tools (ocamlc/ocamlopt) and distribute the
> resulting .exe ?

That'd work of course, but you have the inconvenience of booting windows everytime.

> 
> Aux question : In the Unix version, arguments are passed on the command line. I
> understand that the same can be done under Windows using some kind of "shell"
> (under Cygwin). But this may be disruptive to many Windows users who are used
> to the "click to launch" approach. Is there some kind of tool that could
> automatically wrap a command-line-based app into a click-to-launch app (with
> some additionnal pop-ups to enter arguments for ex) ? 

Not that I know of, but one could be written using ocaml-win32 (or lablgtk).
Is your app purely console based otherwise, or does its Unix version have a GUI?

> 
> Sorry if these questions sound trivial but despite a long experience in Ocaml
> programming (>15 yrs), i've never been exposed to sw dev under windows (in fact
> i deliberately avoid this terrain ;) 
> 
> Btw, for those interested, the program i'm trying to port is a compiler
> generating VHDL code for FPGAs from high-level actor-dataflow descriptions
> (more info here :
> http://wwwlasmea.univ-bpclermont.fr/Personnel/Jocelyn.Serot/caph.html).
> For the moment, i'm distributing a bytecode but this requires the target
> audience to have a ocaml distrib installed on their machine (which, from
> experience, most of them view it as an hindrance). 

Does that mean that you don't use 3rdparty libs, or only use
ones that can be compiled to pure bytecode (without native code)?
If so cross-compiling with mingw32-ocaml should work fairly well.

Another alternative would be to distribute ocamlrun.exe alongside your program.

Best regards,
--Edwin

  reply	other threads:[~2011-09-11 13:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 13:35 jocelyn.serot
2011-09-11 13:46 ` Török Edwin [this message]
     [not found]   ` <987A8AE7-1A72-4C79-A0E2-1C1413B26E16@wanadoo.fr>
     [not found]     ` <4E6CC8C8.9030001@gmail.com>
2011-09-11 16:41       ` Jocelyn Sérot
2011-09-11 18:07 ` Dmitry Grebeniuk

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=4E6CBBD1.2000805@gmail.com \
    --to=edwintorok@gmail.com \
    --cc=caml-list@inria.fr \
    /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).