Lymphatus / caesium-clt

Caesium Command Line Tools - Lossy/lossless image compression tool
http://saerasoft.com/caesium
Other
354 stars 34 forks source link

It compiled but coudn't install #48

Closed fatihmert closed 2 years ago

fatihmert commented 2 years ago

I'm using WSL2.0 on Windows 10. My steps below;

For libcaesium

git clone https://github.com/Lymphatus/libcaesium
cd libcaesium && cargo build --release

For CLT. I followed from INSTALL.md

git clone https://github.com/Lymphatus/caesium-clt
cd caesium-clt
mkdir build && cd build
cmake .. -DLIBCAESIUM_PATH=/libcaesium/target/release
-- Configuring done
-- Generating done
-- Build files have been written to: /caesium-clt/build
make
Scanning dependencies of target caesiumclt
[ 14%] Building C object src/CMakeFiles/caesiumclt.dir/vendor/optparse.c.o
[ 28%] Building C object src/CMakeFiles/caesiumclt.dir/error.c.o
[ 42%] Building C object src/CMakeFiles/caesiumclt.dir/helper.c.o
[ 57%] Building C object src/CMakeFiles/caesiumclt.dir/main.c.o
[ 71%] Building C object src/CMakeFiles/caesiumclt.dir/shared.c.o
[ 85%] Building C object src/CMakeFiles/caesiumclt.dir/utils.c.o
[100%] Linking C executable caesiumclt
[100%] Built target caesiumclt
sudo make install
[100%] Built target caesiumclt
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/caesiumclt
-- Set runtime path of "/usr/local/bin/caesiumclt" to ""

I want to try test run command as caesiumclt (that's only)

caesiumclt: error while loading shared libraries: libcaesium.so: cannot open shared object file: No such file or directory

But I have libcaesium.so file in libcaesium builded dir in release/target relative path.

Test this command as ls -l libcaesium/target/release

total 8488
drwxrwxrwx 1 fatihmert fatihmert    4096 May 18 10:42 build
drwxrwxrwx 1 fatihmert fatihmert    4096 May 18 10:46 deps
drwxrwxrwx 1 fatihmert fatihmert    4096 May 18 10:42 examples
drwxrwxrwx 1 fatihmert fatihmert    4096 May 18 10:42 incremental
-rwxrwxrwx 1 fatihmert fatihmert     764 May 18 10:46 libcaesium.d
-rwxrwxrwx 2 fatihmert fatihmert 1339070 May 18 10:46 libcaesium.rlib
-rwxrwxrwx 2 fatihmert fatihmert 7347440 May 18 10:46 libcaesium.so

How to solve this?

Lymphatus commented 2 years ago

The executable searches for the library in the standard lib paths (like /usr/lib or /usr/local/lib) Probably by just copying libcaesium.so to /usr/local/lib should solve the problem.

cp libcaesium/target/release/libcaesium.so /usr/local/lib/libcaesium.so

I think this is something the docs are missing.

fatihmert commented 2 years ago

Really. I ashamed for asked that. I'm foreign both linux system and c/c++ compiling things. I was think logicable use WSL

This problem solution is /usr/lib instead of /usr/local/lib with sudo permission.