harshn05 / ImGuiVoronoiGen

Interactive application for generating and visualizing Voronoi diagrams.
MIT License
0 stars 1 forks source link

Can't buld according to build steps from readme [Ubuntu] #1

Closed greenozon closed 2 months ago

greenozon commented 2 months ago

Linux, Ubuntu 22.04 LTS:

cmake -DCMAKE_BUILD_TYPE=Release ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/share/cmake-3.29/Modules/FindOpenGL.cmake:415 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  CMakeLists.txt:47 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
Cloning into 'imgui'...
-- Configuring done (1.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/usr/Downloads/gh/ImGuiVoronoiGen/build

looks good, now try to build it up:

cmake --build .
[  4%] Creating directories for 'GLFW_LIB'
[  9%] Performing download step (git clone) for 'GLFW_LIB'
Cloning into 'glfw'...
Already on 'master'
Your branch is up to date with 'origin/master'.
[ 14%] Performing update step for 'GLFW_LIB'
[ 19%] No patch step for 'GLFW_LIB'
[ 23%] Performing configure step for 'GLFW_LIB'
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Including Wayland support
-- Including X11 support
-- Looking for memfd_create
-- Looking for memfd_create - found
CMake Error at src/CMakeLists.txt:76 (message):
  Failed to find wayland-scanner

-- Configuring incomplete, errors occurred!
gmake[2]: *** [CMakeFiles/GLFW_LIB.dir/build.make:92: GLFW_LIB-prefix/src/GLFW_LIB-stamp/GLFW_LIB-configure] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/GLFW_LIB.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
harshn05 commented 2 months ago

Try installing libwayland-dev and libwayland-bin (through apt) and then check.

greenozon commented 2 months ago

Thanks, but it was already installed before...

sudo apt install  libwayland-dev libwayland-bin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libwayland-bin is already the newest version (1.20.0-1ubuntu0.1).
libwayland-dev is already the newest version (1.20.0-1ubuntu0.1).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.
greenozon commented 2 months ago

sorry, it is progressing somehow:

> cmake --build .
[  4%] Performing update step for 'GLFW_LIB'
[  9%] No patch step for 'GLFW_LIB'
[ 14%] Performing configure step for 'GLFW_LIB'
-- Including Wayland support
-- Including X11 support
-- Checking for modules 'wayland-client>=0.2.7;wayland-cursor>=0.2.7;wayland-egl>=0.2.7;xkbcommon>=0.5.0'
--   No package 'xkbcommon' found
CMake Error at /usr/share/cmake-3.29/Modules/FindPkgConfig.cmake:619 (message):
  The following required packages were not found:

   - xkbcommon>=0.5.0

Call Stack (most recent call first):
  /usr/share/cmake-3.29/Modules/FindPkgConfig.cmake:847 (_pkg_check_modules_internal)
  src/CMakeLists.txt:164 (pkg_check_modules)

-- Configuring incomplete, errors occurred!
gmake[2]: *** [CMakeFiles/GLFW_LIB.dir/build.make:92: GLFW_LIB-prefix/src/GLFW_LIB-stamp/GLFW_LIB-configure] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/GLFW_LIB.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

tried to treat it but failed as well:

sudo apt install xkbcommon
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package xkbcommon
# ImGuiVoronoiGen/build on main 
> sudo apt install xkbcommon-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package xkbcommon-dev
harshn05 commented 2 months ago

Try: sudo apt install libxkbcommon-dev and then compile.

greenozon commented 2 months ago

Yeah, thanks for great hint! in Ubuntu world majority of libs are having the "lib" prefix... silly me :)

well, it gets some push forward, but still asking for more components!

--(0948:Fri,30 Aug 24:$ )-- cmake --build .
[  4%] Performing update step for 'GLFW_LIB'
[  9%] No patch step for 'GLFW_LIB'
[ 14%] Performing configure step for 'GLFW_LIB'
-- Including Wayland support
-- Including X11 support
-- Checking for modules 'wayland-client>=0.2.7;wayland-cursor>=0.2.7;wayland-egl>=0.2.7;xkbcommon>=0.5.0'
--   Found wayland-client, version 1.20.0
--   Found wayland-cursor, version 1.20.0
--   Found wayland-egl, version 18.1.0
--   Found xkbcommon, version 1.4.0
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
CMake Error at src/CMakeLists.txt:187 (message):
  RandR headers not found; install libxrandr development package

-- Configuring incomplete, errors occurred!
gmake[2]: *** [CMakeFiles/GLFW_LIB.dir/build.make:92: GLFW_LIB-prefix/src/GLFW_LIB-stamp/GLFW_LIB-configure] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:89: CMakeFiles/GLFW_LIB.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

this time it was easy cake as it hints in the error message (very good user friendly move!)

sudo apt install libxrandr-dev

helped out

new surprise~! :)

sudo apt install libxrandr-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libxrandr-dev is already the newest version (2:1.5.2-1build1).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.
--(oshpek@tplevo347)-(/home/oshpek/Downloads/gh/ImGuiVoronoiGen/build)--
--(0951:Fri,30 Aug 24:$ )-- cmake --build .
[  4%] Performing update step for 'GLFW_LIB'
[  9%] No patch step for 'GLFW_LIB'
[ 14%] Performing configure step for 'GLFW_LIB'
-- Including Wayland support
-- Including X11 support
CMake Error at src/CMakeLists.txt:193 (message):
  Xinerama headers not found; install libxinerama development package

-- Configuring incomplete, errors occurred!
harshn05 commented 2 months ago

Try sudo apt install libxinerama-dev and then compile.

greenozon commented 2 months ago

yeah, thanks

sudo apt install libxinerama-dev

new question!

cmake --build .
[  4%] Performing update step for 'GLFW_LIB'
[  9%] No patch step for 'GLFW_LIB'
[ 14%] Performing configure step for 'GLFW_LIB'
-- Including Wayland support
-- Including X11 support
CMake Error at src/CMakeLists.txt:205 (message):
  Xcursor headers not found; install libxcursor development package

-- Configuring incomplete, errors occurred!

fix

sudo apt install libxcursor-dev

also this needed

sudo apt install libxi-dev

^^^ the last one!!!

and we done!

...
[ 76%] Built target imgui
[ 80%] Building C object CMakeFiles/tinyfiledialogs.dir/tinyfiledialogs.c.o
[ 85%] Linking C static library libtinyfiledialogs.a
[ 85%] Built target tinyfiledialogs
[ 90%] Building C object CMakeFiles/ImGuiVoronoiGen.dir/tinyfiledialogs.c.o
[ 95%] Building CXX object CMakeFiles/ImGuiVoronoiGen.dir/main.cpp.o
[100%] Linking CXX executable ImGuiVoronoiGen
[100%] Built target ImGuiVoronoiGen
greenozon commented 2 months ago

Question: how to make the beautiful picture visible? all I see when running the built binary is this:

image

on your sample pic there is an Input Parameters window

how could I get it visible?

harshn05 commented 2 months ago

you have to drag the black window to the right. Then the panel for input parameters will be visible. You can generate those beautiful Voronoi diagrams using that panel.

greenozon commented 2 months ago

hurrey! Thanks for the hint, that was not obvious at the beginning...

Mission completed

image

harshn05 commented 2 months ago

Glad that it finally worked for you on your Ubuntu. Closing the issue now.