Skip to content

Compilation fails for Ubuntu 22.04 for static OpenCV build #677

Closed
@B-Acharya

Description

@B-Acharya

Hey,

I’m trying to compile OpenCV from source. I used the following GitHub Actions workflow as a reference to adapt my build setup:
https://github.com/spoorn/media-to-ascii/blob/a01017fbb3dc883a89b0a1aff237c69b072542b2/.github/workflows/build.yml

My end goal is to run a Rust application that uses opencv-rust. However, I don’t have sudo access on the server, so I intended to build everything from source. That led to a chain of other dependencies also needing to be compiled manually.

To work around this, I switched to creating a Docker container where I could compile the software (with static build) more freely and then transfer the binaries to the server. Unfortunately, the build failed within the Docker container as well, even though I followed a similar approach and used the same source build method from the link above.
os: Ubuntu 22.04

At the moment, I'm encountering the following error:

Here's a short version :

 = note:  "cc" "/tmp/rustc9SdQwi/symbols.o" "<6 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/dummy/target/debug/deps/{libopencv-43f16b46c3719e5e.rlib,liblibc-64d6d99ae5042bc9.rlib,libnum_traits-9a3d33f79b1f1db1.rlib}.rlib" "<sysroot>/lib/rustlib/aarch64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lstdc++" "-lopencv_videoio" "-lopencv_imgcodecs" "-lopencv_imgproc" "-lopencv_core" "-lippiw" "-littnotify" "-lippicv" "-lz" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustc9SdQwi/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/dummy/target/debug/build/opencv-c67461ea4adcdbd7/out" "-L" "/opt/opencv/lib" "-L" "/opt/opencv/lib/opencv4/3rdparty" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "<sysroot>/lib/rustlib/aarch64-unknown-linux-gnu/lib" "-o" "/dummy/target/debug/deps/dummy-62788e15c69e2488" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: cannot find -lippiw: No such file or directory
          /usr/bin/ld: cannot find -lippicv: No such file or directory
          /usr/bin/ld: cannot find -lz: No such file or directory
          collect2: error: ld returned 1 exit status

Here's the whole log from running cargo build -vv

out.log

Any hints on what might be going wrong or what could be updated would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions