alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
630 stars 169 forks source link

Compilation of mesh_boolean, issues with CGAL #64

Open vmonkey opened 6 years ago

vmonkey commented 6 years ago

Hello,

I am struggling with compilation of the mesh_boolean mex function (on Linux), and thus ask for a kind help. I have already found that I need to set LIBIGL_WITH_CORK in ./gptoolbox/mex/CMakeLists.txt to ON. Regarding CGAL compilation: Without any changes into CGAL or gptoolbox files, I receive an error ... can not be used when making a shared object; recompile with -fPIC. Thus, I tried to recompile CGAL with this flag by putting -DCMAKE_POSITION_INDEPENDENT=ON into CMAKE_ARGS of the ./libigl/external/CMakeLists.txt. Although the compliation went fine then, Matlab showed an error indicating that the resulting mex file is not valid.

Do you have any suggestions? What is the proper way to build the mesh_boolean and other CGAL-dependent functions?

Thanks for help.

Marek

alecjacobson commented 6 years ago

What's your OS and compiler setup?

You shouldn't have to set LIBIGL_WITH_CORK to ON. If it's OFF it should just have fewer features.

The CGAL thing sounds familiar but it doesn't happen to me on Mac.

vmonkey commented 6 years ago

Thanks for the answer. It is really weird, but after starting from scratch it suddenly worked. Previously, I had a problem that even if CGAL was compiled the cmake command in ./gptoolbox/mex/build folder avoided building of mesh_boolean at all, that's why I used LIBIGL_WITH_CORK option enforcing building of mesh_boolean. Sorry for creating this issue, I think it can be closed.