tesseract-ocr / tessdoc

Tesseract documentation
https://tesseract-ocr.github.io/tessdoc/
1.79k stars 364 forks source link

Compilation guide for various platforms - Windows - Build training tools #47

Closed HotDenim closed 3 years ago

HotDenim commented 3 years ago

The Windows instructions of the 'Build Training Tools' does not work:

http://tesseract-ocr.github.io/tessdoc/Compiling.html#windows

I think it is due to the https://cppan.org website/network being discontinued, and being replaced with Software Network / SW.

How can I obtain the Training Tools for windows (32-bit and 64-bit) ? (Better build them myself).

Also can the documentation be updated for this issue ?

Shreeshrii commented 3 years ago

@egorpugin Please delete the deprecated info regrading compiling on windows.

@HotDenim Latest Windows binaries with training tools can be downloaded from https://github.com/UB-Mannheim/tesseract/wiki

Though, for training, I would recommend using Linux.

egorpugin commented 3 years ago

Done.

Shreeshrii commented 3 years ago

Thanks!

HotDenim commented 3 years ago

@egorpugin

Done.

The new instructions do not work. I followed then, and while SW was executing, it stopped with an error:

[2718/3758] generate: "C:/Users/User/.sw/storage/pkg/1f/e0/12aa/obj/bld/179681/bd/gobject/glib-enumtypes.c"
Exception in file D:/dev/cppan2/client2/src/sw/builder/command.cpp:764, function execute1: When executing: generate: "C:/Users/User/.sw/storage/pkg/1f/e0/12aa/obj/bld/179681/bd/gobject/glib-enumtypes.c"
command failed: exit code = -1073741515 (0xC0000135): The specified module could not be found.
Total errors: 1

This happened for the 4.1 Branch and the Master branch. (I would like to compile the 4.1 branch).

egorpugin commented 3 years ago

Add -k 1000 options, run. Then add --trace 2> log.txt options, run and send log.

HotDenim commented 3 years ago

@egorpugin

Add -k 1000 options, run. Then add --trace 2> log.txt options, run and send log.

Here is the Log.txt file.

log.txt

egorpugin commented 3 years ago

Try to run sw build org.sw.demo.google.tesseract.training.text2image-master -sfc --trace 2> log.txt If there are errors:

  1. Post log.
  2. In .sw\rsp run the latest .bat file (sort by date desc) by double click and post screenshot of error message. There will be dll name that is missing.
HotDenim commented 3 years ago

@egorpugin

No errors displayed (nothing output to screen), but there is in the log file (attached). log.txt

Error message screenshot: Error

egorpugin commented 3 years ago

Oh, the missing component is on MS side, not sw. Can you show winver command output? Win+R, type winver, Enter.

egorpugin commented 3 years ago

Can you send me that .bat file you've run also?

egorpugin commented 3 years ago

See this link - https://answers.microsoft.com/en-us/windows/forum/windows8_1-pictures-musicapp/api-ms-win-crt-runtime-l1-1-0dll-is-missing/b593b94e-6691-423b-a586-0b7f10131e35?auth=1

Try to install VS2015 redist. It is strange, because you have VS and WinSDK installed.

HotDenim commented 3 years ago

@egorpugin

Winver:

WinVer

BAT file (renamed to .TXT to enable attaching):

1461694303201023788.bat.txt

?

HotDenim commented 3 years ago

@egorpugin

installed VS2015 redist. Then tried again (SW Build .) , but still error.

egorpugin commented 3 years ago

I see. It is Win7. This complicates things a bit. Possible solutions (except for building on win10):

  1. Try to install Win7 WinSDK (6.1 or 6.1A or smth like this).
  2. I can install win7 on VM to try to repro this, but this is time consuming, not sure that I have time for this.
  3. Find installed WinSDKs C:\\Program Files (x86)\\Windows Kits and send tree command output. I need detailed layout of installed SDKs to possibly tune sw to use them.
egorpugin commented 3 years ago

Also it would be nice if you send tree output of C:\\Program Files (x86)\\Visual Studio 2015 and C:\\Program Files (x86)\\Microsoft Visual Studio 12.0.

HotDenim commented 3 years ago

@egorpugin

OK will do for next post. Also forsw build org.sw.demo.google.tesseract.training.text2image-master -sfc --trace 2> log.txt:

log.txt

Two .BAT files same date: 8802815074161298208 1461694303201023788

1461694303201023788.bat.txt 8802815074161298208.bat.txt

HotDenim commented 3 years ago
  1. Win7 WinSDK (6.1 or 6.1A

This ?:

https://www.microsoft.com/en-gb/download/details.aspx?id=8442

It is version 7.1

also 32-bit distribution or 64-bit (I wish to build both).

egorpugin commented 3 years ago

This ?

Yes, try those installers.

HotDenim commented 3 years ago

@egorpugin

Attached are the Tree output files (refer to the filenames). (I am using Visual Studio 2019)

Also, the VS 2015 redist does not include the api-ms-win-core-io-l1-1-1.dll file. I downloaded this file separately and installed it, after that, the .BAT file now refers to more .DLL errors (api-ms-win-core-synch-l1-2-1.dll). I think these .DLL files are Windows 10 only files ? (see https://docs.microsoft.com/en-us/uwp/win32-and-com/win32-apis )

Program Files (x86), Microsoft Visual Studio 10.0.txt Program Files (x86), Microsoft Visual Studio.txt Program Files (x86), Window Kits.txt Program Files, Microsoft SDK's.txt Program Files (x86), Microsoft SDK's.txt

Also, I installed Window 7 64-Bit, new installation, then installed :

And the same error is present.

egorpugin commented 3 years ago

I think these .DLL files are Windows 10 only files ?

Yes, something like this.

The problem is that sw does not use your host config (host - win7 SDK) and uses win10 sdk. Therefore the binaries cannot be started. I'll try to do quick fixes in sw, maybe we'll be able to get it working.

Can you send me set command ouput?

HotDenim commented 3 years ago

@egorpugin

Can you send me set command ouput?

Here:


ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Tester\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=X
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Tester
LOCALAPPDATA=C:\Users\Tester\AppData\Local
LOGONSERVER=\\VIR
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files\Git\cmd;C:\Program Files\CMake\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\Tester\AppData\Local\Temp
TMP=C:\Users\Tester\AppData\Local\Temp
USERDOMAIN=X
USERNAME=Tester
USERPROFILE=C:\Users\Tester
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
windir=C:\Windows
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
egorpugin commented 3 years ago

Ok, I'm sending a new binary with some updates. Unpack and replace old sw.exe. Run the command and post logs. First, we'll try to check if winsdk7 is detected by sw. After that we need to provide correct host settings to sw.

sw.client.sw-1.0.0.exe.zip

HotDenim commented 3 years ago

@egorpugin

Ok, I'm sending a new binary with some updates. Unpack and replace old sw.exe. Run the command and post logs. First, we'll try to check if winsdk7 is detected by sw. After that we need to provide correct host settings to sw.

sw.client.sw-1.0.0.exe.zip

Which Command, and which logs ?.

egorpugin commented 3 years ago

The command for building tess like you did before. sw build org.sw.demo.google.tesseract.training.text2image-master -sfc --trace 2> log.txt

HotDenim commented 3 years ago

@egorpugin

Log File:

log.txt

egorpugin commented 3 years ago

Can you email me to solve this faster? egor.pugin at gmail.com

egorpugin commented 3 years ago

Try this binary, send log.

sw.client.sw-1.0.0.exe.zip

HotDenim commented 3 years ago

Can you email me to solve this faster? egor.pugin at gmail.com

Problems with email , at the moment.

HotDenim commented 3 years ago

Try this binary, send log.

sw.client.sw-1.0.0.exe.zip

@egorpugin

Log File:

log.txt

egorpugin commented 3 years ago

Try this binary, send log. sw.client.sw-1.0.0.exe.zip

egorpugin commented 3 years ago

I've checked some things further, it seems we can't fix this issue on win7 right now. (Next sw version is in progress - it should fix the issue.) So, you have to build it on win10.

HotDenim commented 3 years ago

When will next version be released?

HotDenim commented 3 years ago

How do I build it in Windows 10., the commands ?), for 32-Bit & 64-Bit, and Static & Dynamic Libraries ?. And version 4.1!

Also do I need to download the source via GIT first ?

Also; Can you update the Tessract Documention page with all info.

egorpugin commented 3 years ago

When will next version be released?

After some core algorithms is developed.

How do I build it in Windows 10

Same instructions.

  1. Download sources.
  2. sw build -platform x86,x64 -static -shared Combine flags as you wish.
  3. Output files will be in .sw\out\some hash
HotDenim commented 3 years ago

When will next version be released?

After some core algorithms is developed.

E.g. ?, 1 Month, 2 Months ?. 6 Months ?

How do I build it in Windows 10

Same instructions.

  1. Download sources.
  2. sw build -platform x86,x64 -static -shared Combine flags as you wish.
  3. Output files will be in .sw\out\some hash

So for Tesseract 4.1 I will need to download from GIT the source code. first ?, for 4.1 ?. Yes?, and does SW also work with 4.1 ?.

egorpugin commented 3 years ago

and does SW also work with 4.1 ?.

We'll see. In general, it should.