[gambit-list] Cython __cleanup() problem
David Dreisigmeyer
dwdreisigmeyer at gmail.com
Wed Jan 5 17:19:50 EST 2011
All of my code is attached if anyone wants to take a look at it. The
makefile assumes that Gambit is installed in /usr/local/Gambit-C and
that cython is installed. Here's an example ipython session:
In [4]: import gambit
In [5]: gambit.setup ()
Gambit-C setup successful
In [6]: gambit.gamval ("(+ 1 2)")
Gambit-C > 3
In [7]: gambit.cleanup ()
Trying Gambit-C cleanup
Process Python exited abnormally with code 1
Thanks again,
-Dave
On Wed, Jan 5, 2011 at 4:14 PM, Marc Feeley <feeley at iro.umontreal.ca> wrote:
>
> On 2011-01-05, at 4:09 PM, David Dreisigmeyer wrote:
>
>> The "sudo dtruss ipython" prints out a whole bunch of stuff but never
>> allows me to use a prompt. I tried it with python also but it doesn't
>> start.
>>
>> There was an fflush(stdout) in the C code before the call to
>> __cleanup(). This code works as long as __cleanup() is commented out:
>>
>> void gambit_eval( char *in_str )
>> {
>> char *temp;
>>
>> temp = eval_string (in_str);
>> if (temp != 0){
>> printf ("Gambit-C > %s", temp);
>> } else {
>> printf ("Error: temp == 0");
>> }
>> ___release_string (temp);
>> fflush (stdout);
>> ___cleanup ();
>> }
>
> Wait... are you calling ___cleanup() every time you evaluate something?
>
> That won't work! The call to ___setup(...) is balanced by a call to ___cleanup(). In between those calls, you can call Scheme functions (such as eval_string).
>
> Marc
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cython_gambit.tgz
Type: application/x-gzip
Size: 2480 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20110105/9dd78ba8/attachment.bin>
More information about the Gambit-list
mailing list