4lex4 / scantailor-libs-build Goto Github PK
View Code? Open in Web Editor NEWBuilding scantailor and its dependencies
Building scantailor and its dependencies
On Ubuntu 18.04 this command is not valid:
cmake -G "Unix Makefiles" --build ..
The double-dash on the build token seems spurious and it works without it, e.g.:
cmake -G "Unix Makefiles" build ..
All I want is STA, I am willing to get this going, but I have no clue how to run these scripts let alone find them. Do I run them in cmd or ming or msys or Git bash? I am absolutely lost. I dont code. I scan. I would be ever so grateful if someone who at least break it down for me like a 5 year old because thats about the level of git experience I have.
I received fatal error trying to run mingw32-make -j. Do you have a suggestion I can try.
C:\scantailor\sources\build>cmake -G "MinGW Makefiles" --build ..
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/mingw64/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/mingw64/mingw64/bin/gcc.exe -- 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: C:/mingw64/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/mingw64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Boost (missing: unit_test_framework prg_exec_monitor) (found
suitable version "1.70.0", minimum required is "1.60")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2142 (find_package_handle_standard_args)
CMakeLists.txt:276 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/scantailor/sources/build/CMakeFiles/CMakeOutput.log".
hey i wanna test if i can make a combination with scantailor advance and experimental , i did not figure out how to make a build ,can somebody upload a zip file with the dependencies in mega upload or somewhere
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.
I am trying to compile scantailor-advanced, but I get this error:
-- libboost_unit_test_framework.so.1.70.0 (shared,
BUILD_SHARED_LIBS not ON, set Boost_USE_STATIC_LIBS=OFF to override)
CMake Error at /usr/lib64/cmake/Boost-1.70.0/BoostConfig.cmake:95
(find_package):
Found package configuration file:
/usr/lib64/cmake/boost_unit_test_framework-1.70.0/boost_unit_test_framework-config.cmake
but it set boost_unit_test_framework_FOUND to FALSE so package
"boost_unit_test_framework" is considered to be NOT FOUND. Reason
given by
package:
No suitable build variant has been found.
Call Stack (most recent call first):
/usr/lib64/cmake/Boost-1.70.0/BoostConfig.cmake:124
(boost_find_dependency)
/usr/share/cmake-3.14/Modules/FindBoost.cmake:266 (find_package)
CMakeLists.txt:276 (find_package)
-- Configuring incomplete, errors occurred!
See also
"/tmp/SBo/scantailor-advanced-1.0.16/build/CMakeFiles/CMakeOutput.log".
`-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- unit_test_framework
-- prg_exec_monitor
CMake Error at CMakeLists.txt:193 (add_compile_definitions):
Unknown CMake command "add_compile_definitions".
-- Configuring incomplete, errors occurred!`
My setup:
Ubuntu 18.04
cmake version 3.10.2
Dependencies versions: apt-cache showpkg gcc-7 g++-7 cmake libjpeg-dev libpng-dev libtiff5 libtiff5-dev libboost-test1.65-dev libboost-test1.65.1 qtbase5-dev libqt5svg5-dev qttools5-dev qttools5-dev-tools libqt5opengl5-dev libpthread-stubs0-dev | grep -B1 -A1 Versions
gives
Package: gcc-7
Versions:
7.5.0-3ubuntu1~18.04 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: g++-7
Versions:
7.5.0-3ubuntu1~18.04 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: cmake
Versions:
3.10.2-1ubuntu2.18.04.1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libjpeg-dev
Versions:
8c-2ubuntu8 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libpng-dev
Versions:
1.6.34-1ubuntu0.18.04.2 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libtiff5
Versions:
4.0.9-5ubuntu0.3 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libtiff5-dev
Versions:
4.0.9-5ubuntu0.3 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libboost-test1.65-dev
Versions:
1.65.1+dfsg-0ubuntu5 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libboost-test1.65.1
Versions:
1.65.1+dfsg-0ubuntu5 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: qtbase5-dev
Versions:
5.9.5+dfsg-0ubuntu2.5 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libqt5svg5-dev
Versions:
5.9.5-0ubuntu1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: qttools5-dev
Versions:
5.9.5-0ubuntu1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: qttools5-dev-tools
Versions:
5.9.5-0ubuntu1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_universe_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libqt5opengl5-dev
Versions:
5.9.5+dfsg-0ubuntu2.5 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_bionic-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Package: libpthread-stubs0-dev
Versions:
0.3-4 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_bionic_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Strangely enough, now 'Unix Makefiles' as a generator no longer works for me. Yet I see no recent changes. On the same computer I had managed to install it, now I can't.
Attached is the log
Uploading CMakeOutput.log…
On most machines it'll be better to keep one thread for I/O, so make -j $(($(nproc)-1))
.
MinGW version: 8.1.0, x86_64, posix/seh
Msys2 version: 20180531
CMake version: 3.11.4
libpng version: 1.6.32
Full transcript of cmd.exe:
C:\ScanTailor Build\libs\scantailor-libs-build-master\build>cmake -G "MinGW Makefiles" --build ..
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: C:/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/mingw64/bin/gcc.exe -- 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: C:/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error at CMakeLists.txt:210 (add_library):
Cannot find source file:
C:/ScanTailor Build/libs/libpng-1.6.32/config.h
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx
CMake Error at CMakeLists.txt:210 (add_library):
No SOURCES given to target: png
-- Build files have been written to: C:/ScanTailor Build/libs/scantailor-libs-build-master/build
I am admittedly new to compiling sources properly, but I followed the guide to the letter, using both MinGW and MSVC, and both failed. The issue with MinGW seemed to be simpler, so I posted this first. I will follow up with an issue report on MSVC.
Thanks so much for continuing to work on ScanTailor. That little program has saved me a lot of time and headache, and I'm hoping ScanTailor Advanced will be even better in that regard.
In file included from C:\scantailor\libs\tiff-4.0.4\libtiff\tif_fax3sm.c:3:
C:\scantailor\libs\tiff-4.0.4\libtiff\tiff.h:77:23: error: expected '=', ',', ';', 'asm' or 'attribute' before 'int64'
typedef TIFF_INT64_T [ 79%] int64;
Building C object CMakeFiles/tiff.dir/C_/scantailor/libs/tiff-4.0.4/libtiff/tif_jbig.c.obj
^~~~~
C:\scantailor\libs\tiff-4.0.4\libtiff\tiff.h:78:23: error: expected '=', ',', ';', 'asm' or 'attribute' before 'uint64'
typedef TIFF_UINT64_T uint64;
^~~~~~
C:\scantailor\libs\tiff-4.0.4\libtiff\tiff.h:107:2: error: unknown type name 'uint64'
uint64 tiff_diroff; /* byte offset to first directory */
^~~~~~
[ 80%] Building C object CMakeFiles/tiff.dir/C_/scantailor/libs/tiff-4.0.4/libtiff/tif_jpeg.c.obj
[ 81%] Building C object CMakeFiles/tiff.dir/C_/scantailor/libs/tiff-4.0.4/libtiff/tif_jpeg_12.c.obj
mingw32-make[2]: *** [CMakeFiles\tiff.dir\build.make:245: CMakeFiles/tiff.dir/C_/scantailor/libs/tiff-4.0.4/libtiff/tif_fax3sm.c.obj] Error 1
mingw32-make[2]: *** Waiting for unfinished jobs....
mingw32-make[1]: *** [CMakeFiles\Makefile2:230: CMakeFiles/tiff.dir/all] Error 2
mingw32-make: *** [Makefile:83: all] Error 2
C:\scantailor\libs\scantailor-libs-build-master\build>mingw64-make -j %NUMBER_OF_PROCESSORS%
'mingw64-make' is not recognized as an internal or external command,
operable program or batch file.
The problem occurs in the run script. The following three output the same error:
libpng-1.6.37
jpeg-9b
tiff-4.0.10
configure: error: no acceptable C compiler found in $ PATH
Trying to build in a windows- 7 system
Building dependencies
Output:
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find JPEG (missing: JPEG_LIBRARY) (found version "90")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.18/Modules/FindJPEG.cmake:100 (find_package_handle_standard_args)
CMakeLists.txt:131 (find_package)
Please help to solve........
Hey everyone, I just thought I'd post this as a reference for anyone trying to build scantailor-advanced
on Fedora. It differs from the docs in the README, so it might save you some time.
# install dependencies
sudo dnf install -y \
zlib gcc gcc-c++ cmake libjpeg-turbo-devel libpng-devel \
libtiff libtiff-devel boost-test boost-devel \
qt5-qtbase-devel qt5-qtsvg-devel qt5-qttools qt5-qttools-devel \
libglvnd-devel libxcb-devel
# installable version
mkdir build; cd build
cmake -G "Unix Makefiles" ..
cmake --build .
make -j $(($(nproc)-1))
sudo make install # to install
sudo make uninstall # to uninstall
# variant: portable version
mkdir build; cd build
cmake -D PORTABLE_VERSION=ON -G "Unix Makefiles" ..
cmake --build .
make -j $(($(nproc)-1))
./scantailor # to run
NOTE: The README says you should run make -j $(nproc)
, but @sixtyfive mentioned that on most machines, it is better to keep one thread for I/O by running make -j $(($(nproc)-1))
instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.