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 WAA27735 for caml-redistribution; Sun, 16 Jan 2000 22:28:48 +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 OAA12569 for ; Sat, 15 Jan 2000 14:34:14 +0100 (MET) Received: from ruby (kenny5.zip.com.au [61.8.18.133]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id OAA11484 for ; Sat, 15 Jan 2000 14:34:06 +0100 (MET) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by ruby (8.9.3/8.9.3) with ESMTP id NAA31105 for ; Sat, 15 Jan 2000 13:14:48 +1100 Sender: weis Message-ID: <387FD815.6FF50F15@maxtal.com.au> Date: Sat, 15 Jan 2000 13:14:45 +1100 From: skaller Organization: Maxtal X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.12 i586) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Dynamic loading and building of shared libraries References: <000c01bf51e0$ef8295a0$250148bf@vega> <20000113103240.36062@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I have a need to load sets of ocaml functions at run time in Viper using dlopen: this requirement arises from Python's ability to dynamically load C extension modules: Viper emulates this by loading text files which provide equivalent functionality, but these files must use native functions to provide the functionality. At the moment, these functions must be statically linked into the interpreter, which is not really acceptable. It should be easy to provide a C factory function in a shared library that returns a table of functions: my question is, how to tell ocaml to link a shared library, rather than a main executable. How do I do this? If not, can a way be devised to tell ocamlopt to do it? Or is there a reasone it isn't possible? -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 homepage: http://www.maxtal.com.au/~skaller download: ftp://ftp.cs.usyd.edu/au/jskaller