<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    A small update. I went back a couple of versions on mono, to see if
    that's got anything to do with my problems.<br>
    <br>
    Starting from a clean VM. I simplified the build process a bit as
    well.<br>
    <br>
    I managed to get clr.so working fine with python2.5.5 and using
    mono2.4.3, when running it using the standalone python installation.<br>
    <br>
    <br>
    However, when i try to import clr into an embedded python (like the
    one in Nuke5.2 for example), i get the following error:<br>
    <br>
    Stacktrace:<br>
    <br>
    &nbsp; at (wrapper managed-to-native)
    Python.Runtime.Runtime.PyInt_FromLong (intptr) &lt;0x00060&gt;<br>
    &nbsp; at (wrapper managed-to-native)
    Python.Runtime.Runtime.PyInt_FromLong (intptr) &lt;0xffffffff&gt;<br>
    &nbsp; at Python.Runtime.Runtime.PyInt_FromInt32 (int) &lt;0x00023&gt;<br>
    &nbsp; at Python.Runtime.Runtime.Initialize () &lt;0x00303&gt;<br>
    &nbsp; at Python.Runtime.PythonEngine.Initialize () &lt;0x0004b&gt;<br>
    &nbsp; at (wrapper runtime-invoke) object.runtime_invoke_void
    (object,intptr,intptr,intptr)
    &lt;0xffffffff&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;<br>
    <br>
    Native stacktrace:<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libmono.so.0 [0x2aaab409088d]<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libmono.so.0 [0x2aaab40c0a33]<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /lib64/libc.so.6 [0x39568302d0]<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/lib/libpython2.5.so(PyInt_FromLong+0x1c)
    [0x2aaab48fdf5c]<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [0x40fad6a0]<br>
    <br>
    <br>
    I noticed that Ulrich Elk had this issue about 2 years ago, and
    Brian Lloyd's first reaction was "are you on a 64bit machine?".
    Well, i am :-)<br>
    All the libraries i use are 64b (at least i think so, i built most
    requirements myself).<br>
    <br>
    (
    <a class="moz-txt-link-freetext" href="http://mail.python.org/pipermail/pythondotnet/2008-April/000795.html">http://mail.python.org/pipermail/pythondotnet/2008-April/000795.html</a>
    )<br>
    <br>
    <br>
    <br>
    cheers,<br>
    laszlo<br>
    <br>
    <br>
    <br>
    <br>
    On 06/12/2010 5:22 PM, Laszlo Sebo wrote:
    <blockquote cite="mid:4CFD8C3A.4060206@primefocusworld.com"
      type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      Hi there,<br>
      <br>
      <br>
      I've been trying to get Python.Net working for the last couple
      weeks on linux (using rev 110), and so far i haven't had much
      luck. Maybe i am using libraries that are not yet supported, so
      any help would be appreciated.<br>
      <br>
      I am using centOS 5.5, and python 2.5.1 64bit. I am using the
      latest (2.8.1) version of mono.<br>
      <br>
      To get python.net to build, i had to modify a couple of files, as
      by default it wouldn't build. First I had to build and install&nbsp;
      glib (2.26.1), then do the following:<br>
      <br>
      Add these lines to the setup.py (most likely my glib installation
      wasn't doing its setup properly)<br>
      <pre>kw["include_dirs"].append('/usr/local/include/glib-2.0')
kw["include_dirs"].append('/usr/local/lib/glib-2.0/include')
</pre>
      Then edit the pynetclr.h file and add this line:<br>
      <pre>#include &lt;gmodule.h&gt;

</pre>
      Then edit the makefile for monoclr:<br>
      <pre>add include files to PY_CFLAGS variable: -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
MONO_LIBS = $(shell pkg-config --libs mono-2)
MONO_CFLAGS = $(shell pkg-config --cflags mono-2)
add clrpython.o to clr.so make: -dynamiclib pynetinit.o clrmod.o clrpython.o -o clr.so
remove -lpython from the PY_LIBS listing
</pre>
      After this everything built without errors. However... the clr.so
      files don't quite work :)<br>
      <br>
      I get 3 behaviours:<br>
      <ul>
        <li>if i use the clr.so in the root folder: import clr; import
          System; =&gt; segmentation fault</li>
        <li>if i use the clr.so in the monoclr folder: ImportError:
          /usr/local/lib/python2.5/site-packages/clr.so: cannot
          dynamically load executable</li>
        <li>if i use the clr.so in the root folder, and also copy the
          libpython2.5.so in the site-packages folder: import clr =&gt;
          segmentation fault</li>
      </ul>
      Not sure what i'm doing wrong to be honest. I'll try to roll back
      mono a couple versions, and try that (2.4.3 maybe).<br>
      <br>
      I have a feeling i am missing something very obvious here...<br>
      <br>
      Any pointers would be appreciated!<br>
      <br>
      <br>
      cheers,<br>
      laszlo sebo<br>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>