ruediger / VobSub2SRT

Converts VobSub subtitles (.idx/.srt format) into .srt subtitles.
GNU General Public License v3.0
293 stars 65 forks source link

error compiling gentoo D: #50

Closed latot closed 8 years ago

latot commented 8 years ago

Hi, well i try compiling and i get htis error (dependeces installed):

Scanning dependencies of target documentation
Scanning dependencies of target mplayer
[ 10%] Generating vobsub2srt.1.gz
[ 40%] Building C object mplayer/CMakeFiles/mplayer.dir/unrar_exec.c.o
[ 40%] Building C object mplayer/CMakeFiles/mplayer.dir/mp_msg.c.o
[ 40%] Building C object mplayer/CMakeFiles/mplayer.dir/spudec.c.o
[ 50%] Building C object mplayer/CMakeFiles/mplayer.dir/vobsub.c.o
[ 50%] Built target documentation
[ 60%] Linking C static library ../lib/libmplayer.a
[ 60%] Built target mplayer
Scanning dependencies of target vobsub2srt
[ 80%] Building CXX object src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o
[ 90%] Building CXX object src/CMakeFiles/vobsub2srt.dir/cmd_options.c++.o
[ 90%] Building CXX object src/CMakeFiles/vobsub2srt.dir/langcodes.c++.o
[100%] Linking CXX executable ../bin/vobsub2srt
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clBuildProgram' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clEnqueueNDRangeKernel' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clSetKernelArg' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clReleaseMemObject' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clFinish' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clEnqueueUnmapMemObject' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateContextFromType' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetCommandQueueInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clReleaseContext' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clEnqueueCopyBuffer' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetProgramBuildInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateContext' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clEnqueueMapBuffer' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetDeviceIDs' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetContextInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetDeviceInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clReleaseCommandQueue' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetPlatformIDs' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetPlatformInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateProgramWithBinary' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateCommandQueue' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clReleaseProgram' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clGetProgramInfo' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateKernel' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateBuffer' sin definir
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/libtesseract.so: referencia a `clCreateProgramWithSource' sin definir
collect2: error: ld devolvió el estado de salida 1
src/CMakeFiles/vobsub2srt.dir/build.make:149: fallo en las instrucciones para el objetivo 'bin/vobsub2srt'
make[2]: *** [bin/vobsub2srt] Error 1
CMakeFiles/Makefile2:172: fallo en las instrucciones para el objetivo 'src/CMakeFiles/vobsub2srt.dir/all'
make[1]: *** [src/CMakeFiles/vobsub2srt.dir/all] Error 2
Makefile:149: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2

Cya.

ruediger commented 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)

latot commented 8 years ago

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!

ruediger commented 8 years ago

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.

ruediger commented 8 years ago

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.)

latot commented 8 years ago

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
latot commented 8 years ago

mm, lets reset this, simpli i remove opencl from tesseract and now works, but lets try with pkg build