Hi all,

we've developed a Python pacakge which consists of both a compiled extension module and some helper functions in Python. Is there a tutorial on how to package such an extension?

Most resources I found for distutils describe either building an extension or pure python modules. Currently I have a structure like this:

ABCD/__init__.py
ABCD/main.py
ccode/some.c
ccode/some.h
ccode/Makefile

The Makefile compiles the C code and creates ABCD/some.so, which "main.py" then imports. This works, but not e.g. on Windows and it's not integrated into pip, of course.

We're soon going to publish the package as open source code and it would be great to do "pip install ABCD" ultimately. Is there a simple example out there how to achieve this?

Additionally, we use OpenMP in the C code for parallelism. This is easy in the Makefile, one has to pass "-fopenmp" to gcc and "/openmp" to msvc. Is there a way to set this flag automatically depending on the compiler?

Best regards,

         Christian
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to