caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christoph Sticksel <christoph@sticksel.info>
To: caml-list@inria.fr
Subject: [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native  extension
Date: Thu, 20 Jun 2013 15:05:29 -0500	[thread overview]
Message-ID: <51C36089.5060109@sticksel.info> (raw)
In-Reply-To: <6ea38e78-0086-4e12-a168-2f0953acf0ee@googlegroups.com>

Hi all,

I have an ocamlbuild project where I keep some modules in a package and 
that compiles all fine as .native or .byte. However, once I want to 
compile it to native profiling .p.native, it fails with

| Error: File SExpr/stringSExpr.p.cmx was compiled without access
|        to the .cmx file for module SExprBase,
|        which was produced by `ocamlopt -for-pack'.
|        Please recompile SExpr/stringSExpr.p.cmx with the correct `-I' 
option
|        so that SExprBase.cmx is found.

although ocamlbuild does add -I SExpr to the compile commands.

The only thing I could find is a six year old question on fa.caml, which 
describes exactly the problem I am facing and includes a minimal example 
that still fails for me, see below.

Can anybody shed some light on that? Is this issue still open?

Thanks,
Christoph


On Monday, November 19, 2007 3:59:52 PM UTC-6, rvanmelle wrote:

     We been happily (mostly) using ocamlbuild for our project, but we've
     been running into this puzzling problem building .p.native targets
     when the modules are packed using the -for-pack tag.

     I boiled it down to this relatively simple test case which exhibits
     the problem.  I was hoping that somebody might have seen this problem
     and/or have a workaround or fix... or simply point out the silly
     mistake we are making.  The complete set of files for this simple
     project are shown below, along with sample usage/output exhibiting the
     problem:

     ****************

     foo/foo.ml <http://foo.ml>:
     let _ =
         let x = Bar.bar () in
         Printf.printf "%g\n%!" (x +. 3.0)

     foo/bar.ml <http://bar.ml>:
     let bar () = 5.

     foo/_tags:
     <foo.p.cmx>: for-pack(Pho)
     <bar.p.cmx>: for-pack(Pho)

     foo/pho.mlpack:
     Foo
     Bar

     $ ocamlbuild foo/foo.native
     Finished, 7 targets (7 cached) in 00:00:00.
     $ ./foo.native
     8
     $ ocamlbuild foo/foo.p.native
     + /opt/local/bin/ocamlopt.opt -p foo/bar.p.cmx foo/foo.p.cmx -o foo/
     foo.p.native
     File foo/foo.p.cmx was compiled without access to the .cmx file
     for module Bar, which was produced by `ocamlopt -for-pack'.
     Please recompile foo/foo.p.cmx with the correct `-I' option so that
     Bar.cmx
     is found.
     Command exited with code 2.
     Compilation unsuccessful after building 7 targets (6 cached) in
     00:00:00.


     Hope somebody can help

     - Reid



       reply	other threads:[~2013-06-20 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6ea38e78-0086-4e12-a168-2f0953acf0ee@googlegroups.com>
2013-06-20 20:05 ` Christoph Sticksel [this message]
2013-06-20 22:02   ` Gabriel Scherer
2013-06-21  1:01     ` Christoph Sticksel

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=51C36089.5060109@sticksel.info \
    --to=christoph@sticksel.info \
    --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).