Re: [Cython] Sage build broken

2013-02-21 Thread Stefan Behnel
Stefan Behnel, 21.02.2013 07:46:
> I just noticed that the Sage build is broken:
> 
> """
> gcc -pthread -shared -L/jenkins/sage/sage-5.2/local/lib
> build/temp.linux-x86_64-2.7/sage/rings/polynomial/polydict.o
> -L/jenkins/sage/sage-5.2/local/lib -L/release/merger/sage-5.2/local/lib
> -lcsage -lstdc++ -lntl -lpython2.7 -o
> build/lib.linux-x86_64-2.7/sage/rings/polynomial/polydict.so
> 
> /usr/bin/ld: build/temp.linux-x86_64-2.7/sage/rings/polynomial/polydict.o:
> relocation R_X86_64_PC32 against `__Pyx_PyDict_IterItems' can not be used
> when making a shared object; recompile with -fPIC
> 
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
> command 'gcc' failed with exit status 1
> """
> 
> Looks like a problem in Sage to me, the gcc command really lacks the -fPIC
> here.

Sorry, my bad. I had a typo in a utility code section name, which prevented
the actual implementation of that function from appearing in the C code. No
idea what makes gcc generate that misleading error message above, though.

Stefan

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] [cython-users] To add datetime.pxd to cython.cpython?

2013-02-21 Thread Stefan Behnel
Hi,

I think this discussion is actually better suited for the cython-devel
mailing list. We should move it over there.

Zaur Shibzukhov, 21.02.2013 20:59:
> четверг, 21 февраля 2013 г., 16:59:20 UTC+3 пользователь Stefan Behnel 
> написал:
>> Zaur Shibzukhov, 21.02.2013 11:25: 
>>> Last time I actively used datetime module. Because I needed fast 
>>> creation 
>>> of date/time/datetime instances I wrote datetime.pxd. It contains much 
>>> of 
>>> datetime API from datetime.h + two extended version for time/datetime 
>>> creation. Does it make sense to include datetime.pxd in cython.cpython? 
>>
>> Given that datetime.h is actually part of the header files that CPython 
>> installs, it makes total sense to me to include it. Please provide a pull 
>> request on github for it. 
>
> OK. I will create pull request with datetime.pxd + tests

Great.


>> However, I don't know what you mean by "extended version for time/datetime 
>> creation". Could you show us the code for that first? 
>>
> Datetime.h from cpython contains factory functions for creation 
> time/datetime without timezone info.
> But actually datetime module contains public definition of factory 
> functions for creation time/date with timezone info, which are not in 
> cpython's datetime.h. 
> I could create datetime_ex.h for these functions in order to include them 
> in datetime.pxd. The problem: how to adopt datetime_ex.h to Cython...
> 
> Current datetime.pxd looks like:
> [...] 

I was more interested in the parts that are not in the public header file.
Could you list those?

Letting Cython generate those definitions isn't really all that much of a
problem. We already do this for the stdlib array module, which doesn't have
a public header file at all.

Stefan

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


[Cython] To Add datetime.pxd to cython.cpython

2013-02-21 Thread ZS
>These macros allow to create dattime/time objects with tzinfo.
>Of course we could do:
>
>t = PyTime_FromTime()
>t = t.replace(tzinfo)
 Sorry last line has to be:
t = t.replace(tzinfo=tzinfo)


Zaur Shibzukhov
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel