esimov/caire

Missing sources on Linux (Ubuntu) - maybe instructions could be updated

kivi opened this issue · 12 comments

kivi commented

Describe the bug

If I do go install github.com/esimov/caire/cmd/caire@latest I am getting following error:

In file included from ../../go/pkg/mod/gioui.org@v0.0.0-20211113093644-40bc2e1f88b8/internal/vk/vulkan_x11.go:13:
/usr/include/vulkan/vulkan.h:59:10: fatal error: X11/Xlib.h: No such file or directory
   59 | #include <X11/Xlib.h>
      |          ^~~~~~~~~~~~

I tried earlier to include in my go file in import ("github.com/esimov/caire") And experienced following errors:

No such file or directory for:

  • <wayland-client.h>
  • <vulkan/vulkan.h>

I could fix missing source files by installing dev version of the libs on Linux/Ubuntu with:

apt install libwayland-dev
apt install libwayland-dev

Bug with the Desktop version (please complete the following information):

Ubuntu 22.04.1 LTS

uname -r                                             
5.15.0-46-generic

-

Ideally the source files are not needed. I assume that would only be possible if you have precompiled binaries.

It's noted in the documentation that Gio requires some external libraries, but I considered that it's not strictly related to this project to mention all the Gio required dependencies. That's why I mentioned that for the external dependencies check out the Gio installation section.

kivi commented

I was was wondering why x11 sources are needed. Is it possible to make Caire work without Gio? And have maybe a project that wraps Caire with Gui tools?

I wanted to use Caire and compare it with Sharp or libvips. Sharp as well as Caire resize images smarter than just libvips.

By the way @esimov great work!

I'm not planning to separate the GUI part from the CLI application.

@kivi and @esimov were you able to run it on ubuntu. I keep getting this error
common: ERROR: failed to add default include path /usr/share/X11/xkb
xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb

Wondering if you ran into same. Thanks

kivi commented

@kartikwar I did not try it anymore. I have no use case to use it with GUI. My skills of Golang are still not so well, otherwise I would have tried process images "Caire", but without it's GUI.

kivi commented

@kartikwar You might want to check out

sudo apt-get install -y gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev

When I tried, there were some missing libs. I remember that I installed a few, but as said I did not dig in deeper.

@kartikwar You might want to check out

sudo apt-get install -y gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev

When I tried, there were some missing libs. I remember that I installed a few, but as said I did not dig in deeper.

Yes I already tried this. But I was still getting the same error. I also tried adding '/usr/share/X11/xkb' to my path, still getting the same issue :-(

Last time when I installed Caire as a snap I owned a PC with Linux installed and it worked, that's why I managed to put it on snapcrapt. Unfortunately I'm not anymore into the possession of a native Linux based system. I'm running Ubuntu under WSL2 and having a MacOS based laptop, but as you might know, Snap is not working flawlessly on these environments. I've tried to install snap on both systems, but they are not working as you might expect to work on a Linux based system. I would really like to help, but until I'm not installing a Linux VM, with much regret I'm not able to help, but if you manage to solve the problem, I would be really grateful for your contribution.

Thanks for your replies @esimov and @kivi. I will try to find somethin
g online. I don't think snap has good support for go or other libraries. Also for more context I am on ubuntu 20.04

Attaching the screenshot of full error here.

Screenshot from 2022-10-10 21-59-19

I finally got this to work on Ubuntu (18.04+). Anyone looking for instructions might find this useful:
1.) install Go, set your GOPATH, and make sure $GOPATH/bin is on your PATH.
2.) install the GIOUI Libraries. Follow the instructions at https://gioui.org/doc/install/linux
3.) Try running the command go run gioui.org/example/hello@latest. If this fails, please follow the thread. Adding export LC_ALL=en_US.UTF-8 to my .bashrc worked for me.
4.) Assuming command 3 works, run go run github.com/esimov/caire/cmd/caire@latest -in input.jpeg -out output.jpeg. Please note that running directly with the command caire -in input.jpg -out output.jpg did not work for me. It gives the same error related to xkbcommon.

Wait, where did you tried to install the gio required dependencies? The snapcraft.yaml should provide all the required dependencies.

For me, it was not working for some reason. So had to install them separately. Not sure. The users can feel free to skip them