caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* help with ocaml makefiles
@ 2010-11-18  7:43 rixed
  2010-11-19 12:14 ` [Caml-list] " Eric Cooper
  2010-11-19 15:13 ` Anil Madhavapeddy
  0 siblings, 2 replies; 3+ messages in thread
From: rixed @ 2010-11-18  7:43 UTC (permalink / raw)
  To: caml-list

Each time I need more debug information for the ocaml runtime itself
(which hopefully is not often) I recompile Ocaml adding various "-g"
and "-O0" here and there in some makefiles.

But I've noticed there are some special targets and rules, specifically in
byterun/Makefile, that seams to be there for that very purpose (the suffix
rules for .d.c extention). So I suppose there is a standard way to
compile ocaml in debugging mode.

Do someone have some knowledge to share about this ?


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

* Re: [Caml-list] help with ocaml makefiles
  2010-11-18  7:43 help with ocaml makefiles rixed
@ 2010-11-19 12:14 ` Eric Cooper
  2010-11-19 15:13 ` Anil Madhavapeddy
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Cooper @ 2010-11-19 12:14 UTC (permalink / raw)
  To: caml-list, caml-list

On Thu, Nov 18, 2010 at 08:43:28AM +0100, rixed@happyleptic.org wrote:
> Each time I need more debug information for the ocaml runtime itself
> (which hopefully is not often) I recompile Ocaml adding various "-g"
> and "-O0" here and there in some makefiles.

See the description of how to build "ocamlrund" in the INSTALL file.

-- 
Eric Cooper             e c c @ c m u . e d u


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

* Re: [Caml-list] help with ocaml makefiles
  2010-11-18  7:43 help with ocaml makefiles rixed
  2010-11-19 12:14 ` [Caml-list] " Eric Cooper
@ 2010-11-19 15:13 ` Anil Madhavapeddy
  1 sibling, 0 replies; 3+ messages in thread
From: Anil Madhavapeddy @ 2010-11-19 15:13 UTC (permalink / raw)
  To: rixed; +Cc: caml-list

On 18 Nov 2010, at 07:43, rixed@happyleptic.org wrote:

> Each time I need more debug information for the ocaml runtime itself
> (which hopefully is not often) I recompile Ocaml adding various "-g"
> and "-O0" here and there in some makefiles.
> 
> But I've noticed there are some special targets and rules, specifically in
> byterun/Makefile, that seams to be there for that very purpose (the suffix
> rules for .d.c extention). So I suppose there is a standard way to
> compile ocaml in debugging mode.
> 
> Do someone have some knowledge to share about this ?

The C files in byterun/ are compiled with and without debug/profiling, and the following files are created:
- libasmrun.a  (normal)
- libasmrunp.a (profiling)
- libasmrund.a (debug)

Only the normal and profiling ones are installed by default. You can grab the debug version from your ocaml build tree and link against it manually, with something like:

$ ocamlopt -output-obj -i foo.o foo.ml 
$ cc -lasmrund -lm -o foo foo.o

It'd be convenient to have a compiler option to select libasmrund without having to go via -output-obj (as "-p" does for profiling); the code for this is in asmcomp/asmlink.ml:runtime_lib().

Anil

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

end of thread, other threads:[~2010-11-19 15:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18  7:43 help with ocaml makefiles rixed
2010-11-19 12:14 ` [Caml-list] " Eric Cooper
2010-11-19 15:13 ` Anil Madhavapeddy

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