I tried to use the libigl on Ubuntu 16.4, but I faced some errors when building the example 102.
First, I installed the Eigen locating in /usr/local/include/Eigen/.
Then, I downloaded the libigl code following this command:
git clone --recursive https://github.com/libigl/libigl.git
Next, I tried to build the Example 102. According to this advice.
The examples can also be built independently using the CMakeLists.txt inside each example folder.
So after downloading the source code, I direct build example 102 instead of building the whole tutorial via corresponding CMakeLists.txt locating in /libigl/tutorial/.
I do like this: (1) cd to the folder: ..../libigl/tutorial/102_DrawMesh
(2) mkdir build
(3) cd build
(4) cmake ../
After the cmake ../, I got the following errors, it seems that required links libraries that specified in the CMakeLists.txt locating in ..../libigl/tutorial/102_DrawMesh are not found.
The following are the errors:
-- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- 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 CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run "cmake --help-policy CMP0000". This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done CMake Warning (dev) at CMakeLists.txt:4 (add_executable): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
Target "102_DrawMesh_bin" links to target "igl::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 warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:4 (add_executable): Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning.Target "102_DrawMesh_bin" links to target "igl::opengl" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:4 (add_executable): Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning.Target "102_DrawMesh_bin" links to target "igl::opengl_glfw" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done -- Build files have been written to: /home/chayfung/Workspace/Mesh/libigl/tutorial/102_DrawMesh/build
Can someone give me some advice?
Thanks.
CMakeLists.txt
definitely cannot be built independently: github.com/libigl/libigl/blob/…. Not sure why documentation tells so. You may build the parentCMakeLists.txt
(which corresponds to all examples in the tutorial), and comment unneded examples in it. Note, that you may disable examples for some chapters by setting optionTUTORIALS_CHAPTER<N>
to off. E.g., pass the option-DTUTORIALS_CHAPTER2=OFF
forcmake
to disable examples in chapter 2. – Tsyvarev