Lymphatus / caesium-image-compressor

Caesium is an image compression software that helps you store, send and share digital pictures, supporting JPG, PNG, WebP and TIFF formats. You can quickly reduce the file size (and resolution, if you want) by preserving the overall quality of the image.
https://saerasoft.com/caesium
GNU General Public License v3.0
3.31k stars 202 forks source link

compiling on ubuntu 23:10: libcaesium.so, remove cargo, sources/build files, qt - sudo make install, then remove all sources #269

Open JeckPeppinger opened 3 months ago

JeckPeppinger commented 3 months ago

First of all - compiling on ubuntu 23.10 worked, and CIC works. Thx!!

pls. can you help with the command to install the CIC binary and the so's (and any other runtime dependencies if any)?

I tried sudo cmake install but cannot get the right command.

I want to install CiC and all runtime dependencies for all users on the machine, and then remove qt, sources, cargo to save space.

Thanks for any hint!

JeckPeppinger commented 3 months ago

After building again with the cmake commands as given in the readme.md the following error arises: caesium-image-compressor: error while loading shared libraries: libQt6Concurrent.so.6: cannot open shared object file: No such file or directory

This error came just after the second compile!

Lymphatus commented 3 months ago

The process on Linux is a bit more complicated than on other systems. If you want to compile and then remove all of build dependencies, you can use tool like linuxdeployqt, which will make a "self-contained" application. You can also take a look at #259 which is related to this issue. I will also try to give AppImages for Linux for future builds, so you can avoid compiling yourself.

JeckPeppinger commented 3 months ago

"caesium-image-compressor: error while loading shared libraries: libQt6Concurrent.so.6: cannot open shared object file: No such file or directory" Any hint how to resolve that?

I am really surprised that linux is not better supported. download, build, install, cleanup - long since i programmed myself, but this was a standard. The method you described for building on linux costs at least 5GB on the disk. A bit perverted to have a 5GB tool that helps reduce filesizes of pictures ....

Can you describe please how to install properly without need for carrying 5GB on a disk for the sources?

Lymphatus commented 3 months ago

TL;DR You can use this third-party build that ships an AppImage. Should run on Ubuntu 23.10, but I've not tested myself.

Caesium is a UI software based on Qt6. If you want to build it, you need to install Qt, which is very large indeed. This is only needed for compiling it, not running it. Once you compile it, the actual executable needs to have some libraries still on the system, one of them is libQt6Concurrent.so.6, but there are a few more. The process would roughly be:

At this point if you keep the Qt libraries, it should work. If you want to cleanup all the compilation requirements, you need to manually (or use linuxdeployqt) keep/copy the required libraries in a place where the executable can find them (the same folder works), because they are dynamically linked, not statically linked. Once you've done that, you can unistall Qt6 and all dependencies. This is the same way that me or you would do on Windows or macOS. The difference is that on Windows I can do this process myself and give you an installer or a zip** with an .exe, and on macOS I can do the same and give a .app, which is a self contained folder with all requirements. Not on Linux, because a binary build on Ubuntu might not run on Fedora, or Suse or any other distro.

In #259 we are discussing a way to simplify the Linux binary delivery. The process I described it's also documented here by Qt.

** if you look inside the zip of the portable version, you'll see an executable and some .dll. Those are Qt libraries that Caesium needs to run properly, as the error you got told you. If you look at the size of the zip, it's about 30Mb, so you don't need 5Gb to run it.