From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA14731; Tue, 4 Nov 2003 14:52:10 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA15045 for ; Tue, 4 Nov 2003 14:52:08 +0100 (MET) Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.130.26]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA4Dq8117526 for ; Tue, 4 Nov 2003 14:52:08 +0100 (MET) Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id 2F8FAFAB7 for ; Tue, 4 Nov 2003 14:52:08 +0100 (CET) Received: from smtp.irisa.fr ([131.254.130.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09264-05 for ; Tue, 4 Nov 2003 14:52:07 +0100 (CET) Received: from IRISA.fr (buffle.irisa.fr [131.254.13.24]) by smtp.irisa.fr (Postfix) with ESMTP id D0658FAB3 for ; Tue, 4 Nov 2003 14:52:07 +0100 (CET) Message-ID: <3FA7AF07.1080207@IRISA.fr> Date: Tue, 04 Nov 2003 14:52:07 +0100 From: Mathieu Avila Reply-To: mavila@irisa.fr User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.5) Gecko/20031007 X-Accept-Language: fr, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] ocaml_startup et Solaris/x86 References: <3FA60A42.3040707@IRISA.fr> <20031104100910W.garrigue@kurims.kyoto-u.ac.jp> In-Reply-To: <20031104100910W.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at irisa.fr X-Loop: caml-list@inria.fr X-Spam: no; 0.00; mathieu:01 caml-list:01 jacques:01 mathieu:01 flags:01 86.:01 crashes:01 libs:01 langages:01 callback:01 val:01 callback:01 val:01 ecrit:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 >problem. > 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 : cmain.ml: -------------------------------------------------------- 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. -- Mathieu ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners