maxcurzi / tplay

A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.
MIT License
246 stars 16 forks source link

(Error) can't build on Pop OS 22.04 #27

Closed hardBSDk closed 11 months ago

hardBSDk commented 11 months ago

It uses Ubuntu 22.04 LTS, I installed the required packages and executed cargo install tplay, see the log below:

error: failed to run custom build command for `opencv v0.84.5`

Caused by:
  process didn't exit successfully: `/tmp/cargo-install8MdwPO/release/build/opencv-9d8ea3753e3b9234/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=OPENCV4_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENCV4_STATIC
  cargo:rerun-if-env-changed=OPENCV4_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=SYSROOT
  cargo:rerun-if-env-changed=OPENCV4_STATIC
  cargo:rerun-if-env-changed=OPENCV4_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENCV4_STATIC
  cargo:rerun-if-env-changed=OPENCV4_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rustc-cfg=ocvrs_opencv_branch_4
  cargo:rerun-if-env-changed=OPENCV_PACKAGE_NAME
  cargo:rerun-if-env-changed=OPENCV_PKGCONFIG_NAME
  cargo:rerun-if-env-changed=OPENCV_CMAKE_NAME
  cargo:rerun-if-env-changed=OPENCV_CMAKE_BIN
  cargo:rerun-if-env-changed=OPENCV_VCPKG_NAME
  cargo:rerun-if-env-changed=OPENCV_LINK_LIBS
  cargo:rerun-if-env-changed=OPENCV_LINK_PATHS
  cargo:rerun-if-env-changed=OPENCV_INCLUDE_PATHS
  cargo:rerun-if-env-changed=OPENCV_DISABLE_PROBES
  cargo:rerun-if-env-changed=OPENCV_MSVC_CRT
  cargo:rerun-if-env-changed=CMAKE_PREFIX_PATH
  cargo:rerun-if-env-changed=OpenCV_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=VCPKG_ROOT
  cargo:rerun-if-env-changed=VCPKGRS_DYNAMIC
  cargo:rerun-if-env-changed=VCPKGRS_TRIPLET
  cargo:rerun-if-env-changed=OCVRS_DOCS_GENERATE_DIR
  cargo:rerun-if-env-changed=DOCS_RS
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/gapi.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/ocvrs_common.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/core.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/ccalib.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/alphamat.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/photo.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/face.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/xfeatures2d.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/hdf.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/aruco.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/videoio.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/sfm.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/manual-core.cpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/bioinspired.hpp
  cargo:rerun-if-changed=/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp/dnn.hpp
  cargo:rerun-if-changed=Cargo.toml

  --- stderr
  === Crate version: Some("0.84.5")
  === Environment configuration:
  ===   OPENCV_PACKAGE_NAME = None
  ===   OPENCV_PKGCONFIG_NAME = None
  ===   OPENCV_CMAKE_NAME = None
  ===   OPENCV_CMAKE_BIN = None
  ===   OPENCV_VCPKG_NAME = None
  ===   OPENCV_LINK_LIBS = None
  ===   OPENCV_LINK_PATHS = None
  ===   OPENCV_INCLUDE_PATHS = None
  ===   OPENCV_DISABLE_PROBES = None
  ===   OPENCV_MSVC_CRT = None
  ===   CMAKE_PREFIX_PATH = None
  ===   OpenCV_DIR = None
  ===   PKG_CONFIG_PATH = None
  ===   VCPKG_ROOT = None
  ===   VCPKGRS_DYNAMIC = None
  ===   VCPKGRS_TRIPLET = None
  ===   OCVRS_DOCS_GENERATE_DIR = None
  ===   DOCS_RS = None
  ===   PATH = Some("/home/hatred_45/.cargo/bin:/home/hatred_45/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/hatred_45/.dotnet/tools")
  === Enabled features:
  ===   CLANG_RUNTIME
  ===   IMGPROC
  ===   VIDEOIO
  === Detected probe priority based on environment vars: pkg_config: false, cmake: false, vcpkg: false
  === Probing the OpenCV library in the following order: environment, pkg_config, cmake, vcpkg_cmake, vcpkg
  === Can't probe using: environment, continuing with other methods because: Some environment variables are missing
  === Probing OpenCV library using pkg_config
  === Successfully probed using: pkg_config
  === OpenCV library configuration: Library {
      include_paths: [
          "/usr/include/opencv4",
      ],
      version: Version {
          major: 4,
          minor: 5,
          patch: 4,
      },
      cargo_metadata: [
          "cargo:rustc-link-search=/usr/lib/x86_64-linux-gnu",
          "cargo:rustc-link-lib=opencv_stitching",
          "cargo:rustc-link-lib=opencv_alphamat",
          "cargo:rustc-link-lib=opencv_aruco",
          "cargo:rustc-link-lib=opencv_barcode",
          "cargo:rustc-link-lib=opencv_bgsegm",
          "cargo:rustc-link-lib=opencv_bioinspired",
          "cargo:rustc-link-lib=opencv_ccalib",
          "cargo:rustc-link-lib=opencv_dnn_objdetect",
          "cargo:rustc-link-lib=opencv_dnn_superres",
          "cargo:rustc-link-lib=opencv_dpm",
          "cargo:rustc-link-lib=opencv_face",
          "cargo:rustc-link-lib=opencv_freetype",
          "cargo:rustc-link-lib=opencv_fuzzy",
          "cargo:rustc-link-lib=opencv_hdf",
          "cargo:rustc-link-lib=opencv_hfs",
          "cargo:rustc-link-lib=opencv_img_hash",
          "cargo:rustc-link-lib=opencv_intensity_transform",
          "cargo:rustc-link-lib=opencv_line_descriptor",
          "cargo:rustc-link-lib=opencv_mcc",
          "cargo:rustc-link-lib=opencv_quality",
          "cargo:rustc-link-lib=opencv_rapid",
          "cargo:rustc-link-lib=opencv_reg",
          "cargo:rustc-link-lib=opencv_rgbd",
          "cargo:rustc-link-lib=opencv_saliency",
          "cargo:rustc-link-lib=opencv_shape",
          "cargo:rustc-link-lib=opencv_stereo",
          "cargo:rustc-link-lib=opencv_structured_light",
          "cargo:rustc-link-lib=opencv_phase_unwrapping",
          "cargo:rustc-link-lib=opencv_superres",
          "cargo:rustc-link-lib=opencv_optflow",
          "cargo:rustc-link-lib=opencv_surface_matching",
          "cargo:rustc-link-lib=opencv_tracking",
          "cargo:rustc-link-lib=opencv_highgui",
          "cargo:rustc-link-lib=opencv_datasets",
          "cargo:rustc-link-lib=opencv_text",
          "cargo:rustc-link-lib=opencv_plot",
          "cargo:rustc-link-lib=opencv_ml",
          "cargo:rustc-link-lib=opencv_videostab",
          "cargo:rustc-link-lib=opencv_videoio",
          "cargo:rustc-link-lib=opencv_viz",
          "cargo:rustc-link-lib=opencv_wechat_qrcode",
          "cargo:rustc-link-lib=opencv_ximgproc",
          "cargo:rustc-link-lib=opencv_video",
          "cargo:rustc-link-lib=opencv_xobjdetect",
          "cargo:rustc-link-lib=opencv_objdetect",
          "cargo:rustc-link-lib=opencv_calib3d",
          "cargo:rustc-link-lib=opencv_imgcodecs",
          "cargo:rustc-link-lib=opencv_features2d",
          "cargo:rustc-link-lib=opencv_dnn",
          "cargo:rustc-link-lib=opencv_flann",
          "cargo:rustc-link-lib=opencv_xphoto",
          "cargo:rustc-link-lib=opencv_photo",
          "cargo:rustc-link-lib=opencv_imgproc",
          "cargo:rustc-link-lib=opencv_core",
      ],
  }
  === Detected OpenCV module header dir at: /usr/include/opencv4/opencv2
  === Found OpenCV version: 4.5.4 in headers located at: /usr/include/opencv4
  === Generating code in: /tmp/cargo-install8MdwPO/release/build/opencv-30df3ea95ea5c3a5/out
  === Placing generated bindings into: /tmp/cargo-install8MdwPO/release/build/opencv-30df3ea95ea5c3a5/out/opencv
  === Using OpenCV headers from: /usr/include/opencv4
  === Clang: Ubuntu clang version 14.0.0-1ubuntu1.1
  === Clang command line args: [
      "-isystem/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++",
      "-isystem/usr/lib/llvm-14/lib/clang/14.0.0/include",
      "-isystem/usr/local/include",
      "-isystem/usr/include/x86_64-linux-gnu",
      "-isystem/usr/include",
      "-I/usr/include/opencv4",
      "-F/usr/include/opencv4",
      "-I/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp",
      "-F/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp",
      "-DOCVRS_PARSING_HEADERS",
      "-includeocvrs_common.hpp",
      "-std=c++14",
  ]
  === Available jobs from the environment created jobserver is: 0 or there is an error reading that value
  === Creating a new job server with num_jobs: 4
  === Generating 3 modules
  === Running: "/tmp/cargo-install8MdwPO/release/build/opencv-9d8ea3753e3b9234/build-script-build" "/usr/include/opencv4" "/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp" "/tmp/cargo-install8MdwPO/release/build/opencv-30df3ea95ea5c3a5/out" "imgproc" ""
  === Running: "/tmp/cargo-install8MdwPO/release/build/opencv-9d8ea3753e3b9234/build-script-build" "/usr/include/opencv4" "/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp" "/tmp/cargo-install8MdwPO/release/build/opencv-30df3ea95ea5c3a5/out" "core" ""
  === Running: "/tmp/cargo-install8MdwPO/release/build/opencv-9d8ea3753e3b9234/build-script-build" "/usr/include/opencv4" "/home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/src_cpp" "/tmp/cargo-install8MdwPO/release/build/opencv-30df3ea95ea5c3a5/out" "videoio" ""
  === WARNING: 1 diagnostic messages
  ===    /usr/include/opencv4/opencv2/core/cvdef.h:185:10: fatal error: 'limits' file not found
  thread 'main' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-binding-generator-0.72.0/src/generator.rs:396:17:
  === Errors during header parsing
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  === WARNING: 1 diagnostic messages
  ===    /usr/include/opencv4/opencv2/core/cvdef.h:185:10: fatal error: 'limits' file not found
  thread 'main' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-binding-generator-0.72.0/src/generator.rs:396:17:
  === Errors during header parsing
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  === WARNING: 1 diagnostic messages
  ===    /usr/include/opencv4/opencv2/core/cvdef.h:185:10: fatal error: 'limits' file not found
  thread 'main' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-binding-generator-0.72.0/src/generator.rs:396:17:
  === Errors during header parsing
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  thread '<unnamed>' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build/generator.rs:108:25:
  Failed to run the bindings generator for module: videoio
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  thread '<unnamed>' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build/generator.rs:108:25:
  Failed to run the bindings generator for module: imgproc
  thread '<unnamed>' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build/generator.rs:108:25:
  Failed to run the bindings generator for module: core
  thread 'main' panicked at /home/hatred_45/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opencv-0.84.5/build/generator.rs:117:32:
  Generator process panicked: Any { .. }
warning: build failed, waiting for other jobs to finish...
error: failed to compile `tplay v0.4.5 (https://github.com/maxcurzi/tplay#d40876cc)`, intermediate artifacts can be found at `/tmp/cargo-install8MdwPO`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
maxcurzi commented 11 months ago

It looks like there's something wrong with the OpenCV installation,

/usr/include/opencv4/opencv2/core/cvdef.h:185:10: fatal error: 'limits' file not found

Can you try this and and try to install again? https://github.com/twistedfall/opencv-rust/issues/419#issuecomment-1413418778

hardBSDk commented 11 months ago

@maxcurzi Worked! thanks, add this package on the "required packages" section.