Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] New version of the binary installer for Windows

48 views
Skip to first unread message

Jonathan Protzenko

unread,
Mar 28, 2012, 8:25:07 AM3/28/12
to caml...@inria.fr
Hi,

I've spent the past few days improving the OCaml installer for windows.
This should solve all issues that have been mentioned previously. This
in preparation for the upcoming 4.0 release ; therefore, the "beta
installer" below will install a fairly recent trunk version of OCaml.

http://yquem.inria.fr/~protzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe

*Changelog:*

- The installer packages a working and well-configured findlib, out of
the box. This means you can open up cmd.exe, type ocaml, then type #use
"topfind";; in the top-level.
- The installer no longer blasts the PATH variable if it is too long.
Moreover, it is now able to deal with PATHs that are up to 8192 bytes long.
- The installer is now able to deal with multi-user privileges: in
particular, you can use this installer on a *limited account*: OCaml
will properly install into your local "Application Data" folder if you
don't have administrator rights on your machine. This should be
particularly useful for school computers that run Windows.
- Various fixes: better cleanups on exit, minor fixes for OCamlWinPlus,
properly warn the user if it was unable to download ActiveTCL from the
internet.
- The installer packages a newer version of flexlink, so you shouldn't
have any more issues with gcc not accepting the -mno-cygwin option.
However, the new, official toolchain uses the mingw64 32-bit compilers.
This means flexlink will look for a i686-w64-mingw32-gcc in your path
whenever you try to do native compilation. The official, recommended way
to work is to install cygwin and its mingw64 packages. While in theory
it should be possible to work within a MSys environment, some issues [1]
currently prevent you from doing so.

[1] http://caml.inria.fr/mantis/view.php?id=5465

Please let me know if anything doesn't work as expected. This will be
the official installer for the 4.0 release.

Cheers,

jonathan

--
Caml-list mailing list. Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Kakadu

unread,
Mar 28, 2012, 10:56:13 AM3/28/12
to Jonathan Protzenko, caml...@inria.fr
Hello!

Can you test ocamlbuild on windows? On my vertual machine with XP it
can't create _build directory and says

C:\prog\1>ocamlbuild main.byte
mkdir "C:\prog\1\_build"
bash: warning: could not find /tmp, please create!
bash: mkdir: command not found
Failure: Error during command `mkdir "C:\prog\1\_build"'.
Exit code 127.

Best wishes,
Kakadu

On Wed, Mar 28, 2012 at 4:24 PM, Jonathan Protzenko
<jonathan....@gmail.com> wrote:
> Hi,
>
> I've spent the past few days improving the OCaml installer for windows. This
> should solve all issues that have been mentioned previously. This in
> preparation for the upcoming 4.0 release ; therefore, the "beta installer"
> below will install a fairly recent trunk version of OCaml.
>
> http://yquem.inria.fr/~protzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe
>
> Changelog:
>
> - The installer packages a working and well-configured findlib, out of the
> box. This means you can open up cmd.exe, type ocaml, then type #use
> "topfind";; in the top-level.
> - The installer no longer blasts the PATH variable if it is too long.
> Moreover, it is now able to deal with PATHs that are up to 8192 bytes long.
> - The installer is now able to deal with multi-user privileges: in
> particular, you can use this installer on a limited account: OCaml will

Jonathan Protzenko

unread,
Mar 28, 2012, 11:20:00 AM3/28/12
to Kakadu, caml...@inria.fr
Unfortunately, ocamlbuild requires a unix-like environment, with a few
utilities in the path: bash, mkdir...

The installer only provides the very basics. It does not provide a unix
environment on windows, only the ocaml binaries, flexlink, and
ocamlfind. If you want to go further, e.g. use ocamlbuild, or benefit
from native compilation, you need to install a development environment,
such as cygwin, or msys. Currently, because of bug 5465, cygwin is the
recommended way.

I've successfully used ocamlbuild under cygwin and msys, and it works
fine.

Cheers,

jonathan

Wojciech Meyer

unread,
Mar 28, 2012, 11:26:22 AM3/28/12
to Jonathan Protzenko, Kakadu, caml...@inria.fr
Hi Jonathan,

Thanks for the installer!

On Wed, Mar 28, 2012 at 4:19 PM, Jonathan Protzenko
<jonathan....@gmail.com> wrote:
> Unfortunately, ocamlbuild requires a unix-like environment, with a few
> utilities in the path: bash, mkdir...

It looks like he's got a partially installed environment - as bash is there.

> The installer only provides the very basics. It does not provide a unix
> environment on windows, only the ocaml binaries, flexlink, and ocamlfind. If
> you want to go further, e.g. use ocamlbuild, or benefit from native
> compilation, you need to install a development environment, such as cygwin,
> or msys. Currently, because of bug 5465, cygwin is the recommended way.
>
> I've successfully used ocamlbuild under cygwin and msys, and it works fine.

How about bundling the installer with cygwin or msys? Beware of the
license issues however.

Cheers,

Wojciech

Jonathan Protzenko

unread,
Mar 28, 2012, 11:32:36 AM3/28/12
to Kakadu, caml...@inria.fr
Oh right, it looks like you've got some sort of Unix-like environment.
Could you please tell me more about your current setup?

Jonathan Protzenko

unread,
Mar 28, 2012, 11:38:43 AM3/28/12
to Wojciech Meyer, caml...@inria.fr
Hey,
> How about bundling the installer with cygwin or msys? Beware of the
> license issues however.
Well that's the usual debate : should the installer provide an entire
environment (e.g. msys + the right compilers), so that users can fire up
an "ocaml shell" and get all the good features (odb, native compilation,
etc.)? Or should the installer rather provide the basics only, and let
users pick msys or cygwin later on if they wish to do more advanced stuff?

With this release, I'm going with the minimalistic approach: the
installer provides just enough to do bytecode, and users are free to
install whatever environment they like if they wish to do native
compilation.

The rationale is as follows: if the user is an advanced user, they
probably have developer tools set up already, so I don't see much point
in providing them with another standalone environment that would
potentially conflict with theirs.

If a user wants to do advanced stuff (besides playing with the toplevel
and bytecode compilation in emacs), they can simply install cygwin + the
mingw-w64 compilers, and they're good to go. It really is a few clicks
to perform, and I'm not sure I can have the installer do that for them.

I'm open to more arguments, though. There still is the option of
prompting the user about whether they want to install msys + mingw-w64
during the install phase (I'm saying msys here because it's more
lightweight than cygwin, and easier to unzip as a whole). The installer
could then download the latest release, and unzip it alongside the OCaml
binaries, so that everything comes bundled together. That may be an
interesting solution, but bug 5465 is a showstopper, and of course it's
much more work :)

Cheers,

jonathan

David Allsopp

unread,
Mar 28, 2012, 11:55:17 AM3/28/12
to Wojciech Meyer, Jonathan Protzenko, Kakadu, caml...@inria.fr
Wojciech Meyer wrote:
> Hi Jonathan,
>
> Thanks for the installer!
>
> On Wed, Mar 28, 2012 at 4:19 PM, Jonathan Protzenko
> <jonathan....@gmail.com> wrote:
> > Unfortunately, ocamlbuild requires a unix-like environment, with a few
> > utilities in the path: bash, mkdir...
>
> It looks like he's got a partially installed environment - as bash is
> there.
>
> > The installer only provides the very basics. It does not provide a
> > unix environment on windows, only the ocaml binaries, flexlink, and
> > ocamlfind. If you want to go further, e.g. use ocamlbuild, or benefit
> > from native compilation, you need to install a development
> > environment, such as cygwin, or msys. Currently, because of bug 5465,
> cygwin is the recommended way.
> >
> > I've successfully used ocamlbuild under cygwin and msys, and it works
> fine.
>
> How about bundling the installer with cygwin or msys? Beware of the
> license issues however.

I haven't had a go with it, but will try it as soon as possible. However, it sounded from the description as though it offers to install ActiveTCL by downloading it from the internet and running the installer for you. Couldn't it then offer the same for Cygwin? It would simply need to pull down http://cygwin.com/setup.exe and then run:

setup.exe --root=C:\cygwin --download --quiet-mode --no-startmenu --no-desktop --packages=make,mingw64-i686-gcc-g++ >nul 2>&1

which would circumvent all licensing issues, I believe.

My own install script also adds git, subversion, patch, m4 and unzip as these are also needed for building various libraries from source. I install g++ because SpiderMonkey has portions written in C++ but you can install mingw64-i686-gcc-core instead if you don't want a C++ compiler.


David

Jonathan Protzenko

unread,
Mar 28, 2012, 12:05:03 PM3/28/12
to David Allsopp, Kakadu, caml...@inria.fr, Wojciech Meyer
Hi,

> I haven't had a go with it, but will try it as soon as possible. However, it sounded from the description as though it offers to install ActiveTCL by downloading it from the internet and running the installer for you.
Absolutely.
> Couldn't it then offer the same for Cygwin? It would simply need to pull down http://cygwin.com/setup.exe and then run:
>
> setup.exe --root=C:\cygwin --download --quiet-mode --no-startmenu --no-desktop --packages=make,mingw64-i686-gcc-g++ >nul 2>&1
>
> which would circumvent all licensing issues, I believe.
That's an excellent suggestion. I'll give it a try!
>
> My own install script also adds git, subversion, patch, m4 and unzip as these are also needed for building various libraries from source. I install g++ because SpiderMonkey has portions written in C++ but you can install mingw64-i686-gcc-core instead if you don't want a C++ compiler.
Do you have it online somewhere?

jonathan

Adrien

unread,
Mar 28, 2012, 1:36:51 PM3/28/12
to Wojciech Meyer, Jonathan Protzenko, Kakadu, caml...@inria.fr
On 28/03/2012, Wojciech Meyer <wojciec...@googlemail.com> wrote:
> On Wed, Mar 28, 2012 at 4:19 PM, Jonathan Protzenko
> <jonathan....@gmail.com> wrote:
>> Unfortunately, ocamlbuild requires a unix-like environment, with a few
>> utilities in the path: bash, mkdir...
>
> It looks like he's got a partially installed environment - as bash is there.
>
>> The installer only provides the very basics. It does not provide a unix
>> environment on windows, only the ocaml binaries, flexlink, and ocamlfind.
>> If
>> you want to go further, e.g. use ocamlbuild, or benefit from native
>> compilation, you need to install a development environment, such as
>> cygwin,
>> or msys. Currently, because of bug 5465, cygwin is the recommended way.
>>
>> I've successfully used ocamlbuild under cygwin and msys, and it works
>> fine.
>
> How about bundling the installer with cygwin or msys? Beware of the
> license issues however.

Or make ocamlbuild not depend on bash. Only depending on a compliant
sh would already be quite nice but afaik, it should be possible to not
depend on a shell at all with minimal efforts.

Regards,
Adrien Nader

Jonathan Protzenko

unread,
Mar 28, 2012, 4:43:17 PM3/28/12
to Adrien, caml...@inria.fr
On 03/28/2012 07:36 PM, Adrien wrote:
> On 28/03/2012, Wojciech Meyer<wojciec...@googlemail.com> wrote:
>> On Wed, Mar 28, 2012 at 4:19 PM, Jonathan Protzenko
>> <jonathan....@gmail.com> wrote:
>>> Unfortunately, ocamlbuild requires a unix-like environment, with a few
>>> utilities in the path: bash, mkdir...
>> It looks like he's got a partially installed environment - as bash is there.
>>
>>> The installer only provides the very basics. It does not provide a unix
>>> environment on windows, only the ocaml binaries, flexlink, and ocamlfind.
>>> If
>>> you want to go further, e.g. use ocamlbuild, or benefit from native
>>> compilation, you need to install a development environment, such as
>>> cygwin,
>>> or msys. Currently, because of bug 5465, cygwin is the recommended way.
>>>
>>> I've successfully used ocamlbuild under cygwin and msys, and it works
>>> fine.
>> How about bundling the installer with cygwin or msys? Beware of the
>> license issues however.
> Or make ocamlbuild not depend on bash. Only depending on a compliant
> sh would already be quite nice but afaik, it should be possible to not
> depend on a shell at all with minimal efforts.
Any patches will be more than welcome, of course :). I've been in the
process of trying to fix a bug related to ocamlbuild on windows, and the
code is pretty, daunting, to say the least. Any contributions in that
area would be most appreciated, and I'd be more than happy to review them!

Cheers,

jonathan

Kakadu

unread,
Mar 29, 2012, 7:56:24 AM3/29/12
to Jonathan Protzenko, caml...@inria.fr
I've understanded problem. My bash was misconfigured.


Best wishes,
Kakadu

P.S.
Btw, If I install OCaml to Program Files and call `ocaml setup.ml
-someoption` in cmd everything fails because ocamlbuild is not found
(space in the path).

On Wed, Mar 28, 2012 at 7:19 PM, Jonathan Protzenko

Gabriel Scherer

unread,
Mar 29, 2012, 8:19:18 AM3/29/12
to Kakadu, Jonathan Protzenko, caml...@inria.fr
> P.S.
> Btw, If I install OCaml to Program Files and call `ocaml setup.ml
> -someoption` in cmd everything fails because ocamlbuild is not found
> (space in the path).

That may be an issue with oasis (the tool that produced this setup.ml
file) rather than the presently discussed installer. Filename space
escaping is considered tricky by some third-party tools developper,
and I remember hearing the advice to simply put any
programming-oriented program in a path with no spaces. It's of course
a good thing that you detect and report space-related bugs to the ton
of third-party tools that choke on them, but you may have an easier
route just moving your installation(s) to a Prog\ directory, with no
spaces.

Jonathan Protzenko

unread,
Mar 29, 2012, 8:20:55 AM3/29/12
to Gabriel Scherer, caml...@inria.fr, Kakadu
Yes I was about to give a similar reply. I've tested various features
using a install location with spaces, and the basics work fine, so I
surmise this is an issue in setup.ml

Cheers,

jonathan

Kakadu

unread,
Mar 29, 2012, 8:28:14 AM3/29/12
to Gabriel Scherer, Jonathan Protzenko, caml...@inria.fr
I've guessed that putting OCaml to C:\OCaml fix the problem. I've
wanted just report Jonathan that maybe better change default
installation path.

Best wishes,
Kakadu

Jonathan Protzenko

unread,
Mar 30, 2012, 10:16:00 AM3/30/12
to caml...@inria.fr
Hi again,

Following all the good suggestions in this thread, I've updated the
installer. It now downloads and runs cygwin's setup.exe so as to provide
a fully working environment for OCaml on windows after the installer
completes. The cygwin installer runs in silent mode, that is, the
progress window shows up, but there is no user prompt.

I've also looked into odb compatibility, and it looks like after writing
a few patches, odb now runs fine on Windows. However, Oasis-generated
setup.ml files do not work at all on windows. Any help in that area
would be highly appreciated.

Thanks,

jonathan

David Allsopp

unread,
Mar 30, 2012, 10:42:03 AM3/30/12
to Jonathan Protzenko, caml...@inria.fr
Jonathan Protzenko wrote:
> Hi again,
>
> Following all the good suggestions in this thread, I've updated the installer.
> It now downloads and runs cygwin's setup.exe so as to provide a fully working
> environment for OCaml on windows after the installer completes. The cygwin
> installer runs in silent mode, that is, the progress window shows up, but
> there is no user prompt.

> I've also looked into odb compatibility, and it looks like after writing a
> few patches, odb now runs fine on Windows. However, Oasis-generated setup.ml
> files do not work at all on windows. Any help in that area would be highly
> appreciated.

What do you mean by not working at all (as in, where are you running them from)?

My build process on Windows uses Oasis setup.ml files to compile CSV (http://forge.ocamlcore.org/projects/csv - no patches) and Cryptokit (http://forge.ocamlcore.org/projects/cryptokit - tiny manual patch to two lines from Sylvain to workaround the current/past inability to pass -L options to setup.ml as Zlib is installed in a non-standard place) - but in those cases, setup.ml is invoked from a Cygwin bash prompt.


David

Kakadu

unread,
Mar 30, 2012, 1:39:45 PM3/30/12
to Jonathan Protzenko, caml...@inria.fr
Hi Jonathan

Can you test compilation using camlp4r preprocessor?
It says that "OCaml and preprocessor have incompatible version" on my windows.

Best wishes,
Kakadu

On Fri, Mar 30, 2012 at 6:15 PM, Jonathan Protzenko
<jonathan....@gmail.com> wrote:
> Hi again,
>
> Following all the good suggestions in this thread, I've updated the
> installer. It now downloads and runs cygwin's setup.exe so as to provide a
> fully working environment for OCaml on windows after the installer
> completes. The cygwin installer runs in silent mode, that is, the progress
> window shows up, but there is no user prompt.
>
> I've also looked into odb compatibility, and it looks like after writing a
> few patches, odb now runs fine on Windows. However, Oasis-generated setup.ml
> files do not work at all on windows. Any help in that area would be highly
> appreciated.
>
> Thanks,
>
> jonathan
>
>
> On 03/28/2012 02:24 PM, Jonathan Protzenko wrote:
>
> Hi,
>
> I've spent the past few days improving the OCaml installer for windows. This
> should solve all issues that have been mentioned previously. This in
> preparation for the upcoming 4.0 release ; therefore, the "beta installer"
> below will install a fairly recent trunk version of OCaml.
>
> http://yquem.inria.fr/~protzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe
>
> Changelog:
>
> - The installer packages a working and well-configured findlib, out of the
> box. This means you can open up cmd.exe, type ocaml, then type #use
> "topfind";; in the top-level.
> - The installer no longer blasts the PATH variable if it is too long.
> Moreover, it is now able to deal with PATHs that are up to 8192 bytes long.
> - The installer is now able to deal with multi-user privileges: in
> particular, you can use this installer on a limited account: OCaml will

Sylvain Le Gall

unread,
Mar 31, 2012, 5:35:10 AM3/31/12
to caml...@inria.fr
Hello,

On 30-03-2012, Jonathan Protzenko <jonathan....@gmail.com> wrote:
> This is a multi-part message in MIME format.
> --------------090404070100000705080101
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
>
> Hi again,
>
> Following all the good suggestions in this thread, I've updated the
> installer. It now downloads and runs cygwin's setup.exe so as to provide
> a fully working environment for OCaml on windows after the installer
> completes. The cygwin installer runs in silent mode, that is, the
> progress window shows up, but there is no user prompt.
>
> I've also looked into odb compatibility, and it looks like after writing
> a few patches, odb now runs fine on Windows. However, Oasis-generated
> setup.ml files do not work at all on windows. Any help in that area
> would be highly appreciated.
>

This has nothing to do with windows. This is related the version number
of OCaml which is "4.01.0+dev0 (2012-03-12)". OASIS 0.2 doesn't handle
spaces in the version number... A more classical scheme for version
number with date is 4.01.0+dev0_2012-03-12. But anyway, this is fixed
since OASIS 0.2.1~alpha1 and will be automatically fix in any packages
hosted on the forge -- and it won't be there when your installer will
use a non dev version of OCaml.

BTW, the bug related to these issues is here:
https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=1135&group_id=54&atid=291
I recommend to follow it.

From what I have seen I am more concerned by the fact that the camlp4
findlib path contains strange char... There are some bugs in findlib on
Windows with pathname, I have attached a patch to the bug. Please test
and send it to Gerd Stolpmann.

Cheers
Sylvain
> --------------090404070100000705080101
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: 7bit
>
> <html>
> <head>
> <meta content="text/html; charset=ISO-8859-1"
> http-equiv="Content-Type">
> </head>
> <body bgcolor="#FFFFFF" text="#000000">
> Hi again,<br>
> <br>
> Following all the good suggestions in this thread, I've updated the
> installer. It now downloads and runs cygwin's setup.exe so as to
> provide a fully working environment for OCaml on windows after the
> installer completes. The cygwin installer runs in silent mode, that
> is, the progress window shows up, but there is no user prompt.<br>
> <br>
> I've also looked into odb compatibility, and it looks like after
> writing a few patches, odb now runs fine on Windows. However,
> Oasis-generated setup.ml files do not work at all on windows. Any
> help in that area would be highly appreciated.<br>
> <br>
> Thanks,<br>
> <br>
> jonathan<br>
> <br>
> <div class="moz-cite-prefix">On 03/28/2012 02:24 PM, Jonathan
> Protzenko wrote:<br>
> </div>
> <blockquote cite="mid:4F730303...@gmail.com" type="cite">
> <meta http-equiv="content-type" content="text/html;
> charset=ISO-8859-1">
> Hi,<br>
> <br>
> I've spent the past few days improving the OCaml installer for
> windows. This should solve all issues that have been mentioned
> previously. This in preparation for the upcoming 4.0 release ;
> therefore, the "beta installer" below will install a fairly recent
> trunk version of OCaml.<br>
> <br>
> <a moz-do-not-send="true" class="moz-txt-link-freetext"
> href="http://yquem.inria.fr/%7Eprotzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe">http://yquem.inria.fr/~protzenk/caml-installer/ocaml-4.01.0+dev0-i686-mingw64.exe</a><br>
> <br>
> <b>Changelog:</b><br>
> <br>
> - The installer packages a working and well-configured findlib,
> out of the box. This means you can open up cmd.exe, type ocaml,
> then type #use "topfind";; in the top-level.<br>
> - The installer no longer blasts the PATH variable if it is too
> long. Moreover, it is now able to deal with PATHs that are up to
> 8192 bytes long.<br>
> - The installer is now able to deal with multi-user privileges: in
> particular, you can use this installer on a <b>limited account</b>:
> OCaml will properly install into your local "Application Data"
> folder if you don't have administrator rights on your machine.
> This should be particularly useful for school computers that run
> Windows.<br>
> - Various fixes: better cleanups on exit, minor fixes for
> OCamlWinPlus, properly warn the user if it was unable to download
> ActiveTCL from the internet.<br>
> - The installer packages a newer version of flexlink, so you
> shouldn't have any more issues with gcc not accepting the
> -mno-cygwin option. However, the new, official toolchain uses the
> mingw64 32-bit compilers. This means flexlink will look for a
> i686-w64-mingw32-gcc in your path whenever you try to do native
> compilation. The official, recommended way to work is to install
> cygwin and its mingw64 packages. While in theory it should be
> possible to work within a MSys environment, some issues [1]
> currently prevent you from doing so.<br>
> <br>
> [1] <a moz-do-not-send="true" class="moz-txt-link-freetext"
> href="http://caml.inria.fr/mantis/view.php?id=5465">http://caml.inria.fr/mantis/view.php?id=5465</a><br>
> <br>
> Please let me know if anything doesn't work as expected. This will
> be the official installer for the 4.0 release.<br>
> <br>
> Cheers,<br>
> <br>
> jonathan<br>
> </blockquote>
> <br>
> <br>
> </body>
> </html>
>
> --------------090404070100000705080101--
>

Cheers,
Sylvain Le Gall
--
My company: http://www.ocamlcore.com
Linkedin: http://fr.linkedin.com/in/sylvainlegall
Start an OCaml project here: http://forge.ocamlcore.org
OCaml blogs: http://planet.ocamlcore.org

Romain Bardou

unread,
Apr 2, 2012, 4:05:55 AM4/2/12
to Jonathan Protzenko, caml...@inria.fr
Le 30/03/2012 16:15, Jonathan Protzenko a écrit :
> Hi again,
>
> Following all the good suggestions in this thread, I've updated the
> installer. It now downloads and runs cygwin's setup.exe so as to provide
> a fully working environment for OCaml on windows after the installer
> completes. The cygwin installer runs in silent mode, that is, the
> progress window shows up, but there is no user prompt.

Hello,

I always heard that if you compile your program under the Cygwin
environment, then the application needs to be run under the Cygwin
environment as well; whereas if you use MinGW, you produce stand-alone
executables. Is that still the case?

I need to give stand-alone executables to my users; I cannot tell them
to install Cygwin as well. If your installer does not let me compile
stand-alone executables, it has no value to me.

That being said I appreciate your reactivity :)

Cheers,

--
Romain

Alain Frisch

unread,
Apr 2, 2012, 4:21:25 AM4/2/12
to Romain Bardou, Jonathan Protzenko, caml...@inria.fr
On 04/02/2012 10:03 AM, Romain Bardou wrote:
> I always heard that if you compile your program under the Cygwin
> environment, then the application needs to be run under the Cygwin
> environment as well; whereas if you use MinGW, you produce stand-alone
> executables. Is that still the case?

It depends on what you call "under the Cygwin environment". What matters
is which toolchain OCaml uses. It has always been the case that the
"officially supported" toolchain for the MinGW port of OCaml is provided
by Cygwin packages (previously: the regular gcc package, with the
-mno-cygwin flag; now: the mingw64 32-bit or 64-bit packages). Which
does not imply any runtime dependency on Cygwin for the binaries
compiled with ocamlopt.


Alain

David Allsopp

unread,
Apr 2, 2012, 4:23:52 AM4/2/12
to Romain Bardou, Jonathan Protzenko, caml...@inria.fr
Romain Bardou wrote:
> Le 30/03/2012 16:15, Jonathan Protzenko a écrit :
> > Hi again,
> >
> > Following all the good suggestions in this thread, I've updated the
> > installer. It now downloads and runs cygwin's setup.exe so as to
> > provide a fully working environment for OCaml on windows after the
> > installer completes. The cygwin installer runs in silent mode, that
> > is, the progress window shows up, but there is no user prompt.
>
> Hello,
>
> I always heard that if you compile your program under the Cygwin
> environment, then the application needs to be run under the Cygwin
> environment as well; whereas if you use MinGW, you produce stand-alone
> executables. Is that still the case?

You misheard :o) If you compile your programs using the Cygwin *port* of OCaml (so either using Cygwin's OCaml package or by compiling OCaml from sources using ./configure && make world opt install) then your executables will depend on Cygwin.

The MinGW and MSVC ports don't use configure (at the moment) but instead use custom Makefiles - however, all four ports use the Cygwin *environment* (i.e. bash, make, findutils, etc.) to perform the build. For the MinGW ports, Cygwin's mingw64 *cross-compilers* are used.

> I need to give stand-alone executables to my users; I cannot tell them to
> install Cygwin as well. If your installer does not let me compile stand-
> alone executables, it has no value to me.

It does - the installer will install Cygwin's gcc-mingw64-core package. You can still run ocamlopt from a normal command prompt.


David

Adrien

unread,
Apr 2, 2012, 7:14:37 AM4/2/12
to Romain Bardou, Jonathan Protzenko, caml...@inria.fr
On 02/04/2012, Romain Bardou <bar...@lsv.ens-cachan.fr> wrote:
> Le 30/03/2012 16:15, Jonathan Protzenko a écrit :
>> Hi again,
>>
>> Following all the good suggestions in this thread, I've updated the
>> installer. It now downloads and runs cygwin's setup.exe so as to provide
>> a fully working environment for OCaml on windows after the installer
>> completes. The cygwin installer runs in silent mode, that is, the
>> progress window shows up, but there is no user prompt.
>
> Hello,
>
> I always heard that if you compile your program under the Cygwin
> environment, then the application needs to be run under the Cygwin
> environment as well; whereas if you use MinGW, you produce stand-alone
> executables. Is that still the case?
>
> I need to give stand-alone executables to my users; I cannot tell them
> to install Cygwin as well. If your installer does not let me compile
> stand-alone executables, it has no value to me.

Others have already pointed out that it wasn't necessarily the case.

If you call "gcc" from cygwin, you'll end up with cygwin binaries but
you can very simply cross-compile.

Cygwin provides a POSIX environment that can also run windows stuff
and does some translation between the two but if you cross-compile,
you can target whatever you want and that includes "pure" windows.

Also, note that msys, which is often used when cygwin isn't, is
similar to cygwin (and it's a "light" fork of cygwin), also requires
you to provide a specific library and changes the behaviour of the
application. However, you should absolutely never ever build anything
msys (msys is also a target for gcc, which has never been merged and
is from gcc 2.95 or 2.96).

With x-compilation, you can do what you want:
- need full POSIX? cygwin
- need some POSIX? msys (maybe)
- need some POSIX but not a lot? a library on top of win32, or move
away from posix directly

By the way, there was a netbsd-derived environment named Interix which
microsoft used to advise. Windows 8's documentation now advises users
of Interix to use cygwin or mingw(-w64).

Regards,
Adrien Nader

Romain Bardou

unread,
Apr 2, 2012, 7:51:37 AM4/2/12
to Adrien, caml...@inria.fr
Thanks to all of you for clarifying this !

--
Romain

Jonathan Protzenko

unread,
Apr 3, 2012, 8:33:13 AM4/3/12
to Kakadu, caml...@inria.fr
On 03/30/2012 07:38 PM, Kakadu wrote:
> Hi Jonathan
>
> Can you test compilation using camlp4r preprocessor?
> It says that "OCaml and preprocessor have incompatible version" on my windows.
Same here. I have no idea why this is, maybe camlp4r hasn't been updated
with the latest changes on trunk, or maybe it is unable to parse the
"+dev" version number... anyway, I'm not a camlp4 expert, so I can't do
much here :).

Cheers,

jonathan
0 new messages