It is currently Sat Jan 20, 2018 5:07 am Advanced search

adding c extensions to python code

Code won't compile? Found a bug? Post here!

adding c extensions to python code

Postby drasmuss » Sat Feb 20, 2010 6:19 pm

I've been trying to add some c extensions to my python code. I'm just doing it in the usual way, compiling using Cython and then importing the *.pyd files. I've tried this on several different machines, all using Python 2.5, and it works as expected. However, whenever I submit my package to the servers I get a "Submission suspended: Early exit". Is this something that is being purposely prevented on the game servers, or is it a compatibility issue? If the latter, any chance I could get a more detailed error message so I could try to figure out what the problem is? Has anyone else managed to get this working?
drasmuss
Cadet
 
Posts: 5
Joined: Wed Feb 10, 2010 1:44 am

Re: adding c extensions to python code

Postby amstan » Sat Feb 20, 2010 6:45 pm

Please search the other topic about this, i believe they also deal with integrating C in python.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: adding c extensions to python code

Postby drasmuss » Sun Feb 21, 2010 12:10 am

Is this the thread you mean? viewtopic.php?f=9&t=111. I have looked at it, but it's a little sparse on the details. mspang says that it is impossible to mix languages, then someone else mentions that they've done it but with no details about platform/methods. I was hoping for some confirmation on whether or not this is possible, and if it is what I need to do to make my files compatible with your setup.
drasmuss
Cadet
 
Posts: 5
Joined: Wed Feb 10, 2010 1:44 am

Re: adding c extensions to python code

Postby amstan » Sun Feb 21, 2010 4:00 am

I don't know, you should ask that person who has said they got it working.
Alexandru M. Stan
Contest Organizer
User avatar
amstan
Contest Organizer
 
Posts: 691
Joined: Sun Jan 31, 2010 4:02 am
Location: Stoney Creek, Ontario

Re: adding c extensions to python code

Postby drewrobb » Mon Feb 22, 2010 5:31 am

Hello,

I literally just got it working my chance. I compiled the extension on my own linux 64 bit system using the standard python setup.py, built for python2.6. Then my python script just imported the compiled module from the submission directory, and somehow this worked on the server. The submission script didn't compile anything, because it just looked at the MyTronBot.py.
However I don't recommend this method, and I myself have since moved to using pure C.
drewrobb
Cadet
 
Posts: 6
Joined: Tue Feb 09, 2010 11:01 am


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron