caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native  extension
       [not found] <6ea38e78-0086-4e12-a168-2f0953acf0ee@googlegroups.com>
@ 2013-06-20 20:05 ` Christoph Sticksel
  2013-06-20 22:02   ` Gabriel Scherer
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Sticksel @ 2013-06-20 20:05 UTC (permalink / raw)
  To: caml-list

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native extension
  2013-06-20 20:05 ` [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native extension Christoph Sticksel
@ 2013-06-20 22:02   ` Gabriel Scherer
  2013-06-21  1:01     ` Christoph Sticksel
  0 siblings, 1 reply; 3+ messages in thread
From: Gabriel Scherer @ 2013-06-20 22:02 UTC (permalink / raw)
  To: Christoph Sticksel; +Cc: caml-list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native extension
  2013-06-20 22:02   ` Gabriel Scherer
@ 2013-06-21  1:01     ` Christoph Sticksel
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Sticksel @ 2013-06-21  1:01 UTC (permalink / raw)
  To: caml-list

On 06/20/2013 05:02 PM, Gabriel Scherer wrote:
> 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).

Yes, that worked. Not too bad a workaround either, since everything gets 
recompiled when I add or omit the -tag profile flag. That means there is 
no mix-up between object files with or without profiling information.

Thanks for the quick response.

Christoph

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-21  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6ea38e78-0086-4e12-a168-2f0953acf0ee@googlegroups.com>
2013-06-20 20:05 ` [Caml-list] ocamlbuild: problem building -for-pack targets with .p.native extension Christoph Sticksel
2013-06-20 22:02   ` Gabriel Scherer
2013-06-21  1:01     ` Christoph Sticksel

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