From cd89555a5c1f75ec57bb369f1a4acb94fce67d9b Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Wed, 3 Jan 2018 12:01:35 +0100 Subject: [PATCH 1/2] Fixed an attribute in trianges.pyx that prevents compilation I have updated a trianges.pyx since it is using a missing attribute. I guess one wants `RTC_GEOMETRY_STATIC` instead of `RTCGEOMETRY_STATIC`. https://github.com/embree/embree/blob/90e49f243703877c7714814d6eaa5aa3422a5839/include/embree2/rtcore_geometry.h#L72 The original error log is presented here D:\Embree\pyembree>python setup.py build Please put "# distutils: language=c++" in your .pyx or .pxd file(s) Compiling pyembree\trianges.pyx because it changed. [1/1] Cythonizing pyembree\trianges.pyx Error compiling Cython file: ------------------------------------------------------------ ... def run_triangles(): pass cdef unsigned int addCube(rtcs.RTCScene scene_i): cdef unsigned int mesh = rtcg.rtcNewTriangleMesh(scene_i, rtcg.RTCGEOMETRY_STATIC, 12, 8, 1) ^ ------------------------------------------------------------ pyembree\trianges.pyx:19:20: cimported module has no attribute 'RTCGEOMETRY_STATIC' Traceback (most recent call last): File "setup.py", line 11, in include_path=include_path) File "C:\Program Files\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 1039, in cythonize cythonize_one(*args) File "C:\Program Files\Python36\lib\site-packages\Cython\Build\Dependencies.py", line 1161, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: pyembree\trianges.pyx --- pyembree/trianges.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyembree/trianges.pyx b/pyembree/trianges.pyx index ceddb64..17e44bf 100644 --- a/pyembree/trianges.pyx +++ b/pyembree/trianges.pyx @@ -16,7 +16,7 @@ def run_triangles(): cdef unsigned int addCube(rtcs.RTCScene scene_i): cdef unsigned int mesh = rtcg.rtcNewTriangleMesh(scene_i, - rtcg.RTCGEOMETRY_STATIC, 12, 8, 1) + rtcg.RTC_GEOMETRY_STATIC, 12, 8, 1) cdef Vertex* vertices = rtcg.rtcMapBuffer(scene_i, mesh, rtcg.RTC_VERTEX_BUFFER) vertices[0].x = -1 vertices[0].y = -1 From 57199d98346bbeb0f3ea5671fc04e19ef3954417 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Wed, 3 Jan 2018 12:20:22 +0100 Subject: [PATCH 2/2] Fixed a keyword error in setup.py Replaced `include_dir` with `include_path` that is an unknown compilation option for cythonize https://travis-ci.org/scopatz/pyembree/jobs/324534634#L843 Copying /home/travis/build/scopatz/pyembree to /home/travis/miniconda/conda-bld/pyembree_1514977538913/work source tree in: /home/travis/miniconda/conda-bld/pyembree_1514977538913/work Traceback (most recent call last): File "setup.py", line 11, in include_dirs=include_path) File "/home/travis/miniconda/conda-bld/pyembree_1514977538913/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python2.7/site-packages/Cython/Build/Dependencies.py", line 909, in cythonize c_options = CompilationOptions(**options) File "/home/travis/miniconda/conda-bld/pyembree_1514977538913/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/python2.7/site-packages/Cython/Compiler/Main.py", line 559, in __init__ raise ValueError(message) ValueError: got unknown compilation option, please remove: include_dirs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cb158df..ccae563 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ include_path = [np.get_include()] ext_modules = cythonize('pyembree/*.pyx', language='c++', - include_dirs=include_path) + include_path=include_path) for ext in ext_modules: ext.include_dirs = include_path ext.libraries = ["embree"]