From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA16305 for caml-redistribution; Mon, 17 Jan 2000 11:34:58 +0100 (MET) 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 IAA31185 for ; Mon, 17 Jan 2000 08:59:19 +0100 (MET) Received: from muguet.saclay.cea.fr (muguet.saclay.cea.fr [132.166.192.6]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id IAA20651 for ; Mon, 17 Jan 2000 08:59:17 +0100 (MET) Received: from harpie.saclay.cea.fr (harpie.saclay.cea.fr [132.166.133.152]) by muguet.saclay.cea.fr (8.9.1a/8.9.1/CEAnet-relay-5.1.D20+Y2K) with ESMTP id IAA13782; Mon, 17 Jan 2000 08:58:45 +0100 (MET) Received: by harpie.saclay.cea.fr (8.8.8+Sun/CEANET.2.0.1) id JAA01667; Mon, 17 Jan 2000 09:00:18 +0100 (MET) From: STARYNKEVITCH Basile MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Message-ID: <14466.52242.355625.339910@gargle.gargle.HOWL> Date: Mon, 17 Jan 2000 09:00:18 +0100 (MET) To: skaller CC: caml-list@inria.fr Subject: Dynamic loading and building of shared libraries In-Reply-To: <387FD815.6FF50F15@maxtal.com.au> References: <000c01bf51e0$ef8295a0$250148bf@vega> <20000113103240.36062@pauillac.inria.fr> <387FD815.6FF50F15@maxtal.com.au> X-Mailer: VM 6.75 under Emacs 20.5.1 Content-Transfer-Encoding: 8bit Sender: weis >>>>> "skaller" == skaller writes: skaller> I have a need to load sets of ocaml functions at run time skaller> in Viper using dlopen [...] skaller> At the moment, these functions must be statically linked skaller> into the interpreter, which is not really acceptable. skaller> It should be easy to provide a C factory function in a skaller> shared library that returns a table of functions: my skaller> question is, how to tell ocaml to link a shared library, skaller> rather than a main executable. skaller> How do I do this? If not, can a way be devised to tell skaller> ocamlopt to do it? Or is there a reasone it isn't skaller> possible? Dynamically loaded shared objects are usually made with position independent code. This requires that the ocamlopt code generator follows some (perhaps tricky) coding conventions (which might also require some changes in the runtime GC system) I agree with John Skaller that dynamic library support in ocamlopt would be nice. Regards N.B. Any opinions expressed here are only mine, and not of my organization. N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA. --------------------------------------------------------------------- Basile STARYNKEVITCH ---- Commissariat à l Energie Atomique DTA/LETI/DEIN/SLA * CEA/Saclay b.528 (p111f) * 91191 GIF/YVETTE CEDEX * France phone: 1,69.08.60.55; fax: 1.69.08.83.95 home: 1,46.65.45.53 email: Basile point Starynkevitch at cea point fr