alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 165 forks source link

Compilation Problem #49

Open Hanan-ElNaghy opened 6 years ago

Hanan-ElNaghy commented 6 years ago

Hi @alecjacobson,

Thank you for sharing your code. I am currently having a problem with the installation of the gptoolbox library. I tried to compile the code through Matlab by calling "compile_gptoolbox_mex" and the Matlab got stuck in compiling the "ambient_occlusion" for a long time. After that, I tried to compile using cmake and I got another error message that libigl could not be found. I am working on Linux Mint 17.2 and my Matlab version is R2016a.

Could you help with the installation? Thanx

alecjacobson commented 6 years ago

Have you installed libigl someplace ? Where? What's the error you're getting using cmake?

Hanan-ElNaghy commented 6 years ago

I guess Libigl is static library and I have it somewhere I know. Here is the error I got for cmake: "CMake Error at /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):

libigl not found --- You can download it using:

git clone --recursive https://github.com/libigl/libigl.git

/home/helnagh1/Downloads/gptoolbox-master/mex/../libigl (missing: LIBIGL_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE) cmake/FindLIBIGL.cmake:30 (find_package_handle_standard_args) CMakeLists.txt:33 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/helnagh1/Downloads/gptoolbox-master/mex/build/CMakeFiles/CMakeOutput.log".

Thanks

alecjacobson commented 6 years ago

libigl is a header only library. So it's enough to just download it and make sure that cmake can find it.

I recently added the cmake one, so that is the one I intend to support.

Can you try issuing the command it suggests?

git clone --recursive https://github.com/libigl/libigl.git /home/helnagh1/Downloads/gptoolbox-master/mex/../libigl 

Then cmake will hopefully find libigl.

Hanan-ElNaghy commented 6 years ago

Thanks, cmake now can find the libigl. But unfortunately it can not find the LIBELTOPO. The error is: CMake Error at cmake/FindELTOPO.cmake:22 (message): could NOT find LIBELTOPO_INCLUDE_DIR Call Stack (most recent call first): CMakeLists.txt:35 (find_package)

alecjacobson commented 6 years ago

This one is similar, but unless you really want the eltopo wrapper. you can skip it by using:

cmake ../ -DWITH_ELTOPO=Off

Hanan-ElNaghy commented 6 years ago

Now I got a bunch of errors all related to igl and CGAL, here is just some of them: CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

alecjacobson commented 6 years ago

You're on linux right?

Can you paste the entire cmake output?

E.g.,

rm -f CMakeCache.txt cmake ../ -DWITH_ELTOPO=Off

Hanan-ElNaghy commented 6 years ago

Yah Linux. Here is the entire cmake output: -- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Creating target: igl::core -- Found CGAL: /usr/lib/CGAL -- Creating target: igl::cgal -- Boost version: 1.54.0 -- Found the following Boost libraries: -- thread -- system -- Found Git: /usr/bin/git (found version "1.9.1") -- Detecting default ISA: -- Detecting default ISA: SSE2 -- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Creating target: igl::embree -- Compiling: segment_graph.cpp;bone_visible.cpp;collapse_small_triangles.cpp;decimate_libigl.cpp;fit_rotations_mex.cpp;in_element_aabb.cpp;ray_mesh_intersect.cpp;read_triangle_mesh.cpp;signed_distance.cpp;simplify_polyhedron.cpp;slim.cpp;solid_angle.cpp;winding_number.cpp;ambient_occlusion.cpp;bone_visible_embree.cpp;reorient_facets.cpp;decimate_cgal.cpp;intersect_other.cpp;mesh_boolean.cpp;outer_hull.cpp;point_mesh_squared_distance.cpp;selfintersect.cpp;signed_distance_isosurface.cpp;snap_rounding.cpp;trim_with_solid.cpp;wire_mesh.cpp -- Configuring done CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

-- Generating done -- Build files have been written to: /home/helnagh1/Downloads/gptoolbox-master/mex/build

alecjacobson commented 6 years ago

Thanks.

Let's tackle the most important issue first. It's not preparing the igl::matlab target. This is needed by all of the mex functions.

Can you confirm that your CMakeLists.txt file has the line:

option(LIBIGL_WITH_MATLAB "Use Matlab" ON)

and if so. can you try moving this line:

find_package(Matlab REQUIRED COMPONENTS MEX_COMPILER MX_LIBRARY ENG_LIBRARY)

above this line:

find_package(LIBIGL REQUIRED)

and then try again:

rm -f CMakeCache.txt cmake ../ -DWITH_ELTOPO=Off

My suspicion is that libigl first looks for matlab, doesn't find it and then happily decides to stop looking for it forever (this would be a bug in libigl).

Hanan-ElNaghy commented 6 years ago

Yes, CMakeLists.txt file has the line: option(LIBIGL_WITH_MATLAB "Use Matlab" ON). But after applying your suggestion of swapping the two lines, I still got the same cmake output:

-- Looking for include file pthread.h -- Looking for include file pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE
-- Creating target: igl::core -- Found CGAL: /usr/lib/CGAL -- Creating target: igl::cgal -- Boost version: 1.54.0 -- Found the following Boost libraries: -- thread -- system -- Found Git: /usr/bin/git (found version "1.9.1") -- Detecting default ISA: -- Detecting default ISA: SSE2 -- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libGL.so
-- Creating target: igl::embree -- Compiling: segment_graph.cpp;bone_visible.cpp;collapse_small_triangles.cpp;decimate_libigl.cpp;fit_rotations_mex.cpp;in_element_aabb.cpp;ray_mesh_intersect.cpp;read_triangle_mesh.cpp;signed_distance.cpp;simplify_polyhedron.cpp;slim.cpp;solid_angle.cpp;winding_number.cpp;ambient_occlusion.cpp;bone_visible_embree.cpp;reorient_facets.cpp;decimate_cgal.cpp;intersect_other.cpp;mesh_boolean.cpp;outer_hull.cpp;point_mesh_squared_distance.cpp;selfintersect.cpp;signed_distance_isosurface.cpp;snap_rounding.cpp;trim_with_solid.cpp;wire_mesh.cpp -- Configuring done CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ambient_occlusion" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "bone_visible_embree" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "collapse_small_triangles" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_cgal" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "decimate_libigl" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "fit_rotations_mex" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "in_element_aabb" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "intersect_other" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "mesh_boolean" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "outer_hull" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "point_mesh_squared_distance" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "ray_mesh_intersect" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "read_triangle_mesh" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "reorient_facets" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "segment_graph" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "selfintersect" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "signed_distance_isosurface" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "simplify_polyhedron" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "slim" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "snap_rounding" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "solid_angle" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "trim_with_solid" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "winding_number" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "igl::matlab" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "CGAL::CGAL" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:126 (add_library): Target "wire_mesh" links to target "CGAL::CGAL_Core" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

-- Generating done -- Build files have been written to: /home/helnagh1/Downloads/gptoolbox-master/mex/build

Thanx

alecjacobson commented 6 years ago

It's a bit hard to debug further from afar. But my guess is that cmake is not really finding matlab.

I've noticed this before that if your cmake version is older than your matlab (e.g., installed cmake in 2016 and you have MATLAB2017a) then cmake doesn't find matlab because it's not smart enough to look for later years.

which matlab version do you have?

can you try updating your cmake installation?

Hanan-ElNaghy commented 6 years ago

Thank you for your help. My Matlab version is R2016a and my cmake version is 3.2.2. I will try to update my cmake and see how it will go.

Thanks

kirsten-lynch commented 6 years ago

Hello! I know this post is from several months ago, so thank you in advance for your help. I am similarly having problems with finding the CGAL::CGAL and CGAL::Core targets for the mex compilation and would like to hear if others have found a solution to this. When I run cmake, this is the output:


-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LIBELTOPO: /ifs/loni/faculty/kclark/candl/kirsten/scripts/eltopo-master/eltopo3d/libeltopo_release.a
-- Found LIBIGL: /ifs/loni/faculty/kclark/candl/kirsten/scripts/libigl-master/include
-- Found CGAL: /usr/local/cgal-3.6.1_64bit/lib/CGAL
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   thread
--   system
--   chrono
--   date_time
--   atomic
-- Found Matlab: /usr/local/MATLAB/R2014b/extern/include (found version "8.4") found components:  MEX_COMPILER MX_LIBRARY ENG_LIBRARY
-- Could NOT find MOSEK (missing:  MOSEK_LIBRARIES MOSEK_INCLUDE_DIR)
-- Found OpenGL: /usr/lib64/libGL.so
-- Creating target: igl::core (igl)
-- Found CGAL: /usr/local/cgal-3.6.1_64bit/lib/CGAL
-- Creating target: igl::cgal (igl_cgal)
-- Boost version: 1.59.0
-- Found the following Boost libraries:
--   thread
--   system
--   chrono
--   date_time
--   atomic
-- Creating target: igl::matlab (igl_matlab)
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- A library with BLAS API found.
-- Found CGAL: /usr/local/cgal-3.6.1_64bit/lib/CGAL
-- Compiling: segment_graph.cpp;bone_visible.cpp;collapse_small_triangles.cpp;decimate_libigl.cpp;fit_rotations_mex.cpp;in_element_aabb.cpp;read_triangle_mesh.cpp;readMSH.cpp;signed_distance.cpp;simplify_polyhedron.cpp;slim.cpp;solid_angle.cpp;winding_number.cpp;eltopo.cpp;decimate_cgal.cpp;intersect_other.cpp;mesh_boolean.cpp;outer_hull.cpp;point_mesh_squared_distance.cpp;selfintersect.cpp;signed_distance_isosurface.cpp;snap_rounding.cpp;trim_with_solid.cpp;wire_mesh.cpp
-- Configuring done
CMake Error at CMakeLists.txt:134 (add_library):
  Target "selfintersect" links to target "CGAL::CGAL" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at CMakeLists.txt:134 (add_library):
  Target "selfintersect" links to target "CGAL::CGAL_Core" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?```

This cmake error is repeated for all the mex targets.