I should have mentioned that neither printf nor sleep work if, e.g., I
modify the Gambit-C source code like the following (in
gambit/lib/setup.c):


___EXP_FUNC(void,___cleanup) ___PVOID
{
  /*
   * Only do cleanup once after successful setup.
   */

printf ("setup_state : %i \n" , setup_state);
fflush (stdout);
sleep(30);
  if (setup_state != 1)
    return;

  setup_state = 2;

  ___cleanup_mem ();
  ___cleanup_os ();
}


On Thu, Jan 13, 2011 at 2:38 PM, David Dreisigmeyer
<dwdreisigme...@gmail.com> wrote:
> Hi everyone,
>
> I've been having problem trying to use Gambit-C scheme in Python.
> Everything works fine if I compile Gambit-C alone and run it.  But if
> I try to combine it with Cython to make a extension it doesn't work.
> I've been working on the problem with the Gambit-C folks and was
> hoping there might be some suggestions on the Python side.  I've
> attached my code -- just run make.  To run the standalone created by
> Cython:
>
> $ ./server_setup
>
> -----------------------------------------------------------------------------------------------------------------
>
> Here's a typical Python session:
>
> Process Python finished
> Python 2.7.1 (r271:86832, Dec 29 2010, 01:38:09)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.10.1 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
>
> In [2]: import gambit
>
> In [3]: gambit.cleanup ()
> Gambit-C cleanup complete
>
> In [4]: gambit.setup ()
> Gambit-C setup successful
>
> In [5]: gambit.cleanup ()
>
> Process Python exited abnormally with code 1
>
> -----------------------------------------------------------------------------------------------------------------
>
> This is on OS X 10.6.6 with gcc-4.2, Cython 0.14, Python 2.7.1 and
> Gambit-C 4.6.0 from git.  To install Gambit-C see:
>
> http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Contributing_Patches_to_Gambit_Source_Code
>
> or maybe http://www.iro.umontreal.ca/~gambit/download/gambit/v4.6/prebuilt/
> , though I'm using the above.  Macports might work also.
>
_______________________________________________
Cython-dev mailing list
Cython-dev@codespeak.net
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to