Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to build on Linux #5

Open
InventoryTech opened this issue Aug 25, 2020 · 7 comments
Open

Failure to build on Linux #5

InventoryTech opened this issue Aug 25, 2020 · 7 comments

Comments

@InventoryTech
Copy link

InventoryTech commented Aug 25, 2020

I came across your imager project on GitHub while looking at various image compression software. I was able to download and run it on Ubuntu, and it does a fantastic job on compression. Well done on developing this awesome utility!

I am now trying to compile it for a Raspberry Pi but am running into some errors.

I followed the steps in the 'install.md' file in the project:

  • curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • apt-get install -y build-essential llvm-dev libclang-dev clang openssl pkg-config libssl-dev xz-utils
  • git clone https://github.com/imager-io/imager.git && cd imager
  • cargo install --path imager --force

If I run the compile with the --verbose option I get the following output:

Running `rustc --crate-name webp_dev --edition=2018 /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/webp-dev-0.4.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no --cfg 'feature="default"' -C metadata=0d370911ed82618f -C extra-filename=-0d370911ed82618f --out-dir /tmp/cargo-installKBNy5i/release/deps -L dependency=/tmp/cargo-installKBNy5i/release/deps --extern image=/tmp/cargo-installKBNy5i/release/deps/libimage-a4bacbab917eac6b.rmeta --extern libc=/tmp/cargo-installKBNy5i/release/deps/liblibc-5103d3a8c700d90d.rmeta --cap-lints allow -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out/webmproject-libwebp-8bac456/src -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out/webmproject-libwebp-8bac456/src/demux -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out -l static=webp -l static=webpdemux -l static=cbits`
error: could not find native static library `webp`, perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `webp-dev`.

Caused by:
  process didn't exit successfully: `rustc --crate-name webp_dev --edition=2018 /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/webp-dev-0.4.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no --cfg 'feature="default"' -C metadata=0d370911ed82618f -C extra-filename=-0d370911ed82618f --out-dir /tmp/cargo-installKBNy5i/release/deps -L dependency=/tmp/cargo-installKBNy5i/release/deps --extern image=/tmp/cargo-installKBNy5i/release/deps/libimage-a4bacbab917eac6b.rmeta --extern libc=/tmp/cargo-installKBNy5i/release/deps/liblibc-5103d3a8c700d90d.rmeta --cap-lints allow -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out/webmproject-libwebp-8bac456/src -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out/webmproject-libwebp-8bac456/src/demux -L native=/tmp/cargo-installKBNy5i/release/build/webp-dev-cd4262d980e28f83/out -l static=webp -l static=webpdemux -l static=cbits` (exit code: 1)

This error happens on the Raspberry Pi and Ubuntu (WSL)

Some system information for the PI

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.19.93-v7+ #1290 SMP Fri Jan 10 16:39:50 GMT 2020 armv7l GNU/Linux

Some system information for Ubuntu (WSL)

user@laptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal
user@laptop:~$ uname -a
Linux laptop 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Any advice on how to fix this?

@InventoryTech InventoryTech changed the title Failure to build on Raspberry Pi Failure to build on Linux Aug 25, 2020
@StevenJiang1110
Copy link

I encounter the same issue when I try to build from source, on my x86-64, ubuntu18.04 machine. I don't know how to add the static library dependency. Hope for some advice

@atk
Copy link

atk commented Mar 2, 2021

I have a similar issue in void linux, where I added libwebp-devel (which should be the equivalent of libwebp-dev in ubuntu), but encountered a fatal error that stddef.h could not be found when it was clearly available.

@phocks
Copy link

phocks commented Nov 3, 2021

Getting the same error..

@tbeckley
Copy link

Still an issue :(, I have libwebp-devel installed on Fedora 36 but still get the error. No amount of RUSTFLAGS environment variables seems to get it done for me.

PS atk the stddef.h issue I solved by ensuring clang was installed (not just clang-llvm or whatever the other package is called).

@mxdpeep
Copy link

mxdpeep commented Dec 4, 2022

  • apt-get install -y build-essential llvm-dev libclang-dev clang openssl pkg-config libssl-dev xz-utils

this solved the problem:

sudo apt install libwebp-dev

$ which imager
/home/mxdpeep/.cargo/bin/imager
$ imager --version
imager 0.3.2

@mxdpeep
Copy link

mxdpeep commented Dec 4, 2022

sudo apt-get install -y build-essential llvm-dev libclang-dev clang openssl pkg-config libssl-dev xz-utils
sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev libwebp-dev
cargo install imager

no errors

rustc 1.65.0 (897e37553 2022-11-02)

@mrusme
Copy link

mrusme commented Jan 18, 2024

Having trouble building this as well:

error: failed to run custom build command for `webp-dev v0.4.1`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installB7gZGS/release/build/webp-dev-669d82b7c8196503/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-search=native=/tmp/cargo-installB7gZGS/release/build/webp-dev-76a9c299cd1ee3de/out/webmproject-libwebp-8bac456/src
  cargo:rustc-link-search=native=/tmp/cargo-installB7gZGS/release/build/webp-dev-76a9c299cd1ee3de/out/webmproject-libwebp-8bac456/src/demux
  cargo:rustc-link-lib=static=webp
  cargo:rustc-link-lib=static=webpdemux

  --- stderr
  thread 'main' panicked at /home/mrus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.51.1/src/ir/context.rs:891:9:
  "WebPDecBuffer_union_(unnamed_at_/tmp/cargo-installB7gZGS/release/build/webp-dev-76a9c299cd1ee3de/out/webmproject-libwebp-8bac456/src/webp/decode_h_210_3)" is not a valid Ident

However, since this repo has been basically unmaintained for the past four years I guess it's time to move on. In case anyone has recommendations for an alternative to imager I'd appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants