Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] ocaml_startup et Solaris/x86
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Mathieu Avila <mavila@i...>
Subject: Re: [Caml-list] ocaml_startup et Solaris/x86
Jacques Garrigue a écrit :

>From: Mathieu Avila <>
>>I'd like to know whether there are known problems when mixing C and 
>>OCaml on the  Solaris/x86 platform.
>>The doc deals with particular flags to add for compiling on NT and 
>>Digital Unix on the Alpha, but there's nothing written for x86. I have a 
>>user of one of our tool written in Ocaml, who uses this platform and who 
>>informs us that the software crashes when it comes to call 
>>ocaml_startup, although everything goes right on solaris/sparc. Has this 
>>configuration been tested before ?
>>Thanks in advance !
>I'm using ocaml on Solaris8/x86, and many C libraries, with no
Are you able to call the ocaml code from the C ? I think this is rather 
different from calling C libs from a standalone OCaml code.
In my case, i mix the 2 langages in this way :
let cmain_ocaml n = try

let _ = Callback.register "cmain_ocaml" cmain_ocaml

in a cmain_cpp.cpp , where there is the "real" main() function:
 static value * cmain_closure = NULL;
 if (cmain_closure==NULL)
   cmain_closure = caml_named_value("cmain_ocaml");
 result = Int_val(callback(*cmain_closure,Val_int(n)));

It crashses when calling :  callback(*cmain_closure...)

All is compiled into native solaris object code.
The same thing works perfectly on solaris/sparc.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: