@mit I was working on AWS Lambda and i had built the libraries for OCR functions, just follow the docker part of this post/tutorial by Amine Tamasna:
https://medium.com/analytics-vidhya/build-tesseract-serverless-api-using-aws-lambda-and-docker-in-minutes-dd97a79b589b You will be good to go... On Tuesday, September 8, 2020 at 4:09:56 PM UTC+3 mit wrote: > Thanks for the suggestions..Will look through it. I mainly need static > tesseract to directly use it in AWS Lambda,and hence I will have to find a > way to build it in linux. > > On Tuesday, September 8, 2020 at 6:12:59 PM UTC+5:30 zdenop wrote: > >> vcpkg static build is not supported on linux: >> >> Error: invalid triplet: x64-linux-static >> Available architecture triplets >> VCPKG built-in triplets: >> x64-osx >> x64-windows >> arm-uwp >> arm64-windows >> x64-linux >> x86-windows >> x64-uwp >> x64-windows-static >> >> VCPKG community triplets: >> s390x-linux >> x64-windows-static-md >> arm64-mingw-dynamic >> x86-ios >> x86-windows-static >> arm-mingw-static >> wasm32-emscripten >> arm64-uwp >> arm64-ios >> arm-ios >> x86-windows-static-md >> x86-uwp >> x86-mingw-static >> arm64-linux >> arm64-mingw-static >> arm-windows >> x64-ios >> x86-windows-v120 >> x64-osx-dynamic >> arm-linux >> x64-mingw-static >> arm64-osx >> x86-mingw-dynamic >> x64-mingw-dynamic >> arm-mingw-dynamic >> arm64-windows-static >> >> Zdenko >> >> >> ut 8. 9. 2020 o 14:13 Zdenko Podobny <zde...@gmail.com> napísal(a): >> >>> I did not try it on linux, but you can try to use Microsoft vcpkg[1]to >>> build static leptonica[2]... (on windows it works). >>> >>> [1] https://github.com/microsoft/vcpkg#quick-start-unix >>> [2] >>> https://github.com/charlesw/tesseract/wiki/Compiling-Tesseract-and-Libleptonica-(using-vcpkg) >>> >>> Zdenko >>> >>> >>> ut 8. 9. 2020 o 13:56 Zdenko Podobny <zde...@gmail.com> napísal(a): >>> >>>> As I mentioned in a previous email: you need to build a static >>>> leptonica library with all its dependencies (image libraries) as static >>>> libraries. >>>> Maybe it would require more tweaking ;-) : >>>> >>>> > ldd /usr/bin/tesseract >>>> linux-vdso.so.1 (0x00007ffdd44e2000) >>>> libtesseract.so.5 => /usr/lib64/libtesseract.so.5 >>>> (0x00007faa42f5d000) >>>> liblept.so.5 => /usr/lib64/liblept.so.5 (0x00007faa42ac9000) >>>> libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007faa42886000) >>>> libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007faa4261d000) >>>> libgif.so.7 => /usr/lib64/libgif.so.7 (0x00007faa42414000) >>>> libtiff.so.5 => /usr/lib64/libtiff.so.5 (0x00007faa4219b000) >>>> libwebpmux.so.2 => /usr/lib64/libwebpmux.so.2 >>>> (0x00007faa41f91000) >>>> libwebp.so.6 => /usr/lib64/libwebp.so.6 (0x00007faa41d33000) >>>> libopenjp2.so.7 => /usr/lib64/libopenjp2.so.7 >>>> (0x00007faa41ae1000) >>>> libz.so.1 => /lib64/libz.so.1 (0x00007faa418ca000) >>>> libarchive.so.13 => /usr/lib64/libarchive.so.13 >>>> (0x00007faa41615000) >>>> libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007faa4138c000) >>>> librt.so.1 => /lib64/librt.so.1 (0x00007faa41184000) >>>> libpthread.so.0 => /lib64/libpthread.so.0 (0x00007faa40f65000) >>>> libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007faa40b84000) >>>> libm.so.6 => /lib64/libm.so.6 (0x00007faa4084c000) >>>> libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x00007faa40614000) >>>> libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007faa403fc000) >>>> libc.so.6 => /lib64/libc.so.6 (0x00007faa40041000) >>>> liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007faa3fe07000) >>>> libjbig.so.2 => /usr/lib64/libjbig.so.2 (0x00007faa3fbfb000) >>>> libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 >>>> (0x00007faa3f769000) >>>> libacl.so.1 => /lib64/libacl.so.1 (0x00007faa3f560000) >>>> libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00007faa3f343000) >>>> libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007faa3efdb000) >>>> libnghttp2.so.14 => /usr/lib64/libnghttp2.so.14 >>>> (0x00007faa3edb3000) >>>> libidn2.so.0 => /usr/lib64/libidn2.so.0 (0x00007faa3eb96000) >>>> libssh.so.4 => /usr/lib64/libssh.so.4 (0x00007faa3e915000) >>>> libpsl.so.5 => /usr/lib64/libpsl.so.5 (0x00007faa3e705000) >>>> libssl.so.1.1 => /usr/lib64/libssl.so.1.1 (0x00007faa3e499000) >>>> libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 >>>> (0x00007faa3e24d000) >>>> libldap_r-2.4.so.2 => /usr/lib64/libldap_r-2.4.so.2 >>>> (0x00007faa3dff9000) >>>> liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 >>>> (0x00007faa3ddea000) >>>> /lib64/ld-linux-x86-64.so.2 (0x00007faa434b4000) >>>> libdl.so.2 => /lib64/libdl.so.2 (0x00007faa3dbe6000) >>>> libattr.so.1 => /lib64/libattr.so.1 (0x00007faa3d9e1000) >>>> libunistring.so.2 => /usr/lib64/libunistring.so.2 >>>> (0x00007faa3d65f000) >>>> libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007faa3d383000) >>>> libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 >>>> (0x00007faa3d151000) >>>> libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007faa3cf4d000) >>>> libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 >>>> (0x00007faa3cd40000) >>>> libresolv.so.2 => /lib64/libresolv.so.2 (0x00007faa3cb29000) >>>> libsasl2.so.3 => /usr/lib64/libsasl2.so.3 (0x00007faa3c90c000) >>>> libkeyutils.so.1 => /usr/lib64/libkeyutils.so.1 >>>> (0x00007faa3c708000) >>>> libselinux.so.1 => /lib64/libselinux.so.1 (0x00007faa3c4df000) >>>> libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007faa3c252000) >>>> >>>> I would suggest building a minimal leptonica and tesseract library, to >>>> avoid extra work with linking. E.g. if you will open image with other >>>> library (python PIL [1] , opencv [2] ...) you do not any image support in >>>> leptonica - just pass image data to leptonica/tesseract) >>>> >>>> [1] >>>> https://stackoverflow.com/questions/55195932/typeerror-initializer-for-ctype-unsigned-int-must-be-a-cdata-pointer-not-b/57776268#57776268 >>>> [2] >>>> https://stackoverflow.com/questions/39293922/convert-between-opencv-mat-and-leptonica-pix >>>> >>>> Zdenko >>>> >>>> >>>> ut 8. 9. 2020 o 12:37 mit <kollol...@gmail.com> napísal(a): >>>> >>>>> The tesseract binary it creates,still needs leptonica files to run , >>>>> which in essence breaks the core idea of static linking >>>>> >>>>> On Tuesday, September 8, 2020 at 12:38:16 PM UTC+5:30 Mobeen Ali wrote: >>>>> >>>>>> @mit heres the link to the github page: >>>>>> >>>>>> https://github.com/wingedrhino/static-tesseract >>>>>> >>>>>> This guy has a single script written for the whole task. but when >>>>>> build the static version of tesseract and run it, i get this error: >>>>>> >>>>>> pytesseract.pytesseract.TesseractError: (127, >>>>>> '/home/dpsocr/mysite/tesseract-static/bin/tesseract: symbol lookup >>>>>> error: >>>>>> /home/dpsocr/mysite/tesseract-static/bin/tesseract: undefined symbol: >>>>>> pixaDisplayTiledInColumns') >>>>>> >>>>>> Give it a try and share what you get. >>>>>> Best of Luck! >>>>>> >>>>>> On Tuesday, September 8, 2020 at 10:04:00 AM UTC+3 mit wrote: >>>>>> >>>>>>> >>>>>>> No..how have you built a static version of tesseract? Any link? >>>>>>> >>>>>>> Thanks >>>>>>> On Tuesday, September 8, 2020 at 12:27:01 PM UTC+5:30 Mobeen Ali >>>>>>> wrote: >>>>>>> >>>>>>>> I tried using a static version of tesseract but i got this error >>>>>>>> now, >>>>>>>> >>>>>>>> pytesseract.pytesseract.TesseractError: (127, >>>>>>>> '/home/dpsocr/mysite/tesseract-static/bin/tesseract: symbol lookup >>>>>>>> error: >>>>>>>> /home/dpsocr/mysite/tesseract-static/bin/tesseract: undefined symbol: >>>>>>>> pixaDisplayTiledInColumns') >>>>>>>> >>>>>>>> Please help!! >>>>>>>> >>>>>>>> On Tuesday, September 8, 2020 at 9:42:08 AM UTC+3 Mobeen Ali wrote: >>>>>>>> >>>>>>>>> @mit did you found any solution? >>>>>>>>> >>>>>>>>> On Monday, September 7, 2020 at 5:32:56 PM UTC+3 mit wrote: >>>>>>>>> >>>>>>>>>> I am also looking for it. The process to create static tesseract >>>>>>>>>> >>>>>>>>>> On Monday, September 7, 2020 at 7:11:47 PM UTC+5:30 Mobeen Ali >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Thanks @zdenop for your response. Is there any 'How To?' for >>>>>>>>>>> building the static version of tesseract on macOS or Ubuntu? >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Monday, September 7, 2020 at 2:01:29 PM UTC+3 zdenop wrote: >>>>>>>>>>> >>>>>>>>>>>> try to build static version of tesseract >>>>>>>>>>>> >>>>>>>>>>>> Zdenko >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> po 7. 9. 2020 o 10:48 Mobeen Ali <moby...@gmail.com> >>>>>>>>>>>> napísal(a): >>>>>>>>>>>> >>>>>>>>>>>>> Hi! >>>>>>>>>>>>> I was trying to build and upload tesseract online. I've >>>>>>>>>>>>> somehow found the tesseract but I'm getting this error: >>>>>>>>>>>>> >>>>>>>>>>>>> "pytesseract.pytesseract.TesseractError: (127, >>>>>>>>>>>>> '/home/dpsocr/mysite/tesseract-ara/bin/tesseract: error while >>>>>>>>>>>>> loading >>>>>>>>>>>>> shared libraries: libtesseract.so.4: cannot open shared object >>>>>>>>>>>>> file: No >>>>>>>>>>>>> such file or directory')" >>>>>>>>>>>>> >>>>>>>>>>>>> It seems like tesseract is unable to find libtesseract library. >>>>>>>>>>>>> But the libraries are in the 'lib' directory as follows: >>>>>>>>>>>>> |_mysite >>>>>>>>>>>>> |_tesseract >>>>>>>>>>>>> |_bin >>>>>>>>>>>>> |_lib >>>>>>>>>>>>> |_tesseract >>>>>>>>>>>>> >>>>>>>>>>>>> *So the Question is that, I have built the tesseract using >>>>>>>>>>>>> docker now I wanted to know that if there is any way to build >>>>>>>>>>>>> tesseract and >>>>>>>>>>>>> it's libraries, and then compress them together to upload them to >>>>>>>>>>>>> the >>>>>>>>>>>>> online hosting so that tesseract will know its required libraries >>>>>>>>>>>>> are along >>>>>>>>>>>>> with it.* >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks for any advice. >>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>> Google Groups "tesseract-ocr" group. >>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from >>>>>>>>>>>>> it, send an email to tesseract-oc...@googlegroups.com. >>>>>>>>>>>>> To view this discussion on the web visit >>>>>>>>>>>>> https://groups.google.com/d/msgid/tesseract-ocr/551aacb8-59ff-4c5f-881d-c8f94aeba0a4n%40googlegroups.com >>>>>>>>>>>>> >>>>>>>>>>>>> <https://groups.google.com/d/msgid/tesseract-ocr/551aacb8-59ff-4c5f-881d-c8f94aeba0a4n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>>>>>>>>>> . >>>>>>>>>>>>> >>>>>>>>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "tesseract-ocr" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to tesseract-oc...@googlegroups.com. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/tesseract-ocr/33fa3388-6703-44a7-ba4f-8ed69930a3e7n%40googlegroups.com >>>>> >>>>> <https://groups.google.com/d/msgid/tesseract-ocr/33fa3388-6703-44a7-ba4f-8ed69930a3e7n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/4255f378-b1b6-4447-a298-900086222536n%40googlegroups.com.