caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Issues with OCaml on Windows, MinGW build
@ 2011-11-24  6:25 Paul A. Steckler
  2011-11-24  7:12 ` [Caml-list] " Sylvain Le Gall
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Paul A. Steckler @ 2011-11-24  6:25 UTC (permalink / raw)
  To: caml-list

For a long while, we've been building software for Windows using the
OCaml MinGW cross-compiler
on Fedora. That tack allows building the software pretty much the same
as it's built for native Linux.
But the OCaml MinGW packages for Linux haven't been updated in some
time, and that project
appears moribund. We're already on to 3.12 in Linux, and the
cross-compiler is stuck at 3.11 (and a
beta version at that).

So I thought I'd try building the software directly on Windows using
the MinGW build. I downloaded
the self-installer from
http://gallium.inria.fr/~protzenk/caml-installer.html (am I the only
one that thinks that
blinking text in Web pages is passé?). I also downloaded MinGW/MSYS
using the installer at
http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/.

Here are some issues I encountered when using this environment:

 - Many of the OCaml executables in the distribution, as well as
flexlib, invoke gcc with the flag
'-mno-cygwin', but the MinGW gcc I installed does not, in fact, accept
that flag. In emacs, I
replaced the offending argument with spaces in the binaries to allow
compilation to proceed (!).

 - You can't login to the MinGW shell to allow remote builds via ssh.
I can get most of the
required functionality by setting environment variables and calling
the MinGW's sh.exe
explicitly, but it would be useful to have instructions on how this should go.

 - When trying to build some standard OCaml packages, like cryptokit
and oUnit, the 'configure'
and 'make' steps fail badly. One reason is that 'configure' invokes an
OCaml program which calls
Sys.command, and on my computer, some of the arguments are filenames
with spaces in them.

I managed to build a few packages, but it was difficult enough that
I'm discouraged from proceeding
further.

Has anyone had success building standard packages using the MinGW distribution?

-- Paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Caml-list] Re: Issues with OCaml on Windows, MinGW build
  2011-11-24  6:25 [Caml-list] Issues with OCaml on Windows, MinGW build Paul A. Steckler
@ 2011-11-24  7:12 ` Sylvain Le Gall
  2011-11-24  8:08   ` Adrien
  2011-11-24  8:06 ` [Caml-list] " Török Edwin
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Sylvain Le Gall @ 2011-11-24  7:12 UTC (permalink / raw)
  To: caml-list

On 24-11-2011, Paul A. Steckler <steck@stecksoft.com> wrote:
>
>  - When trying to build some standard OCaml packages, like cryptokit
> and oUnit, the 'configure'
> and 'make' steps fail badly. One reason is that 'configure' invokes an
> OCaml program which calls
> Sys.command, and on my computer, some of the arguments are filenames
> with spaces in them.
>

These one are bugs from oasis:
https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=941&group_id=54&atid=291

I am working on it for the next version.

Though, you should be warned that part of the compilation chain doesn't
deal well with spaces in command. AFAIR, maybe something related to
ocamlbuild and/or passing include paths for C library.

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Issues with OCaml on Windows, MinGW build
  2011-11-24  6:25 [Caml-list] Issues with OCaml on Windows, MinGW build Paul A. Steckler
  2011-11-24  7:12 ` [Caml-list] " Sylvain Le Gall
@ 2011-11-24  8:06 ` Török Edwin
  2011-11-24  8:23 ` Jonathan Protzenko
  2011-11-24 10:57 ` Dmitry Grebeniuk
  3 siblings, 0 replies; 6+ messages in thread
From: Török Edwin @ 2011-11-24  8:06 UTC (permalink / raw)
  To: caml-list

On 11/24/2011 08:25 AM, Paul A. Steckler wrote:
> For a long while, we've been building software for Windows using the
> OCaml MinGW cross-compiler
> on Fedora. That tack allows building the software pretty much the same
> as it's built for native Linux.
> But the OCaml MinGW packages for Linux haven't been updated in some
> time, and that project
> appears moribund. We're already on to 3.12 in Linux, and the
> cross-compiler is stuck at 3.11 (and a
> beta version at that).

Its updated on Debian, maybe open a bug in Fedora to get it updated
there as well:
$ i686-w64-mingw32-ocamlopt -v
The Objective Caml native-code compiler, version 3.12.1
Standard library directory: /usr/i686-w64-mingw32/lib/ocaml

Best regards,
--Edwin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Re: Issues with OCaml on Windows, MinGW build
  2011-11-24  7:12 ` [Caml-list] " Sylvain Le Gall
@ 2011-11-24  8:08   ` Adrien
  0 siblings, 0 replies; 6+ messages in thread
From: Adrien @ 2011-11-24  8:08 UTC (permalink / raw)
  To: Sylvain Le Gall; +Cc: caml-list

Hi,

On 24/11/2011, Sylvain Le Gall <sylvain@le-gall.net> wrote:
> On 24-11-2011, Paul A. Steckler <steck@stecksoft.com> wrote:
>>
>>  - When trying to build some standard OCaml packages, like cryptokit
>> and oUnit, the 'configure'
>> and 'make' steps fail badly. One reason is that 'configure' invokes an
>> OCaml program which calls
>> Sys.command, and on my computer, some of the arguments are filenames
>> with spaces in them.
>>
>
> These one are bugs from oasis:
> https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=941&group_id=54&atid=291
>
> I am working on it for the next version.
>
> Though, you should be warned that part of the compilation chain doesn't
> deal well with spaces in command. AFAIR, maybe something related to
> ocamlbuild and/or passing include paths for C library.
>

One solution is to put the ocaml toolchain somewhere else and set the
OCAMLLIB environment variable to the new PATH.
While you're at it, you can also use forward-slashes in paths: c:/foo/bar/baz.
This issues mostly happen with shell scripts and not programs which
have been made with greater care (actually they're probably the same
class of bugs as SQL injections).

Hope this helps.

Adrien Nader

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Issues with OCaml on Windows, MinGW build
  2011-11-24  6:25 [Caml-list] Issues with OCaml on Windows, MinGW build Paul A. Steckler
  2011-11-24  7:12 ` [Caml-list] " Sylvain Le Gall
  2011-11-24  8:06 ` [Caml-list] " Török Edwin
@ 2011-11-24  8:23 ` Jonathan Protzenko
  2011-11-24 10:57 ` Dmitry Grebeniuk
  3 siblings, 0 replies; 6+ messages in thread
From: Jonathan Protzenko @ 2011-11-24  8:23 UTC (permalink / raw)
  To: Paul A. Steckler; +Cc: caml-list

Hi,

On 11/24/2011 07:25 AM, Paul A. Steckler wrote:
> For a long while, we've been building software for Windows using the
> OCaml MinGW cross-compiler
> on Fedora. That tack allows building the software pretty much the same
> as it's built for native Linux.
> But the OCaml MinGW packages for Linux haven't been updated in some
> time, and that project
> appears moribund. We're already on to 3.12 in Linux, and the
> cross-compiler is stuck at 3.11 (and a
> beta version at that).
>
> So I thought I'd try building the software directly on Windows using
> the MinGW build. I downloaded
> the self-installer from
> http://gallium.inria.fr/~protzenk/caml-installer.html (am I the only
> one that thinks that
> blinking text in Web pages is passé?). I also downloaded MinGW/MSYS
That was intended as a joke. Sorry if that's not obvious.
> using the installer at
> http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/mingw-get-inst-20111118/.
>
> Here are some issues I encountered when using this environment:
>
>   - Many of the OCaml executables in the distribution, as well as
> flexlib, invoke gcc with the flag
> '-mno-cygwin', but the MinGW gcc I installed does not, in fact, accept
> that flag. In emacs, I
> replaced the offending argument with spaces in the binaries to allow
> compilation to proceed (!).
I tried native compilation before releasing the installer. Could you 
tell me precisely what kind of command results in gcc being called with 
-mno-cygwin? Basic native compilation tests (ocamlopt) seemed to work. 
Also, please create an issue at 
https://github.com/protz/ocaml-installer/issues so that I can fix it for 
the next version. Thanks!
>
>   - You can't login to the MinGW shell to allow remote builds via ssh.
> I can get most of the
> required functionality by setting environment variables and calling
> the MinGW's sh.exe
> explicitly, but it would be useful to have instructions on how this should go.
Isn't it more of a mingw issue?
>
>   - When trying to build some standard OCaml packages, like cryptokit
> and oUnit, the 'configure'
> and 'make' steps fail badly. One reason is that 'configure' invokes an
> OCaml program which calls
> Sys.command, and on my computer, some of the arguments are filenames
> with spaces in them.
As Sylvain said, there's the issue of c:/foo/bar vs /c/foo/bar vs 
c:\foo\bar. One of them always work, it's just hard to know which one :).
>
> I managed to build a few packages, but it was difficult enough that
> I'm discouraged from proceeding
> further.
>
> Has anyone had success building standard packages using the MinGW distribution?
I haven't tried this, as I merely tried to provide a bare ocaml. If you 
have suggestions as to how I could make that easier for you *in the 
installer*, I'm all ears :).

Thanks for the feedback,

jonathan
>
> -- Paul
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Caml-list] Issues with OCaml on Windows, MinGW build
  2011-11-24  6:25 [Caml-list] Issues with OCaml on Windows, MinGW build Paul A. Steckler
                   ` (2 preceding siblings ...)
  2011-11-24  8:23 ` Jonathan Protzenko
@ 2011-11-24 10:57 ` Dmitry Grebeniuk
  3 siblings, 0 replies; 6+ messages in thread
From: Dmitry Grebeniuk @ 2011-11-24 10:57 UTC (permalink / raw)
  To: Paul A. Steckler

Hello.

>  - You can't login to the MinGW shell to allow remote builds via ssh.
> I can get most of the
> required functionality by setting environment variables and calling
> the MinGW's sh.exe
> explicitly, but it would be useful to have instructions on how this should go.

  To allow remote builds via ssh, you should install sshd server.
Another option is to use some kind of "continuous integration
system" which will regularly check your source code repository
and build binaries automatically.

>  - When trying to build some standard OCaml packages, like cryptokit
> and oUnit, the 'configure'
> and 'make' steps fail badly. One reason is that 'configure' invokes an
> OCaml program which calls
> Sys.command, and on my computer, some of the arguments are filenames
> with spaces in them.

  Unix scripts are too sure that there are no spaces in paths,
it's easier to install everything in the path without spaces.
(I've tried to fight this issue, but our forces were too inequal.)

  btw, why didn't you took overbld package, which has
OCaml/mingw, cryptokit and oUnit already compiled?  Here is
the list of all "packages" in overbld distribution:
http://overbld.hg.sourceforge.net/hgweb/overbld/overbld/file/tip/src

> Has anyone had success building standard packages using the MinGW distribution?

  I had such success, but I didn't want to compile everything
manually every time the new version is released or some bug
is found and should be fixed as soon as possible (i.e. by me,
by writing and applying patch locally), so I wrote some dumb
scripts that can apply patches, compile, install "packages",
taking into account their internal dependencies.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-24 10:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-24  6:25 [Caml-list] Issues with OCaml on Windows, MinGW build Paul A. Steckler
2011-11-24  7:12 ` [Caml-list] " Sylvain Le Gall
2011-11-24  8:08   ` Adrien
2011-11-24  8:06 ` [Caml-list] " Török Edwin
2011-11-24  8:23 ` Jonathan Protzenko
2011-11-24 10:57 ` Dmitry Grebeniuk

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).