caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan Protzenko <jonathan.protzenko@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Self contained Windows executable?
Date: Mon, 19 May 2014 11:22:27 +0200	[thread overview]
Message-ID: <5379CD53.6070202@gmail.com> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9E8EF031D@Remus.metastack.local>

Shameless plug: there's a blog post at gagallium's which recaps the 
various versions of OCaml on windows 
<http://gallium.inria.fr/~scherer/gagallium/the-ocaml-installer-for-windows/>.

tl;dr :
- the "ocaml" package from the cygwin distribution is a cygwin program 
which generates cygwin executables -- these depend on cygwin1.dll to run
- the installer from http://protz.github.com/ocaml-installer/ is a 
native windows program, which generates native windows program -- these 
do not need anything specific to execute.

The second option does also require cygwin, however, as most of the 
ecosystem (e.g. ocamlbuild) assumes a unix-like environment.

Cheers,

~ jonathan

On Mon 19 May 2014 11:10:48 AM CEST, David Allsopp wrote:
> Andre Tampubolon wrote:
>> Hi David,
>> I think I built ocaml correctly using MinGW, as stated in README.win32
>> cp config/m-nt.h config/m.h
>> cp config/s-nt.h config/s.h
>> cp config/Makefile.msvc config/Makefile
>> Followed by:
>> make -f Makefile.nt world
>> make -f Makefile.nt bootstrap
>> make -f Makefile.nt opt
>> make -f Makefile.nt opt.opt
>> make -f Makefile.nt install
>
> Yes, that is the correct procedure!
>
>> If ocamlopt is invoked outside Cygwin Bash Shell, it will give this error:
>> C:\Users\CSL-NB-064\Codes\OCaml>ocamlopt cholesky.ml -o cholesky.exe
>> 'i686-w64-mingw32-as' is not recognized as an internal or external command,
>> operable program or batch file.
>> File "cholesky.ml", line 1:
>> Error: Assembler error, input left in file C:\Users\CSL-NB~1\AppData\Local\Temp\camlasmfac3bb.s
>
> If running from cmd, you need to put Cygwin's bin dir into your PATH (you can do this by symlinking the required executables from your OCaml installation's bin directory, but it's non-trivial - I can give you the details if you're really interested)
>
>> Of course ocamlopt works fine in Cygwin. The executables compiled with it need Cygwin DLLs , though.
>
> "Of course" doesn't make sense here! If you do have a Cygwin installation of OCaml knocking around, that will certainly confuse things. Ways to tell:
>
> On my system:
>
> $ which ocaml
> /cygdrive/c/Dev/OCaml/bin/ocaml
>
> (i.e. the path should be where you've installed MinGW OCaml and not /usr/bin/ocaml of something similar)
>
> $ ocamlopt -config | fgrep native_c
> native_c_compiler: i686-w64-mingw32-gcc -O -mms-bitfields -Wall -Wno-unused
> native_c_libraries: -lws2_32
>
> (i.e. the compiler should be i686-w64-mingw32-gcc rather than plain gcc which is what the Cygwin port uses)
>
> Neither the executables produced by ocamlopt, nor the OCaml tools themselves (ocamlc.exe, ocamlopt.exe, etc.) should depend on Cygwin DLLs for either the MinGW or MSVC ports.
>
>
> David
>

  reply	other threads:[~2014-05-19  9:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19  7:42 Andre Tampubolon
2014-05-19  7:55 ` David Allsopp
2014-05-19  7:56 ` Adrien Nader
     [not found] ` <E51C5B015DBD1348A1D85763337FB6D9E8EEFDA5@Remus.metastack.local>
     [not found]   ` <CAOEA5rZWJ+HfwkCGnLPbwwz7GVHZ6R7_ioZfyabFyNOuNnPhrg@mail.gmail.com>
2014-05-19  9:10     ` David Allsopp
2014-05-19  9:22       ` Jonathan Protzenko [this message]
2014-05-19  9:28         ` Adrien Nader

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=5379CD53.6070202@gmail.com \
    --to=jonathan.protzenko@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).