On Mon, 2013-07-22 at 21:37 +0600, Nikita Nemkin wrote:
>
> cythonize is not a distutils command, it's a standalone function
> providing an entry point to the Cython compiler. Just write a short
> script that imports and calls cythonize(), parsing command line
> arguments however you like.
Hi Nikita,
After I've got a word from Robert that there is no interest in providing
macro values via the command line, and some faffing around the PXI files
(*), I decided to give your solution a go and came up with the following
unsavory make target:
pynestkernel.cpp: pynestkernel.pyx pynestkernel.pxd
cd $(top_srcdir)/pynest; $(PYTHON) -c \
"from Cython.Build import cythonize; cythonize('pynestkernel.pyx', \
verbose=1, emit_linenums=1, language='c++', cplus=1, output_file='pynestkernel.cpp',\
compiler_directives={ \
'warn.maybe_uninitialized': True, \
'warn.unreachable': True, \
'warn.unused': True, \
}, \
compile_time_env={'HAVE_LIBNEUROSIM': $(DEF_LIBNEUROSIM)}, \
)"
However, no matter what I tried, cythonize from Cython 0.19.1 always
generates pynestkernel.c instead of pynestkernel.cpp as I want it to.
Do you have any ideas on how to tackle this problem?
Also, I wasn't about to find any canonical reference that lists all
arguments that cythonize accepts other than the source code. Do you
happen to know if there is one and, in any case, how do I properly
enable all warnings?
(*) PXI files turned out to be a PITA, because it's not clear which
target they should depend upon to be properly updated, and if you
declare them as .PHONY, dependent targets such as Cython + the library
itself will be always triggered unconditionally.
Many thanks,