New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fresh build: tesseract not found using pkg-config #312
Comments
This is my tesseract.pc file |
I'd be more interested to know what this one says. |
My lept.pc
To get you a config.log I'll have to run another build first. Next time I'll add the text. I attached the file because I wanted to keep the post short. No problem if you rather want the plain file. |
Can't run the build now because SF seems down again. Will do ASAP. |
Started a fresh build. Now it fails when creating leptonica.
|
Do you want to compile FFmpeg with LibTesseract at all? If not, then you can disable it all together: --- cross_compile_ffmpeg.sh.bak 2018-03-04 17:45:06.406250000 +0100
+++ cross_compile_ffmpeg.sh 2018-03-04 17:47:42.609375000 +0100
@@ -1664,7 +1664,7 @@
init_options+=" --disable-schannel"
# Fix WinXP incompatibility by disabling Microsoft's Secure Channel, because Windows XP doesn't support TLS 1.1 and 1.2, but with GnuTLS or OpenSSL it does. The main reason I started this journey!
fi
- config_options="$init_options --enable-libtesseract --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-nvenc --enable-nvdec"
+ config_options="$init_options --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-nvenc --enable-nvdec"
# With the changes being made to 'configure' above and with '--pkg-config-flags=--static' there's no need anymore for '--extra-cflags=' and '--extra-libs='.
if [[ ! -f configure.bak ]]; then # Changes being made to 'configure' are done with 'sed', because 'configure' gets updated a lot.
sed -i "/enabled libtwolame/s/&&$/-DLIBTWOLAME_STATIC \&\& add_cppflags -DLIBTWOLAME_STATIC \&\&/;/enabled libmodplug/s/.*/& -DMODPLUG_STATIC \&\& add_cppflags -DMODPLUG_STATIC/;/enabled libcaca/s/.*/& -DCACA_STATIC \&\& add_cppflags -DCACA_STATIC/" configure # Add '-Dxxx_STATIC' to LibTwoLAME, LibModplug and Libcaca. FFmpeg should change this upstream, just like they did with libopenjpeg.
@@ -1861,7 +1861,6 @@
build_libass # Needs freetype >= 9.10.3 (see https://bugs.launchpad.net/ubuntu/+source/freetype1/+bug/78573 o_O) and fribidi >= 0.19.0. Uses fontconfig >= 2.10.92, iconv and dlfcn.
build_libxavs
build_libxvid # FFmpeg now has native support, but libxvid still provides a better image.
- build_libtesseract
build_libvpx
build_libx265
build_libopenh264
That's obviously because you haven't compiled LibJPEG at all. And I now see this: build_libtiff() {
generic_download_and_make_and_install ftp://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz
sed -i.bak 's/-ltiff.*$/-ltiff -llzma -ljpeg -lz/' $PKG_CONFIG_PATH/libtiff-4.pc # static deps
}
build_libtesseract() {
build_libleptonica
build_libtiff # no disable configure option for this in tesseract? odd...
do_git_checkout_and_make_install https://github.com/tesseract-ocr/tesseract.git
sed -i.bak 's/-ltesseract.*$/-ltesseract -lstdc++ -lws2_32 -llept -ltiff -llzma -ljpeg -lz/' $PKG_CONFIG_PATH/tesseract.pc # why does it needs winsock? LOL plus all of libtiff's <sigh>
} I have no idea why Roger has messed around with the pkg-config files so much. He has even added You know what? Could you remove the 'win32/tiff-4.0.9', 'win32/leptonica_git' and the 'win32/tesseract_git' map, apply the following and re-run: --- cross_compile_ffmpeg.sh.bak 2018-03-04 17:45:06.406250000 +0100
+++ cross_compile_ffmpeg.sh 2018-03-04 18:28:25.718750000 +0100
@@ -628,21 +628,28 @@
build_libleptonica() {
do_git_checkout https://github.com/DanBloomberg/leptonica.git
cd leptonica_git
- generic_configure "--without-libopenjpeg" # never could quite figure out how to get it to work with jp2 stuffs...I think OPJ_STATIC or something, see issue for tesseract
+ export PKG_CONFIG="pkg-config --static" # Automatically detect all Leptonica's dependencies.
+ generic_configure "--disable-programs --without-libopenjpeg" # never could quite figure out how to get it to work with jp2 stuffs...I think OPJ_STATIC or something, see issue for tesseract
do_make_and_make_install
+ unset PKG_CONFIG
cd ..
}
build_libtiff() {
generic_download_and_make_and_install ftp://download.osgeo.org/libtiff/tiff-4.0.9.tar.gz
- sed -i.bak 's/-ltiff.*$/-ltiff -llzma -ljpeg -lz/' $PKG_CONFIG_PATH/libtiff-4.pc # static deps
}
build_libtesseract() {
- build_libleptonica
build_libtiff # no disable configure option for this in tesseract? odd...
- do_git_checkout_and_make_install https://github.com/tesseract-ocr/tesseract.git
- sed -i.bak 's/-ltesseract.*$/-ltesseract -lstdc++ -lws2_32 -llept -ltiff -llzma -ljpeg -lz/' $PKG_CONFIG_PATH/tesseract.pc # why does it needs winsock? LOL plus all of libtiff's <sigh>
+ build_libpng
+ build_libleptonica
+ do_git_checkout https://github.com/tesseract-ocr/tesseract.git
+ cd tesseract_git
+ if [[ ! -f tesseract.pc.in.bak ]]; then
+ sed -i.bak "s/-lpthread/-lpthread -lstdc++ -lws2_32/" tesseract.pc.in # why does it needs winsock? LOL
+ fi
+ generic_configure_make_install
+ cd ..
}
build_libzimg() { |
I do not need OCR so I could remove libtesseract. I already did and was able to compile everything (both win32/64 and low/high bit depth). Next I'll apply your patch and try again. Normally I would build whatever the script does by default and only add whatever I specifically need. Or remove whatever hurts. :) The problem with patches is that I use Jenkins and rebuild automatically whenever there's a change. When I patch the script I need to reapply the patches everytime changes arrive as they would get overwritten. |
Applied the patch and started a new build. Unfortunately libvfilter fails:
|
I have no idea where this is coming from. I don't understand how something totally unrelated to Tesseract like an audio filter could suddenly fail from this. |
I also don't know either why libavfilter would fail. I replaced |
In search for the reasons why this started I found that this may be because there was a symbolic link to the build directories. I created that quite a while ago (half a year or so) and it was never a problem. Havoc just started when Sourceforge developed problems and I did a "rm -Rf sandbox". All hell broke loose... I removed the link and put everything in a regular path. The theora problem #306 is still there, but maybe the above issues are gone. Build running... |
Build complete, without the symbolic link, results:
Conclusion: Your patches work. |
That's good to hear. Thanks. |
Hmm thought I had tesseract figured out, I'll look at it again...
…On Mon, Mar 5, 2018 at 7:13 AM, Reino Wijnsma ***@***.***> wrote:
That's good to hear. Thanks.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#312 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAw0FNWY2Yz5Tp0R4_uCb2wZzNb1Nswks5tbUgQgaJpZM4SbTJr>
.
|
Here's the "ffbuild/config.log" file. |
Build OK after this fix: eafb30d |
Clean build worked. Can be closed. |
Started a fresh build, it stops with "ERROR: tesseract not found using pkg-config"
Command was:
./cross_compile_ffmpeg.sh --high-bitdepth=y --gcc-cpu-count=4 --disable-nonfree=n --sandbox-ok=y --compiler-flavors=multi --build-ffmpeg-static=n --build-ffmpeg-shared=y
This has been tried twice, with and without the "--gcc-cpu-count=4" parameter. Same result.
A quick solution was to remove "--enable-libtesseract" around line 1667, but there must be reason why it won't find it although ./sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/pkgconfig/tesseract.pc is there.
The text was updated successfully, but these errors were encountered: