caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <fabrissimo@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Build OCaml on linux
Date: Tue, 25 Sep 2012 11:25:11 +0200	[thread overview]
Message-ID: <50617877.4050507@gmail.com> (raw)
In-Reply-To: <04644211E51C7E40BF64101089F97E4D0A7AE3DD@exmb-01-ah.ad.mathworks.com>

Hi,

On 09/20/2012 09:50 PM, Zhi Han wrote:
> I found that the OCaml executable “bin/ocaml” is built by default as an
> bytecode on Linux, i.e., it requires ‘bin/ocamlrun” to run it. This has
> caused some issues in our group because our build process copies the
> executables from place to place. When the files are moved, the old
> location of the file is left in the first line of the bytecode file.
>
> However, same issues does not exists on Windows build. The files are
> built as executables and we can move these files around and still be
> able to execute them. I am wondering what are the switches that makes
> the Windows build work. Can somebody help me with that? Thanks,

On Linux, the first line of a non-custom bytecode executable indicates 
the full path to ocamlrun. You can create a relocatable executable using:

cat `which ocamlrun` `which ocamlc` > ocamlc.byte

On Windows, a small loader is included at the beginning of each bytecode 
executable, that locates 'ocamlrun' in the PATH, and run it on the 
executable, so the only requirement is to have ocamlrun in your PATH.

--Fabrice

      parent reply	other threads:[~2012-09-25 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20 19:50 Zhi Han
2012-09-22 19:52 ` Kristopher Micinski
     [not found] ` <sympa.1348346044.7674.559@inria.fr>
2012-09-23  0:33   ` Edgar Friendly
2012-09-23  0:56     ` Wojciech Meyer
     [not found]   ` <04644211E51C7E40BF64101089F97E4D0A7B38C9@exmb-01-ah.ad.mathworks.com>
     [not found]     ` <CA+LkvyqbZxzY=Coj7v_XnkSBDyN8wGuQP9ZB41bCBHqsE6XfcQ@mail.gmail.com>
2012-09-25  0:36       ` Francois Berenger
2012-09-25  9:25 ` Fabrice Le Fessant [this message]

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=50617877.4050507@gmail.com \
    --to=fabrissimo@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).