caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <jacques.garrigue@gmail.com>
To: Dmitry Grebeniuk <gdsfh1@gmail.com>, caml-list@inria.fr
Subject: RE: [Caml-list] bytecode: ./prog vs ocamlrun ./prog
Date: Sun, 18 Dec 2011 13:30:25 +0900	[thread overview]
Message-ID: <-3085435649396878115@unknownmsgid> (raw)

This basically means that you have 2 ocamlrun on this machine.
./prog calls ocamlrun with a fixed path, but the 1st ocamlrun is your
path is an incompatible one.
Do "head -1 prog" to see the right ocamlrun.

Jacques Garrigue

-----
From: Dmitry Grebeniuk <gdsfh1@gmail.com>

Hello.

  The OCaml manual states that executing bytecode program
with "./prog" and "ocamlrun ./prog" should give the same result
(in simple case, without options and environment modifications).
  However in my case the result is different: "./prog" executes
well, but "ocamlrun ./prog" gives
"Fatal error: unknown C primitive `unix_dup'".

  But I have no good minimal case (other small unix.cma-dependent
programs run fine both ways), and I can't show the full sources due
to my contract with employer.
  I suspect this issue can give me additional headache in the future,
so I prefer to solve it now.

  How can I find the source of this problem?

  What I have checked for now:
- host OS is linux (gentoo, fresh enough)
- the host contains (and contained ever) only one OCaml installation
  (3.11.2), and I can't install more recent OCaml versions
  system-wide (and I want this program to work under system-wide
  3.11.2 anywhere)
- ocaml toplevel doesn't fail on "#load "unix.cma"" and on calls to
  functions of Unix module
- this system doesn't provide ocamlobjinfo, so I can't read its output
- the program is built with ocamlbuild, without custom myocamlbuild.ml
  and other C-specific options, however some libraries may use
  C bindings (I'll check this if it is important)
- I've tried to set environment variable LD_DEBUG=libs and run
  both cases: "ocamlrun ./prog" output is pasted to
  http://paste.in.ua/3499/raw/ , "./prog" output is pasted to
  http://paste.in.ua/3500/raw/ , but I don't understand where
  the problem is, even after meditation on these logs

  What should I do to diagnose this problem?

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

             reply	other threads:[~2011-12-18  4:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18  4:30 Jacques Garrigue [this message]
2011-12-18 15:20 ` oliver
2011-12-18 15:39 ` Dmitry Grebeniuk
2011-12-18 15:53   ` Gerd Stolpmann
2011-12-18 16:40     ` Dmitry Grebeniuk
2011-12-18 16:49       ` Gerd Stolpmann
  -- strict thread matches above, loose matches on Subject: below --
2011-12-18  1:19 Dmitry Grebeniuk

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=-3085435649396878115@unknownmsgid \
    --to=jacques.garrigue@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=gdsfh1@gmail.com \
    /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).