Closed latot closed 8 years ago
Interesting. It seems your version of libtesseract requires OpenCL support. I'm not sure why though why OpenCL isn't linked to libtesseract. What's the output of
pkg-config --libs --cflags tesseract
on your system?
Unfortunately the current CMake build system isn't using pkg-config for tesseract because tesseract only recently got a .pc file. I plan on using pkg-config once the tesseract version on my system (Ubuntu LTS) comes with .pc. I might add it sooner if it is requires to work with newer tesseract and you can help me test it.
(Alternatively a workaround would be to use tesseract without OpenCL)
Hi here log:
pkg-config --libs --cflags tesseract
-I/usr/include/tesseract -I/usr/include/leptonica -ltesseract
Tests!
Note, i hav enabled opencl in global use!
That's strange, there is nothing about OpenCL in the pkg-config output.
Please rerun
make distclean
LANG=C ./configure
LANG=C make VERBOSE=1
and post the output.
You didn't show the output of configure!
What's the output of
pkg-config --libs --cflags --static tesseract
Because it seems that OpenCL is only included in the .private (i.e., static) flags: https://github.com/tesseract-ocr/tesseract/blob/master/tesseract.pc.in#L15
Do you only have a static version of the library? What's the output of whereis libtesseract
?
(I've created a branch to use pkg-config for tesseract tesseract-pkg-config
.)
Ups! (in tesseract-pkh-config branch)
tesseract uses: +doc -examples +jpeg -linguas_ar -linguas_bg -linguas_ca -linguas_chr -linguas_cs -linguas_da -linguas_de -linguas_el +linguas_es -linguas_fi -linguas_fr -linguas_he -linguas_hi -linguas_hu -linguas_id -linguas_it -linguas_jp -linguas_ko -linguas_lt -linguas_lv -linguas_nl -linguas_no -linguas_pl -linguas_pt -linguas_ro -linguas_ru -linguas_sk -linguas_sl -linguas_sr -linguas_sv -linguas_th -linguas_tl -linguas_tr -linguas_uk -linguas_vi -linguas_zh_CN -linguas_zh_TW +opencl -osd +png +scrollview -static-libs +tiff -training +webp
i only install it dinamically, you can checl it in the use,
Logs:
pkg-config --libs --cflags --static tesseract
-I/usr/include/tesseract -I/usr/include/leptonica -ltesseract -lpthread -llept -lOpenCL -llept -lz -lpng -ljpeg -lgif -ltiff -lwebp
More Logs:
LANG=C ./configure
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- 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
-- Source: /home/pipe/Documentos/git/VobSub2SRT
-- Binary: /home/pipe/Documentos/git/VobSub2SRT/build
-- Build type: Debug
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- Checking for module 'tesseract'
-- Found tesseract, version 3.04.00
-- Could NOT find Tesseract (missing: Tesseract_INCLUDE_DIR)
-- Bash completion path: /usr/share/bash-completion/completions
-- vobsub2srt version: 1.0pre7-2-ga2b2682
-- Debian architecture: amd64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pipe/Documentos/git/VobSub2SRT/build
pipe@drn ~/Documentos/git/VobSub2SRT $ LANG=C make VERBOSE=1
make -C build
make[1]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
/usr/bin/cmake -H/home/pipe/Documentos/git/VobSub2SRT -B/home/pipe/Documentos/git/VobSub2SRT/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/pipe/Documentos/git/VobSub2SRT/build/CMakeFiles /home/pipe/Documentos/git/VobSub2SRT/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[2]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
make -f mplayer/CMakeFiles/mplayer.dir/build.make mplayer/CMakeFiles/mplayer.dir/depend
make[3]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
cd /home/pipe/Documentos/git/VobSub2SRT/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/pipe/Documentos/git/VobSub2SRT /home/pipe/Documentos/git/VobSub2SRT/mplayer /home/pipe/Documentos/git/VobSub2SRT/build /home/pipe/Documentos/git/VobSub2SRT/build/mplayer /home/pipe/Documentos/git/VobSub2SRT/build/mplayer/CMakeFiles/mplayer.dir/DependInfo.cmake --color=
Dependee "/home/pipe/Documentos/git/VobSub2SRT/build/mplayer/CMakeFiles/mplayer.dir/DependInfo.cmake" is newer than depender "/home/pipe/Documentos/git/VobSub2SRT/build/mplayer/CMakeFiles/mplayer.dir/depend.internal".
Dependee "/home/pipe/Documentos/git/VobSub2SRT/build/mplayer/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/pipe/Documentos/git/VobSub2SRT/build/mplayer/CMakeFiles/mplayer.dir/depend.internal".
Scanning dependencies of target mplayer
make[3]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
make -f mplayer/CMakeFiles/mplayer.dir/build.make mplayer/CMakeFiles/mplayer.dir/build
make[3]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
[ 10%] Building C object mplayer/CMakeFiles/mplayer.dir/mp_msg.c.o
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cc -DINSTALL_PREFIX=\"/usr/local\" -std=gnu99 -g3 -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -o CMakeFiles/mplayer.dir/mp_msg.c.o -c /home/pipe/Documentos/git/VobSub2SRT/mplayer/mp_msg.c
[ 20%] Building C object mplayer/CMakeFiles/mplayer.dir/spudec.c.o
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cc -DINSTALL_PREFIX=\"/usr/local\" -std=gnu99 -g3 -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -o CMakeFiles/mplayer.dir/spudec.c.o -c /home/pipe/Documentos/git/VobSub2SRT/mplayer/spudec.c
[ 30%] Building C object mplayer/CMakeFiles/mplayer.dir/unrar_exec.c.o
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cc -DINSTALL_PREFIX=\"/usr/local\" -std=gnu99 -g3 -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -o CMakeFiles/mplayer.dir/unrar_exec.c.o -c /home/pipe/Documentos/git/VobSub2SRT/mplayer/unrar_exec.c
[ 40%] Building C object mplayer/CMakeFiles/mplayer.dir/vobsub.c.o
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cc -DINSTALL_PREFIX=\"/usr/local\" -std=gnu99 -g3 -DDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_REENTRANT -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -o CMakeFiles/mplayer.dir/vobsub.c.o -c /home/pipe/Documentos/git/VobSub2SRT/mplayer/vobsub.c
[ 50%] Linking C static library ../lib/libmplayer.a
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cmake -P CMakeFiles/mplayer.dir/cmake_clean_target.cmake
cd /home/pipe/Documentos/git/VobSub2SRT/build/mplayer && /usr/bin/cmake -E cmake_link_script CMakeFiles/mplayer.dir/link.txt --verbose=1
/usr/bin/ar qc ../lib/libmplayer.a CMakeFiles/mplayer.dir/mp_msg.c.o CMakeFiles/mplayer.dir/spudec.c.o CMakeFiles/mplayer.dir/unrar_exec.c.o CMakeFiles/mplayer.dir/vobsub.c.o
/usr/bin/ranlib ../lib/libmplayer.a
make[3]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
[ 50%] Built target mplayer
make -f src/CMakeFiles/vobsub2srt.dir/build.make src/CMakeFiles/vobsub2srt.dir/depend
make[3]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
cd /home/pipe/Documentos/git/VobSub2SRT/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/pipe/Documentos/git/VobSub2SRT /home/pipe/Documentos/git/VobSub2SRT/src /home/pipe/Documentos/git/VobSub2SRT/build /home/pipe/Documentos/git/VobSub2SRT/build/src /home/pipe/Documentos/git/VobSub2SRT/build/src/CMakeFiles/vobsub2srt.dir/DependInfo.cmake --color=
Dependee "/home/pipe/Documentos/git/VobSub2SRT/build/src/CMakeFiles/vobsub2srt.dir/DependInfo.cmake" is newer than depender "/home/pipe/Documentos/git/VobSub2SRT/build/src/CMakeFiles/vobsub2srt.dir/depend.internal".
Dependee "/home/pipe/Documentos/git/VobSub2SRT/build/src/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/pipe/Documentos/git/VobSub2SRT/build/src/CMakeFiles/vobsub2srt.dir/depend.internal".
Scanning dependencies of target vobsub2srt
make[3]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
make -f src/CMakeFiles/vobsub2srt.dir/build.make src/CMakeFiles/vobsub2srt.dir/build
make[3]: Entering directory '/home/pipe/Documentos/git/VobSub2SRT/build'
[ 60%] Building CXX object src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o
cd /home/pipe/Documentos/git/VobSub2SRT/build/src && /usr/bin/c++ -DINSTALL_PREFIX=\"/usr/local\" -I/home/pipe/Documentos/git/VobSub2SRT/mplayer -ansi -pedantic -Wall -Wextra -Wno-long-long -g3 -DDEBUG -o CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o -c /home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++
/home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++: In function 'int main(int, char**)':
/home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++:218:3: error: 'TessBaseAPI' has not been declared
TessBaseAPI::SimpleInit(tess_path, tess_lang, false); // TODO params
^
/home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++:220:5: error: 'TessBaseAPI' has not been declared
TessBaseAPI::SetVariable("tessedit_char_blacklist", blacklist.c_str());
^
/home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++:275:20: error: 'TessBaseAPI' has not been declared
char *text = TessBaseAPI::TesseractRect(image, 1, stride, 0, 0, width, height);
^
/home/pipe/Documentos/git/VobSub2SRT/src/vobsub2srt.c++:314:3: error: 'TessBaseAPI' has not been declared
TessBaseAPI::End();
^
src/CMakeFiles/vobsub2srt.dir/build.make:62: recipe for target 'src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o' failed
make[3]: *** [src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o] Error 1
make[3]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
CMakeFiles/Makefile2:172: recipe for target 'src/CMakeFiles/vobsub2srt.dir/all' failed
make[2]: *** [src/CMakeFiles/vobsub2srt.dir/all] Error 2
make[2]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
Makefile:149: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pipe/Documentos/git/VobSub2SRT/build'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
mm, lets reset this, simpli i remove opencl from tesseract and now works, but lets try with pkg build
Hi, well i try compiling and i get htis error (dependeces installed):
Cya.