Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake error (FindLIBIGL) #23

Open
paulelian-tabarant opened this issue May 13, 2019 · 12 comments
Open

CMake error (FindLIBIGL) #23

paulelian-tabarant opened this issue May 13, 2019 · 12 comments
Assignees

Comments

@paulelian-tabarant
Copy link

Hello,

I've been using libigl for a few months now (thanks for the tools by the way), and I started my project from this example while hosting it on a Github repo. However, in any project I start from this example now, I get the following error when executing "cmake .." from a "debug" repository inside my project :

CMake Error at cmake/FindLIBIGL.cmake:36 (include):
include could not find load file:

libigl

Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)

I saw from an previous post by Alec Jacobson that it might be due to inappropriately set environment variables, but I do not know anything about how to fix it. My "libigl" directory is at the same location as my project directory. Do you have any idea ?

Thank you very much,

Paul-Elian

@BruegelN
Copy link
Contributor

When generating a project file using cmake you could specify the path to your libigl include dir.
i.e.

cd libigl-example-project
mkdir build
cd build
cmake .. -DLIBIGL_INCLUDE_DIR="/path/to/custom/libigl/include"

or using CMake GUI you could set the value of LIBIGL_INCLUDE_DIR to the include folder of your libigl directory and regenerate the project.

As you can see here https://github.com/libigl/libigl-example-project/blob/master/cmake/FindLIBIGL.cmake#L11-L15 CMake checks for a few environment variables. Have set one of them?

@paulelian-tabarant
Copy link
Author

paulelian-tabarant commented May 13, 2019

Specifying the include path worked, thank you. I don't remember having set any of these variables before, could my problem be related to having one of these variables incorrectly set ?

@BruegelN
Copy link
Contributor

Actually I don't think your problem is related.
But I still don't get your setting.
Did you do something like this:

git clone https://github.com/libigl/libigl-example-project.git
cd libigl-example-project
git clone https://github.com/libigl/libigl.git

such that your libigl folder is inside the example project?

E.g. for $ tree -L 2 libigl-example-project/ you get a similar output:
libigl-example-project/
├── build
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   ├── cmake_install.cmake
│   ├── eigen-build
│   ├── example_bin
│   ├── glad
│   ├── glad-build
│   ├── glfw
│   ├── glfw-build
│   ├── libigl-config.cmake
│   ├── libigl-export.cmake
│   └── Makefile
├── cmake
│   └── FindLIBIGL.cmake
├── CMakeLists.txt
├── libigl
│   ├── cmake
│   ├── CMakeLists.txt
│   ├── external
│   ├── include
│   ├── LICENSE.GPL
│   ├── LICENSE.MPL2
│   ├── python
│   ├── README.md
│   ├── tests
│   └── tutorial
├── LICENSE
├── main.cpp
└── README.md

This is one of the locations where libigl is searched: https://github.com/libigl/libigl-example-project/blob/master/cmake/FindLIBIGL.cmake#L11-L15 and it works for me both on macOS and Ubuntu.
That's why I'm a little confused.

Glad that you've got it working already :)

@paulelian-tabarant
Copy link
Author

Yes I've also tried to put the libigl library files right inside my project, but I still get the same CMake Error mentioned above in this thread... That's very curious because it was not the case a few weeks ago. I cannot figure out any change of configuration in my system since the last time I've been working on it.

Thanks for the tip anyway! ;)

@ghost
Copy link

ghost commented Jul 14, 2019

I have to say it is kind of crazy to ask a user to copy a 15+GB thing to a fixed position when it has been installed somewhere else, and furthermore to specify LIBIGL_INCLUDE_DIR when this path is obvious after copying, for an example to be able to build. Good news is that the example finally works for me, but I hope FindLIBIGL.cmake could be more adaptive when doing its job.

@cynthiaxw
Copy link

Hi,

I've been struggling with the same issue for hours. I'm using the same FindLIBIGL.cmake file as well, and have tried the solutions mentioned above, but none of them worked. I also tried to set the environment variables (LIBIGL_DIR to the libigl directory) and it's still not working. Do you have any thoughts?

Xi

@BruegelN
Copy link
Contributor

BruegelN commented Aug 5, 2019

@zhfsu why is your libigl folder so large? Do you have many different build folder (e.g. for different configurations)? Then no need to copy them.
Sorry if I was a but unclear FindLIBIGL.cmake does look in a few place by default see:
https://github.com/libigl/libigl-example-project/blob/master/cmake/FindLIBIGL.cmake#L17-L26
Or if you want to use your version of libigl you can always specify LIBIGL_INCLUDE_DIR. See my answer above: #23 (comment)
I'm sorry I still don't get your issue @zhfsu.

@cynthiaxw what error message do you get?
Does your error message look like this:

CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  

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

  	git clone --recursive https://github.com/libigl/libigl.git
  /home/nico/test/libigl-example-project/../libigl (missing:
  LIBIGL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLIBIGL.cmake:30 (find_package_handle_standard_args)
  CMakeLists.txt:10 (find_package)

Have you tried to clone libigl inside libigl-example-project or one level above(cd .. the clone)?

@cynthiaxw
Copy link

cynthiaxw commented Aug 6, 2019 via email

@cynthiaxw
Copy link

cynthiaxw commented Aug 6, 2019 via email

@BruegelN
Copy link
Contributor

BruegelN commented Aug 7, 2019

Hi Xi,
I'm glad that it works at least for the libigl-example-project :)
Your issue seems more related to gptoolbox, so I'm not sure if this is the right place.
Over at the gptoolbox repo I've only found one outdated issue: alecjacobson/gptoolbox#76
Did you follow the instructions at https://github.com/alecjacobson/gptoolbox/blob/master/mex/README.md for compling the C++ code with a matlab interface?
Just so you know, I neither know matlab nor use gptoolbox so you might want to open an issue at https://github.com/alecjacobson/gptoolbox if the issue is related to gptoolbox, sorry...

@cynthiaxw
Copy link

cynthiaxw commented Aug 7, 2019 via email

@javspace
Copy link

I think I have the same problem. I have followed the steps provided
in the libigl-example-project and I have the following error:

CMake Error at cmake/FindLIBIGL.cmake:34 (include):
include could not find load file:

libigl

Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)

These are the steps I have followed, in case I made something wrong:

javspace2@javspace2-pc:/Downloads/libigl-test$ git clone https://github.com/libigl/libigl-example-project/
Cloning into 'libigl-example-project'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 227 (delta 3), reused 5 (delta 2), pack-reused 217
Receiving objects: 100% (227/227), 57.85 KiB | 1.01 MiB/s, done.
Resolving deltas: 100% (102/102), done.
javspace2@javspace2-pc:
/Downloads/libigl-test$ cd libigl-example-project/
javspace2@javspace2-pc:/Downloads/libigl-test/libigl-example-project$ git clone https://github.com/libigl/libigl
Cloning into 'libigl'...
remote: Enumerating objects: 157, done.
remote: Counting objects: 100% (157/157), done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 40184 (delta 69), reused 81 (delta 37), pack-reused 40027
Receiving objects: 100% (40184/40184), 10.69 MiB | 11.11 MiB/s, done.
Resolving deltas: 100% (24990/24990), done.
javspace2@javspace2-pc:
/Downloads/libigl-test/libigl-example-project$ mkdir build
javspace2@javspace2-pc:/Downloads/libigl-test/libigl-example-project$ cd build
javspace2@javspace2-pc:
/Downloads/libigl-test/libigl-example-project/build$ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.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 Error at cmake/FindLIBIGL.cmake:34 (include):
include could not find load file:

libigl

Call Stack (most recent call first):
CMakeLists.txt:10 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/javspace2/Downloads/libigl-test/libigl-example-project/build/CMakeFiles/CMakeOutput.log".

@jdumas jdumas self-assigned this Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants