From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id B697C7ED33 for ; Tue, 19 Jun 2012 16:30:49 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvcBAFaM4E/RVdy2mGdsb2JhbABFrGoBiGEIIgEBAQEBCAkNBxQngjECExkBGx4DEhBdAREBBQEiNYdaAQMLl2WCYQkDjCGCcIVBChknDVeIcQEFDJE8A5UlgRKJb4MfPoQB X-IronPort-AV: E=Sophos;i="4.75,798,1330902000"; d="scan'208";a="148140780" Received: from mail-vc0-f182.google.com ([209.85.220.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Jun 2012 16:30:48 +0200 Received: by vcbfy7 with SMTP id fy7so5646686vcb.27 for ; Tue, 19 Jun 2012 07:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=i2Alv25XdwXP06ttWX32JblibtsOvE4/92ncLHoEIuc=; b=yY8ddE6U7x6YETAGEMHFJkrjgCcS94inOUn1x3tiMYIvfJ2nOtOWCrHzUnYT/G+Wp7 qI8eDF98wN9RJuWZjgFhehig/OXOCFn2XtJxJGl4bXbfF2vqibhB/sfQgVez8DNQSj1i 4n64MFJEwPNBfi2eXrDmGDaxCOL2+0hToJRyIu5suuVF2AgPY6WGemcJIyZ7pLpKXoLj +WOj9hPeAxJMd9bfG/a3fyfo0po7p55+ODVqf1RI6ALc64jKRE8/Bp2LABQwD/IliH7l WenplQmr4wkH0gwk5bn7+1MWWnTvRzKM9rj9Ryr1VnNB+pPEUu6MqZ6VF0NdLtp1sA+/ 4KdA== Received: by 10.52.96.135 with SMTP id ds7mr7947104vdb.50.1340116247838; Tue, 19 Jun 2012 07:30:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.159.104 with HTTP; Tue, 19 Jun 2012 07:30:27 -0700 (PDT) From: Philippe Veber Date: Tue, 19 Jun 2012 16:30:27 +0200 Message-ID: To: caml users Content-Type: multipart/alternative; boundary=20cf307f3b8ee900b104c2d420ab X-Validation-by: philippe.veber@gmail.com Subject: [Caml-list] Strange compilation error. --20cf307f3b8ee900b104c2d420ab Content-Type: text/plain; charset=ISO-8859-1 Dear camlers, I'm desperately stuck with the following issue: I fail to compile a program using a module, but have no problem using the module in question in the toplevel. Here is how I use it in the toplevel $ ocaml Objective Caml version 3.12.1 # #directory "/home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R";; # #load "/home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R/ R_math.cma";; # Rmath.pow;; - : float -> float -> float = Now with the following program: $ cat test.ml let x = Rmath.pow 2. I try to compile with the options corresponding to the toplevel directives: $ ocamlc -o rmath -I /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R/R_math.cma test.ml File "test.ml", line 1, characters 8-17: Error: Unbound module Rmath I'm missing something obvious, but I can't see what. Does it remind someone of something? Cheers, Philippe. PS There should be nothing fancy in my installation: $ which ocaml /home/pveber/usr/ocamlbrew/ocaml-3.12.1/bin/ocaml $ which ocamlc /home/pveber/usr/ocamlbrew/ocaml-3.12.1/bin/ocamlc $ head -n 1 /home/pveber/usr/ocamlbrew/ocaml-3.12.1/bin/ocaml #!/home/pveber/usr/ocamlbrew/ocaml-3.12.1/bin/ocamlrun PS2 I have no compilation problem with other modules/libraries, as shown by the following session. I encounter (and solve) all usual compilation errors, the way I'm used to. $ cat test.ml let _ = R.init $ ocamlc -o test test.ml File "rmath.ml", line 1, characters 8-14: Error: Unbound module R $ ocamlc -o rmath -I /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R rmath.ml File "rmath.ml", line 1, characters 0-1: Error: Error while linking rmath.cmo: Reference to undefined global `R' $ ocamlc -o rmath -I /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R R.cma rmath.ml File "rmath.ml", line 1, characters 0-1: Error: Error while linking /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R/R.cma(Initialisation): Reference to undefined global `Unix' $ ocamlc -o rmath -I /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R unix.cma R.cma rmath.ml $./rmath [...] --20cf307f3b8ee900b104c2d420ab Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Dear camlers,

I'm desperately stuck with the following issue: I = fail to compile a program using a module, but have no problem using the mod= ule in question in the toplevel.

Here is how I use it in the topleve= l

$ ocaml
=A0=A0=A0=A0=A0=A0=A0 Objective Caml version 3.12.1<= br style=3D"font-family:courier new,monospace">
# #directory "/home/pveber/usr/ocamlbrew/ocaml-= 3.12.1/lib/ocaml/site-lib/R";;
# #load "/home/pveber/usr/ocamlbrew/oc= aml-3.12.1/lib/ocaml/site-lib/R/R_math.cma";;
# Rmath.pow;;
- : float -> float -> float =3D <fun><= br style=3D"font-family:courier new,monospace">

Now with the following program:
$ cat test.ml
let x =3D Rmath.pow 2.

I try to compile with the options corresponding to the toplevel directi= ves:

$ ocamlc -o r= math -I /home/pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R /home/= pveber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R/R_math.cma test.ml
File "test.ml", line 1, characters 8-17:
Error: Unbound module Rmath

I'm missing something obvious, but I can't see what. Does it re= mind someone of something?

Cheers,
=A0 Philippe.

PS There = should be nothing fancy in my installation:

$ which ocaml
/home/pveber/usr/ocamlbre= w/ocaml-3.12.1/bin/ocaml
$ which ocamlc=
/home/pveber/usr/ocamlbre= w/ocaml-3.12.1/bin/ocamlc
$ head -n 1 /home/pv= eber/usr/ocamlbrew/ocaml-3.12.1/bin/ocaml
#!/home/pveber/usr/ocamlb= rew/ocaml-3.12.1/bin/ocamlrun

PS2 I have no compilation probl= em with other modules/libraries, as shown by the following session. I encou= nter (and solve) all usual compilation errors, the way I'm used to.

$ cat test.ml
let _ =3D R.init
$ ocamlc -o test=A0 test.ml
File "<= a href=3D"http://rmath.ml">rmath.ml", line 1, characters 8-14:
Error: Unbound module R
$ ocamlc -o rmath -I /home/pveber/usr/ocamlbrew= /ocaml-3.12.1/lib/ocaml/site-lib/R rmath.ml=
File "rmath.ml", line 1, characters 0-1:
Error: Error while linking rmath.cmo:
Reference to undefined gl= obal `R'
$ ocamlc -o rmath -I /home/pveber= /usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R R.cma rmath.ml
File "rmath.ml", line 1, characters 0-1:
Error: Error while linking /home/pveber/usr/ocamlbrew/ocaml-3= .12.1/lib/ocaml/site-lib/R/R.cma(Initialisation):
Reference to undefined gl= obal `Unix'
$ ocamlc -o rmath -I /home/pve= ber/usr/ocamlbrew/ocaml-3.12.1/lib/ocaml/site-lib/R unix.cma R.cma rmath.ml

$./rmath [...]



--20cf307f3b8ee900b104c2d420ab--