From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Christoph Sticksel <christoph@sticksel.info>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native extension
Date: Fri, 21 Jun 2013 00:02:54 +0200 [thread overview]
Message-ID: <CAPFanBE445oE6HidxPvTwBy7kSvgO7r-2QrPRs_XZLh0xL4R_A@mail.gmail.com> (raw)
In-Reply-To: <51C36089.5060109@sticksel.info>
This is a known bug due to the fact that the compiler looks for module
of the exact name "foo.cmx", while ocamlbuild produces "foo.p.cmx".
http://caml.inria.fr/mantis/view.php?id=4574
I suppose you can workaround this issue by using the usual ".native"
target instead of ".p.native", adding (-tag profile) to the ocamlbuild
invocation line (or "true: profile" in your tags).
On Thu, Jun 20, 2013 at 10:05 PM, Christoph Sticksel
<christoph@sticksel.info> wrote:
> 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
>
>
>
> --
> Caml-list mailing list. Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
next prev parent reply other threads:[~2013-06-20 22:03 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
2013-06-20 22:02 ` Gabriel Scherer [this message]
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=CAPFanBE445oE6HidxPvTwBy7kSvgO7r-2QrPRs_XZLh0xL4R_A@mail.gmail.com \
--to=gabriel.scherer@gmail.com \
--cc=caml-list@inria.fr \
--cc=christoph@sticksel.info \
/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