From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p8BDl6NH017210 for ; Sun, 11 Sep 2011 15:47:06 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnECAP66bE7RVaE2kGdsb2JhbABBhFWUb4gXhjYIFAEBAQEJCQ0HFAQigVIBAQEBAgESAg8dARscAgMMBgULDQICBRYLAgIJAwIBAgEREQEFAQ4BDRMGAgIeh1UCApoDCop+QoJXg187iG0CAwaBJoQxgREEh2eLVIUXgSmGND2DcA X-IronPort-AV: E=Sophos;i="4.68,363,1312149600"; d="scan'208";a="108510361" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 11 Sep 2011 15:47:00 +0200 Received: by fxg9 with SMTP id 9so484557fxg.27 for ; Sun, 11 Sep 2011 06:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=jDpFVnZhg+t4Kz6q7LKZG1oj/c3ewrHWF/9BINwz1YU=; b=etqlBk+ffeVAnX6Qu8iAgOoa31XeSyPFQHAxjLyRuIErlbRVZhKB0DYbbCEw5c2XaE vUNKMuJWnallosmdV1YwCU5rVYaGZ8nZjhuW1M5ag67rW1cC0wtKONH829d4FZGbMxs+ PXv5TVi25qcE/WV5LcpMj+PlFiEtelxYKW92c= Received: by 10.223.88.22 with SMTP id y22mr3379015fal.144.1315748820639; Sun, 11 Sep 2011 06:47:00 -0700 (PDT) Received: from [192.168.1.101] ([79.114.82.130]) by mx.google.com with ESMTPS id l21sm6442271fac.8.2011.09.11.06.46.58 (version=SSLv3 cipher=OTHER); Sun, 11 Sep 2011 06:46:59 -0700 (PDT) Message-ID: <4E6CBBD1.2000805@gmail.com> Date: Sun, 11 Sep 2011 16:46:57 +0300 From: =?UTF-8?B?VMO2csO2ayBFZHdpbg==?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Icedove/3.1.13 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Running ocaml programs on Windows 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