Hi all,
I'm trying to create a python like distribution of my "adjust"
package, which includes a single cython file (in the adjust
subdirectory), and I'm trying to follow the example in the manual.
Unfortunlatey, building the cython file failes.
-------------------------------------------------------------------------
python setup.py build_ext --inplace
running build_ext
cythoning adjust/solvers_opt.pyx to adjust/solvers_opt.c
Error converting Pyrex file to C:
------------------------------------------------------------
...
^
------------------------------------------------------------
/home/angelo/soft/adjust-xdib/adjust/solvers_opt.pyx:1:0: 'adjust/
solvers_opt' is not a valid module name
building 'adjust/solvers_opt' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -
Wstrict-prototypes -fPIC -I/usr/lib/python2.6/dist-packages/numpy/core/
include -I/usr/include/python2.6 -c adjust/solvers_opt.c -o build/
temp.linux-x86_64-2.6/adjust/solvers_opt.o
adjust/solvers_opt.c:1: error: #error Do not use this file, it is the
result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
-------------------------------------------------------------------------
I'm using cython 0.12.1 on Ubuntu 10.10
I can invoke cython adjust/solvers_opt.py manually, and then the build
picks up the generated *.c file and succeeds. (Or should I just ship
the cython generated *.c code in the source package?)
Here is the (parital) overview of the directory structure:
setup.py
adjust/__init__.py
adust/*.py
adjust/solvers_opt.pyx
setup.py looks like this:
-------------------------------------------------------------------------
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy as np
ext_modules = [Extension("adjust/solvers_opt", ["adjust/
solvers_opt.pyx"])]
setup(
name = 'adjust',
version = '0.1',
description = 'adjustment library',
author = "Pablo d'Angelo",
author_email = "
pablo....@web.de",
install_requires = ['numpy', 'scipy'],
license = "BSD",
packages = ['adjust'],
scripts=['rpc_bundle', 'rpc_bundle_p5'],
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
include_dirs = [np.get_include()]
)
-------------------------------------------------------------------------