So I am a redhat fan - specifically a fedora linux fan. Lotβs of people are! Anyways, I am exploring UI options in Julia for front ends right now. One keenly caught my eye(GitHub - Gnimuc/CImGui.jl: Julia wrapper for cimgui). It looks so easy, smart, and fast, I want to use it! Trouble is, when I try to run it, the GLFW backend explodes(GitHub - JuliaGL/GLFW.jl: Julia interface to GLFW, a multi-platform library for creating windows with OpenGL contexts and managing input and events. , GLFW: Release notes)
the message I get is the following:
β Error: Error building `GLFW`:
β -- The C compiler identification is GNU 8.3.1
β -- 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
β -- 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
β -- Using X11 for window creation
β -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/libXext.so
β -- Looking for XOpenDisplay in /usr/lib64/libX11.so;/usr/lib64/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
β -- Found X11: /usr/lib64/libX11.so
β -- Configuring done
β -- Generating done
β -- Build files have been written to: /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src/build
β Scanning dependencies of target glfw
β [ 5%] Building C object src/CMakeFiles/glfw.dir/context.c.o
β In file included from /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src/src/internal.h:187,
β from /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src/src/context.c:28:
β /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src/src/x11_platform.h:48:10: fatal error: X11/extensions/XInput2.h: No such file or directory
β #include <X11/extensions/XInput2.h>
β ^~~~~~~~~~~~~~~~~~~~~~~~~~
β compilation terminated.
β gmake[2]: *** [src/CMakeFiles/glfw.dir/build.make:63: src/CMakeFiles/glfw.dir/context.c.o] Error 1
β gmake[1]: *** [CMakeFiles/Makefile2:123: src/CMakeFiles/glfw.dir/all] Error 2
β gmake: *** [Makefile:130: all] Error 2
β [ Info: Unpacking /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src.tar.gz into /home/caseykneale/.julia/packages/GLFW/e257h/deps/usr/downloads/src
β β Warning:
β β ================================================================
β β ================================================================
β β === Building GLFW has failed. Most common problem is, ===
β β === that you don't have x-org installed. ===
β β === You can install it via: `sudo apt-get install xorg-dev` ===
β β ================================================================
β β ================================================================
β β @ Main ~/.julia/packages/GLFW/e257h/deps/build.jl:56
β ERROR: LoadError: failed process: Process(`/home/caseykneale/.julia/packages/CMake/nSK2r/deps/usr/bin/cmake --build .`, ProcessExited(2)) [2]
β Stacktrace:
β [1] run at ./process.jl:661 [inlined]
β [2] (::getfield(Main, Symbol("##9#10")))() at /home/caseykneale/.julia/packages/GLFW/e257h/deps/build.jl:52
β [3] cd(::getfield(Main, Symbol("##9#10")), ::String) at ./file.jl:96
β [4] top-level scope at /home/caseykneale/.julia/packages/GLFW/e257h/deps/build.jl:43
β [5] include(::String) at ./client.jl:392
β [6] top-level scope at none:0
β in expression starting at /home/caseykneale/.julia/packages/GLFW/e257h/deps/build.jl:21
So we have an issue here - the GLFW install thinks Iβm using X11 and Iβm not! Thereβs an issue raised for this, on the GLFW repo by someone else in the same boat. https://github.com/JuliaGL/GLFW.jl/issues/188 , I wanna actually contribute to this fix if I can because not everyone wants to install a VM or download an OS to extend a package their working on for free!
My question is, where - if ever in GLFW.jl or in a Julia package does a call to Pkg.build install a dependancy like GLFW? I am pretty convinced it doesnt, but man, Iβm not an expert. So is the issue with GLFW library itself? Or Fedoraβs package manager (dnf) not running an up to date install of GLFW that looks for wayland?
Checking for wayland appears trivial(c++ - How I can find out if a Linux system uses Wayland or X11? - Stack Overflow), and specifying a wayland install of GLFW again also trivial(https://github.com/glfw/glfw/issues/986). I just canβt find where the hell to put the fix! Any help appreciated - this really isnβt my area of expertise but I think itβs important. At least for me and maybe one other Julian it is.