Vcpkg: Tesseract fails to install

Created on 29 May 2018  路  8Comments  路  Source: microsoft/vcpkg

After running vcpkg install tesseract on Ubuntu 18.04 under WSL.

...
looking for conflicting packages...
:: msys2-runtime and catgets are in conflict. Remove catgets? [y/N]
:: msys2-runtime and catgets are in conflict
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
-- Acquiring MSYS2... OK
-- Acquiring MSYS Packages...
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
    Command failed: /mnt/c/Users/kane/repos/vcpkg-linux/downloads/tools/msys2/msys32/usr/bin/bash.exe;--noprofile;--norc;-c;pacman -Sy --noconfirm --needed make automake1.15
    Working Directory: /mnt/c/Users/kane/repos/vcpkg-linux/downloads/tools/msys2
    See logs for more information:
      /mnt/c/Users/kane/repos/vcpkg-linux/buildtrees/icu/msys-pacman-x64-linux-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_acquire_msys.cmake:104 (vcpkg_execute_required_process)
  ports/icu/portfile.cmake:34 (vcpkg_acquire_msys)
  scripts/ports.cmake:72 (include)


Error: Building package icu:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: icu:x64-linux
  Vcpkg version: 0.0.113-unknownhash
...

Why is pacman being invoked?

port-bug

All 8 comments

The log file contains /usr/bin/bash: pacman: command not found.

and msys2-runtime in ubuntu no, the port needs Change by linux

I'm seeing the same problem with ./vcpkg install icu. I think this is what @Voskrese was saying, but the ICU portfile is not prepared to run on Linux at all: e.g. its use of MSYS, and how all of the CFLAGS it sets are MSVC-specific (e,g, -MT, -INCREMENTAL:NO, ...).

I've submitted #3683, which is specifically about the problem with ICU. I don't think that will completely fix tesseract on Linux though: the leptonica port and tesseract itself may also need adjustments.

On Linux, tesseract 4.0.0 build has 2 problems:
1. leptonica is built successfully, but tesseract complaints about leptonica not found because CMake searches leptonica from pkg-config.
Please patch CMakeLists.txt:
- use find_package(Leptonica)
- do not use find_package(PkgConfig)
- do not usepkg_check_modules(Leptonica)

  1. tesseract.exe in portfile.cmake
    file(COPY ${CURRENT_PACKAGES_DIR}/bin/tesseract.exe ...) is for Windows only. For other platforms it should be file(COPY ${CURRENT_PACKAGES_DIR}/bin/tesseract ...)
Starting package 9/9: tesseract:x64-linux
Building package tesseract[core]:x64-linux...
-- Using cached /src/downloads/tesseract-ocr-tesseract-4.0.0.tar.gz
-- Extracting source /src/downloads/tesseract-ocr-tesseract-4.0.0.tar.gz
-- Using source at /src/buildtrees/tesseract/src/4.0.0-ddc79d0f29
-- Applying patch /src/ports/tesseract/use-vcpkg-icu.patch
-- Applying patch failed. This is expected if this patch was previously applied.
-- Applying patch /src/ports/tesseract/ws2-32.patch
-- Applying patch failed. This is expected if this patch was previously applied.
-- Applying patch /src/ports/tesseract/leptonica.patch
-- Configuring x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:56 (message):
    Command failed: /src/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-Linux-x86_64/bin/cmake;/src/buildtrees/tesseract/src/4.0.0-ddc79d0f29;-DSTATIC=ON;-DUSE_SYSTEM_ICU=True;-DCMAKE_MAKE_PROGRAM=/src/downloads/tools/ninja-1.8.2-linux/ninja;-DCMAKE_SYSTEM_NAME=Linux;-DBUILD_SHARED_LIBS=OFF;-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/src/scripts/toolchains/linux.cmake;-DVCPKG_TARGET_TRIPLET=x64-linux;-DVCPKG_PLATFORM_TOOLSET=external;-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON;-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON;-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON;-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE;-DCMAKE_VERBOSE_MAKEFILE=ON;-DVCPKG_APPLOCAL_DEPS=OFF;-DCMAKE_TOOLCHAIN_FILE=/src/scripts/buildsystems/vcpkg.cmake;-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON;-DVCPKG_CXX_FLAGS=;-DVCPKG_CXX_FLAGS_RELEASE=;-DVCPKG_CXX_FLAGS_DEBUG=;-DVCPKG_C_FLAGS=;-DVCPKG_C_FLAGS_RELEASE=;-DVCPKG_C_FLAGS_DEBUG=;-DVCPKG_CRT_LINKAGE=dynamic;-DVCPKG_LINKER_FLAGS=;-DCMAKE_INSTALL_LIBDIR:STRING=lib;-DCMAKE_INSTALL_BINDIR:STRING=bin;-G;Ninja;-DCMAKE_BUILD_TYPE=Debug;-DCMAKE_INSTALL_PREFIX=/src/packages/tesseract_x64-linux/debug
    Working Directory: /src/buildtrees/tesseract/x64-linux-dbg
    Error code: 1
    See logs for more information:
      /src/buildtrees/tesseract/config-x64-linux-dbg-out.log
      /src/buildtrees/tesseract/config-x64-linux-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_cmake.cmake:282 (vcpkg_execute_required_process)
  ports/tesseract/portfile.cmake:24 (vcpkg_configure_cmake)
  scripts/ports.cmake:71 (include)


Error: Building package tesseract:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: tesseract:x64-linux
  Vcpkg version: 2018.11.23-unknownhash

Additionally, attach any relevant sections from the log files above.

real    12m27.830s
user    10m42.364s
sys     1m34.456s
root@localhost:/src# cat /src/buildtrees/tesseract/config-x64-linux-dbg-out.log
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'lept>=1.74'
--   No package 'lept' found
-- Configuring incomplete, errors occurred!
See also "/src/buildtrees/tesseract/x64-linux-dbg/CMakeFiles/CMakeOutput.log".

Hi @lucivpav @linquize, Does the issue persist? Tesseract has been upgrade to version 4.1.0, I installed it successfully with VCPKG latest source on Linux 18.04.

./vcpkg install tesseract
The following packages will be built and installed:

giflib[core]:x64-linux
leptonica[core]:x64-linux
libjpeg-turbo[core]:x64-linux
liblzma[core]:x64-linux
libpng[core]:x64-linux
tesseract[core]:x64-linux
tiff[core]:x64-linux
zlib[core]:x64-linux
Additional packages (*) will be modified to complete this operation.
......
Starting package 8/8: tesseract:x64-linux
Building package tesseract[core]:x64-linux...
-- Downloading https://github.com/tesseract-ocr/tesseract/archive/4.1.0.tar.gz.. .
-- Extracting source /home/vwangli/Lily/vcpkg/downloads/tesseract-ocr-tesseract- 4.1.0.tar.gz
-- Applying patch fix-tiff-linkage.patch
-- Using source at /home/vwangli/Lily/vcpkg/buildtrees/tesseract/src/4.1.0-61460 4da36
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
-- Building x64-linux-rel
-- Performing post-build validation
-- Performing post-build validation done
Building package tesseract[core]:x64-linux... done
Installing package tesseract[core]:x64-linux...
Installing package tesseract[core]:x64-linux... done
Elapsed time for package tesseract:x64-linux: 1.772 min
Total elapsed time: 2.806 min

The package tesseract:x64-linux provides CMake targets:

find_package(Tesseract CONFIG REQUIRED)
target_link_libraries(main PRIVATE libtesseract)

Thanks for posting this issue. Please open a new issue if this is still a problem for you.

4.1.0 linux is OK now

Only 4.0.0 linux broken

Was this page helpful?
0 / 5 - 0 ratings