AiPacino / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
2 stars 0 forks source link

Installing 3.02 Tesseract on Synology - error libtesseract.so undefined reference to `__sync_fetch_and_add_4' #1201

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to make tesseract on a synology DS412+
2.
3.

What is the expected output? What do you see instead?

OUTPUT when making tesseract:

make[2]: Entering directory `/root/tesseract-ocr/api'
/opt/bin/bash ../libtool --tag=CXX   --mode=link g++  -march=i686 -mtune=i686   
-o tesseract tesseract-tesseractmain.o libtesseract.la  -llept -lpthread
libtool: link: g++ -march=i686 -mtune=i686 -o .libs/tesseract 
tesseract-tesseractmain.o  ./.libs/libtesseract.so 
-L/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bi
n/../lib/gcc/i686-linux-gnu/4.2.1 
-L/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bi
n/../lib/gcc 
-L/home/slug/optware/syno-i686/toolchain/gcc-4.2.1-glibc-2.3.6/i686-linux-gnu/bi
n/../lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/lib 
-L/synosrc/source_backup/crosstool-0.43/build/i686-linux-gnu/build-gcc/i686-linu
x-gnu/libstdc++-v3/src 
-L/synosrc/source_backup/crosstool-0.43/build/i686-linux-gnu/build-gcc/i686-linu
x-gnu/libstdc++-v3/src/.libs 
-L/synosrc/source_backup/crosstool-0.43/build/i686-linux-gnu/build-gcc/./gcc 
-L/usr/local/i686-linux-gnu/i686-linux-gnu/bin 
-L/usr/local/i686-linux-gnu/i686-linux-gnu/lib 
-L/usr/local/i686-linux-gnu/lib/../i686-linux-gnu/lib /opt/lib/libstdc++.so -lm 
-lc -lgcc_s -llept -lpthread -Wl,-rpath -Wl,/opt/local/lib -Wl,-rpath 
-Wl,/opt/lib
./.libs/libtesseract.so: undefined reference to `__sync_fetch_and_add_4'
collect2: ld returned 1 exit status
make[2]: *** [tesseract] Error 1
make[2]: Leaving directory `/root/tesseract-ocr/api'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/tesseract-ocr'
make: *** [all] Error 2

What version of the product are you using? On what operating system?
Tesseract 3.02

operating system:
 uname -a
Linux AsamcoSynology 3.2.30 #3211 SMP Tue Apr 16 20:02:31 CST 2013 x86_64 
GNU/Linux

Please provide any additional information below.

Steps i did:
1) Dependency 1: Leptonica:
- Download leptonica http://www.leptonica.com/download.html
- Extract it: tar -xvzf <<FILENAME>>
- install dependencies: ipkg install libtiff libjpeg libpng
- go to leptonica dir: cd leptonica<VERSION>/
- configure: ./configure
- make
- make install

2) Tesseract install:
- Download Tesseract from: 
https://code.google.com/p/tesseract-ocr/downloads/list
- Extract it: tar -xvzf <<FILENAME>>
- go to directory: cd tesseract...
- ./autogen.sh (CREATES ERROR: - but i could continue with configure...)

 ./autogen.sh
Running aclocal
This Perl not built to support threads
Compilation failed in require at 
/opt/share/automake-1.12/Automake/ChannelDefs.pm line 23.
BEGIN failed--compilation aborted at 
/opt/share/automake-1.12/Automake/ChannelDefs.pm line 26.
Compilation failed in require at 
/opt/share/automake-1.12/Automake/Configure_ac.pm line 27.
BEGIN failed--compilation aborted at 
/opt/share/automake-1.12/Automake/Configure_ac.pm line 27.
Compilation failed in require at /opt/bin/aclocal line 38.
BEGIN failed--compilation aborted at /opt/bin/aclocal line 38.

  Something went wrong, bailing out!

- ./configure (alternative one i tried, was this one: ./configure 
CFLAGS="-march=i686" CXXFLAGS="-march=i686" )
make (i got error here, see below. After making the sym link, it passed this 
error...)
ERROR: /usr/local/i686-linux-gnu/i686-linux-gnu/lib/libstdc++.la: No such file 
or directory From: http://forum.synology.com/enu/viewtopic.php?f=155&t=27515
cd /usr/local
mkdir i686-linux-gnu
cd i686-linux-gnu
mkdir i686-linux-gnu
cd i686-linux-gnu
mkdir lib
cd lib
ln -s /opt/lib/libstdc++.la

and ended up here: (full error above)
ERROR: libtesseract.so undefined reference to `__sync_fetch_and_add_4' 

Original issue reported on code.google.com by alexan...@asamco.com on 16 May 2014 at 11:58

GoogleCodeExporter commented 9 years ago
1. Tesseract does not call/use __sync_fetch_and_add_4 (directly).
2. Your installation procedure is non-standard => e.g. your 
platform/architecture is not supported. If you fix it - patches are welcomed, 
but nobody will fix it for you...

Original comment by zde...@gmail.com on 16 May 2014 at 5:52

GoogleCodeExporter commented 9 years ago
Thanks for the answer Zdenko.

If I (miraculously :)) find the solution, i'll definitely post it here as well. 

Kind regards,
Alex

Original comment by alexan...@asamco.com on 18 May 2014 at 10:07