libigl-python-bindings icon indicating copy to clipboard operation
libigl-python-bindings copied to clipboard

cannot find embree/rtcore.h when writing python binding

Open iszihan opened this issue 3 years ago • 3 comments

Hello, I'm trying to write a binding for one of the function that uses the embree intersector. I added the embree folder to both ./external and ./external/libigl/external. When I run python setup.py develop, I still get the error

/Documents/projects/libigl-python-bindings/external/libigl/include/igl/embree/EmbreeIntersector.h:23:10: fatal error: embree3/rtcore.h: No such file or directory #include <embree3/rtcore.h>

I tried the following modification with CMakeLists.txt in the root directory, but none of them worked.

  • Add target_include_directories(pyigl_classes PRIVATE "${PYLIBIGL_EXTERNAL}/embree/include")
  • Change option(LIBIGL_WITH_EMBREE "Use Embree" OFF) to ON

Much appreciated if someone can help to get rid of this error.

iszihan avatar Oct 22 '21 15:10 iszihan

In addition to

option(LIBIGL_WITH_EMBREE "Use Embree" ON)

I believe you also need:

target_link_libraries(pyigl_classes PRIVATE npe igl::core igl::embree)

alecjacobson avatar Nov 06 '21 13:11 alecjacobson

Are you sure option(LIBIGL_WITH_EMBREE "Use Embree" ON) is set to ON?

I believe this needs to appear in cmakelists.txt before any of the libigl related stuff.

(also try a clean build)

alecjacobson avatar Nov 10 '21 17:11 alecjacobson

A clean build worked! Thank you so much.

iszihan avatar Nov 10 '21 17:11 iszihan

Would love to start an igl.embree module if you'd like to PR your function. Closing this issue as resolved.

alecjacobson avatar Feb 05 '23 23:02 alecjacobson