1

Short version:

How to import .def files in Cython?

Long version:

I am writing a Cython wrapper for VLFeat library. So there are two parts a def of a Cython module a definition file with a .pxd suffix, containing C declarations that are to be available to other Cython modules, and an implementation file with a .pyx suffix, containing everything else.

The structure is quite simple. There's a .h, a MEX (provides an interface between MATLAB or Octave and functions written in C) and a C (contains actual algorithm implementation) file for a particular function in Vlfeat library.

.h translates to -> .pxd

CMEX translates to -> .pyx

There wasn't any deviations from the structure until now. There's a function vl_binsum for which there is a MEX file and a .def file. I am not sure how to declare the contents of the .def file in a .pxd. Or does it even require a declaration? I tried searching a lot but couldn't find any tangible solution.

Simmi Mourya
  • 19
  • 2
  • 9
  • I'm not 100% sure, but it looks like the vl_binsum.def file is just an implementation detail of the vl_binsum.c file so you can probably ignore it. – DavidW Jul 30 '16 at 10:30
  • .def is used by msvc compiler on Windows by passing /DEF option to the linker. In gcc this should not be required. – denfromufa Aug 01 '16 at 21:05

0 Answers0