caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jun Furuse <jun.furuse@gmail.com>
To: caml-list <caml-list@inria.fr>
Subject: [Caml-list] User Report: Cygwin32 OPAM for MinGW OCaml 64
Date: Wed, 30 Sep 2015 23:00:04 +0800	[thread overview]
Message-ID: <CAAoLEWsQK7=qER66Uixx5pq4wLExXovrQWM6b69_fyMmjYFiZA@mail.gmail.com> (raw)

Hi List,

I have played a bit with Cygwin OPAM to install packages for MinGW
64bit OCaml system, and finally got succeeded to install core_kernel
by `opam install core_kernel`.  It required several fixes of
OCaml+OPAM configurations and patching to packages but now I think I
got enough know-how and share it with the community.

To use Cygwin32 OPAM smoothly for MinGW64 OCaml you need:

* /usr/bin/ar of Cygwin32 did not work for MinGW OCaml 64. I had to
use a special ar command for MinGW64.
* Many build scripts assume Unix commands.  You need to add Cygwin's
/bin directory to Windows PATH
* global-config.config and system.comp must be fixed so that directory
and paths can be understandable by MinGW OCaml, a Windows app

Many packages can be installed without any modification to them.
Therefore Cygwin OPAM is already very useful for MinGW OCaml package
installation.  However, some packages required fixes and here are some
tips:

* Use "mixed path" obtained by cygpath -m, so that the paths can be
understandable both for Cygwin and for MinGW
* Build systems like Oasis executes commands not using /bin/sh but
cmd.exe in MinGW.  _oasis or setup.ml contains lots of Unix shell
phrases like   mkdir $dir; build something  which are wrongly executed
by cmd.exe.  You need to fix them so that they can be interpreted by
sh, i.e.  sh -c "mkdir $dir; build something"
* In Unix, files in xxx.install are ignored by OPAM when they are
already installed by OPAM's install section.  However, in Cygwin, it
sometimes fails.  It is due to Cygwin's special handling of files with
.exe extension.  You need remove entries from xxx.install if they are
installed by the install section.

I hope this information helps you.  More details or work log can be
found here: https://bitbucket.org/camlspotter/opamingw

Enjoy OPAMinGW!
Jun Furuse

                 reply	other threads:[~2015-09-30 15:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAAoLEWsQK7=qER66Uixx5pq4wLExXovrQWM6b69_fyMmjYFiZA@mail.gmail.com' \
    --to=jun.furuse@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).