On 06/07/2018 19:42, Dima Pasechnik wrote:


On Friday, July 6, 2018 at 4:15:55 PM UTC+2, Jeroen Demeyer wrote:

On 2018-07-06 16:08, John H Palmieri wrote:
It’s already documented in the developer’s guide:
http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list

    John


But don't use "libraries=", it's better to use "# distutils" directives
at the top of your Cython file.


Really? Any reason for this? It's really much cleaner, IMHO, to have it all
in Python code, easily inspect-able, rather than
in an obscure comments with obscure syntax somewhere you have no means to
inspect from Python...

Nope. Distutils directive as suggested by Jeroen are naturally put
in pxd files. That way, as soon as the pxd gets imported in a pyx the
correct libraries are linked automaticaly. See for example

 sage/libs/gmp/mpz.pxd

If you do cimport the definitions from there, gmp will automatically
be linked. Note also that there is no distutils directive in

 sage/libs/gmp/types.pxd

wich make sense since all the declarations there only depend on the
header files!

I think that this could be added to the developer guide
(since this is not a Cython standard).

However, if the presence of "libraries=" is required in a pyx file, then
I am not sure what I prefer. Any comment?

Best
Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to