Version française
Home     About     Download     Resources     Contact us    
Browse thread
Unix module troubles & Time functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Julien Michel <julien.michel@e...>
Subject: Unix module troubles & Time functions
Hi all,
I would like to measure the time a function spends inside a Caml program, for
performance purpose.
I need a function with an accuracy of at least 1us.
I usually use \"gettimeofday\" to achieve this kind of measures with Unix.

So I would like to use the Unix.gettimeofday() function which I expect to have
the same accuracy than the unix one.

I work on an embedded system and I had to specially compile ocamlrun for this
target.

I first tried to compile the sources from my developpement plateform this way:
ocamlc -o main unix.cma *.ml...

then I executed the generated byecode on my embedded target ad got the following
error:
Fatal error: cannot load shared library dllunix
Reason: /usr/local/lib/ocaml/stublibs/dllunix.so: cannot open shared object
file: No such file or directory

whereas, \"dllunix.so\" exists well and the path to raise it is good too!


if I try to compile this way:
ocamlc -o main -cclib -lunix unix.cma *ml
I get the same error as in the message above.


and trying to compile this way:
ocamlc -custom -o main unix.cma *ml
returns this error while executing on my target:
Fatal error: unknown C primitive `unix_dup\'

What can be wrong with my system so that I cannot use the Unix.module?
The Gettimeofday unix function usually works well on my target, is there another
way for having access to it with Caml?

Or generally speaking, does any other function exists to achieve such a
measurement (accuracy about 1 us) ?


Thanks to all

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.