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

No "LIBIGL_WITH_GLFW" with python bindings in windows #1011

Closed
2 of 3 tasks
YoungRainy opened this issue Nov 13, 2018 · 20 comments
Closed
2 of 3 tasks

No "LIBIGL_WITH_GLFW" with python bindings in windows #1011

YoungRainy opened this issue Nov 13, 2018 · 20 comments
Assignees
Labels

Comments

@YoungRainy
Copy link

I want to use libigl with python.

After compile the "python" folder, I run
python 102_DrawMesh.py

I got
The libigl python bindings were compiled without glfw support. Please recompile with the CMAKE flag LIBIGL_WITH_GLFW.

But I check the Cmakelists.txt , there is no option "LIBIGL_WITH_GLFW", only "LIBIGL_WITH_OPENGL_GLFW", I am sure I make this opition ON,

I both try windows and linux, got the same error.

I have no idea about this, It would be very grateful if you could help me with this, thank you.

Check all that apply (change to [x])

  • Windows
  • Mac OS X
  • Linux

See https://libigl.github.io/CONTRIBUTING/#bugreport for more tips.

@jdumas
Copy link
Collaborator

jdumas commented Nov 13, 2018

Hi. Please check out changes I made in #1008, and build the python bindings from the root folder.

@jdumas jdumas added the python label Nov 13, 2018
@YoungRainy
Copy link
Author

Thank you for your help, and your work is wonderful.
I download it again, and build it form the root folder, but I still got the same error.

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Did you clean/remove your build folder before proceeding? CMake options are set only once the first time you build in a given folder.

@YoungRainy
Copy link
Author

yes, I delete the build folder and create a new one. I use CmakeGUI to compile the object in windows, is it OK?
Should I choose "LIBIGL_USE_STATIC_LIBRARY" ON?

That's the message of compilation
`The C compiler identification is MSVC 19.15.26732.1
The CXX compiler identification is MSVC 19.15.26732.1
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- 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: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.15.26726/bin/Hostx86/x64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
MSVC -> forcing use of statically-linked runtime.
Creating target: igl::core (igl)
Creating target: igl::comiso (igl_comiso)
CMake Deprecation Warning at external/embree/CMakeLists.txt:78 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.

Creating target: igl::embree (igl_embree)
Creating target: igl::opengl (igl_opengl)
Creating target: igl::opengl_glfw (igl_opengl_glfw)
Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
Using Win32 for window creation
Creating target: igl::opengl_glfw_imgui (igl_opengl_glfw_imgui)
Creating target: igl::png (igl_png)
Creating target: igl::tetgen (igl_tetgen)
Creating target: igl::triangle (igl_triangle)
Creating target: igl::xml (igl_xml)
pybind11 v2.3.dev0
Configuring done
Generating done`

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

If you want to use the python bindings you should compile with LIBIGL_USE_STATIC_LIBRARY=OFF.

@YoungRainy
Copy link
Author

what i did:

  1. I download libigl form git again.
  2. create a build folder in libigl root folder
  3. change LIBIGL_USE_STATIC_LIBRARY=OFF in CMakelists.txt.
  4. I use CmakeGUI to compile. No errors.
  5. CmakeGUI generate
  6. cd to python folder
  7. run
    python ./tutorial/102_DrawMesh.py
  8. Got the message:
    The libigl python bindings were compiled without glfw support. Please recompile with the CMAKE flag LIBIGL_WITH_GLFW.

Did I miss something? Or there are some other steps i should do ?

@YoungRainy
Copy link
Author

I change this line in CMakelists.txt
from
option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" ON)
to
option(LIBIGL_USE_STATIC_LIBRARY "Use LibIGL as static library" OFF)

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Are you sure you are selecting the root folder of libigl in CMake-GUI? Not the python/ folder.

@YoungRainy
Copy link
Author

1
Yes, as you can see in the image.

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Well, from your picture I can see that you haven't checked out the changes in the PR I pointed you to.

@YoungRainy
Copy link
Author

Sorry, I checked out the changes before, but I didn't change the files.
There are 47 files changed, Do you mean I should do the same change as you did?

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Please start from a fresh clone of my fork, calling the following in a terminal:

git clone -b fix-python https://github.com/jdumas/libigl.git

Then generate the cmake project with LIBIGL_USE_STATIC_LIBRARY=OFF.

@YoungRainy
Copy link
Author

It happened again. want to cry.
2

I found one thing. I used python in anaconda and the python version is 3.7.
The PythonLibs it found is
Found PythonLibs: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python36_64/libs/python36.lib (found version "3.6.6")

Should I change CMakelists.txt in python folder,
from
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
to
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.7)

To avoid it find the wrong one.

1

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Can you post the whole log of the cmake configuration, as well as the content of your CMakeCache.txt?

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

If you use python with anaconda you should also start the cmake-gui from within an anaconda terminal where you've activated your environment.

@YoungRainy
Copy link
Author

YoungRainy commented Nov 14, 2018

Of course. Thank you for your patience.

As you said, i start cmake-gui from anaconda terminal (activated environment)
Then i git again with command:
git clone -b fix-python https://github.com/jdumas/libigl.git

The log of the cmake configuration is following:
cmakeConfiguration.txt

CMakeCache/txt is like:
CMakeCache.txt

@jdumas
Copy link
Collaborator

jdumas commented Nov 14, 2018

Hmm interesting. I suppose the python libs are correctly found (on the second line it matches with the executable). I guess I'll have to test it on my Windows at some point, but that may not happen anytime soon. You can also try to checkout the content of the dev-python branch, where new bindings are in the work, but probably won't be merged until a couple of weeks.

@YoungRainy
Copy link
Author

yes, I can "import pyigl", but when check dependencies ["glfw"], the error occurs.

@YoungRainy
Copy link
Author

Thank you for your help. @jdumas

@teseoch
Copy link
Collaborator

teseoch commented Feb 20, 2020

this issue involves the old bindings which have been discontinued, plz refer to https://libigl.github.io/libigl-python-bindings/ for the new version.

Note:
The viewer has been removed and replaced with
https://skoch9.github.io/meshplot/ or any other python viewer

@teseoch teseoch closed this as completed Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants