-
Notifications
You must be signed in to change notification settings - Fork 21
Description
There is an issue in Ubuntu 18.04 and systems based on it (including the very popular Linux Mint 19.3): after installing the all the dependencies and compilers and doing cmake -G "Unix Makefiles" --build .., the compiler throws a bunch of errors like
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.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 JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11"
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34")
-- Found TIFF: /usr/lib/x86_64-Linux-gnu/Libtiff.so (found version "4.0.9")
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- unit_test_framework
-- prg_exec_monitor
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread create
-- Looking for pthread create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
CMake Error at src/core/CMakeLists.txt:120 (add library):
Target "core" links to target "JPEG::JPEG" but the target was not found.
Perhaps a find package() call is missing for an IMPORTED target, or an
ALIAS target is missing?
CMake Error at src/core/interaction/CMakeLists.txt:14 (add_library):
Target "interaction" links to target "JPEG::JPEG" but the target was not
found. Perhaps a find package() call is missing for an IMPORTED target, or
an ALIAS target is missing?
The version of CMake that is proposed in the repositories for Ubuntu-18.04-based distributions is 3.10, and it is probably slightly broken, so what helped—and what is currently outside the scope of this tutorial and what a strongly recommend to the ‘Troubleshooting’ section is the following:
— If CMake produces errors complaining about not finding targets despite all libraries with development headers already being present in the system, then remove CMake (sudo apt remove cmake cmake-data) and compile CMake from sources:
cd cmake-3.17.1/
./bootstrap --parallel=2 -- -DCMAKE_BUILD_TYPE:STRING=Release
make -j2
make install(or replacing the last line with sudo checkinstall --fstrans=no for easier uninstallation even when the sources are gone), and after that, CMake should find all libraries and compile scantailor-advanced without a hindrance.