<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/f7834e5f03c9c2ed81ae090ad7a53a08"
  from="Grant Monroe &lt;grant@j...&gt;"
  author="Grant Monroe"
  date="2006-02-03T19:20:41"
  subject="Compiling pycaml shared library"
  prev="2006/02/cc10da4a97264e6ce2e2036802b6fb15"
  next="2006/02/ff255006fdbc8411f759a2c416b3c1c5"
  next-in-thread="2006/02/d9dacc91f57de0b9e0ced7f34e43b42c"
  prev-thread="2006/02/76caa78dff1e9412838a7f6e36883e86"
  next-thread="2006/02/ff255006fdbc8411f759a2c416b3c1c5"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Compiling pycaml shared library">
<msg 
  url="2006/02/f7834e5f03c9c2ed81ae090ad7a53a08"
  from="Grant Monroe &lt;grant@j...&gt;"
  author="Grant Monroe"
  date="2006-02-03T19:20:41"
  subject="Compiling pycaml shared library">
<msg 
  url="2006/02/d9dacc91f57de0b9e0ced7f34e43b42c"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-04T14:07:56"
  subject="Re: [Caml-list] Compiling pycaml shared library">
</msg>
<msg 
  url="2006/02/7e300c426542abe782eacb5f19f9c4b2"
  from="Vsevolod Fedorov &lt;sevaAtWork@m...&gt;"
  author="Vsevolod Fedorov"
  date="2006-02-06T10:36:49"
  subject="Re: [Caml-list] Compiling pycaml shared library">
<msg 
  url="2006/02/f7ab4eac1187c3d3f9ea24d30daffada"
  from="Grant Monroe &lt;grant@j...&gt;"
  author="Grant Monroe"
  date="2006-02-06T18:10:39"
  subject="Re: [Caml-list] Compiling pycaml shared library">
</msg>
</msg>
</msg>
</thread>

<contents>
Hello All,
I'm trying to figure out how to compile a simple shared library (.so)
using pycaml that I can load from the python interpreter. I have a
single .ml file who's contents are as follows:


open Pycaml

let foo_bar_print = pywrap_closure (fun x -&gt; print_endline "hi" ; pynone ()) ;;
let sd = pyimport_getmoduledict () ;;
let mx = pymodule_new "CamlModule" ;;
let cd = pydict_new () ;;
let cx = pyclass_new (pynull (), cd, pystring_fromstring "CamlClass") ;;
let cmx = pymethod_new (foo_bar_print,(pynull ()),cx) ;;
let _ = pydict_setitemstring (cd, "CamlMethod", cmx) ;;
let _ = pydict_setitemstring (pymodule_getdict mx, "CamlClass", cx) ;;
let _ = pydict_setitemstring (sd, "CamlModule", mx) ;;


I'm new to ocaml so basically I want to know what commands to run with
which flags and what libraries need to be linked to and how. Any help
would be appreciated.

Grant Monroe
JanRain, Inc.

P.S. - I tried sending the project creator a message, but the email
address listed on the page seems to have expired.
</contents>

</message>

