frame_decoration
original (2019/05/14 付) Google 翻訳 (2019/05/21 付)
# Compilation guide for various platforms #さまざまなプラットフォーム用のコンパイルガイド
Note: This wiki expects you to be familiar with compiling software on your operation system. 注意: このウィキはあなたがあなたのオペレーションシステム上でソフトウェアをコンパイルすることに精通していることを期待しています。
Use the same tools for building tesseract as you used for building leptonica. * [leptonicaの構築]で使用したのと同じツールを使用して、tesseractを構築します(https://github.com/DanBloomberg/leptonica/issues/410)。
## Table of contents ## 目次
* Linux * Linux
* Windows * Windows
* macOS * macOS
* Common Errors * よくあるエラー
* Miscellaneous * その他
## Linux ## Linux
To install Tesseract 4.x you can simply run the following command on your Ubuntu 18.xx bionic: Tesseract 4.x をインストールするには、Ubuntu 18.xx bionic で以下のコマンドを実行するだけです。
` | `
sudo apt install tesseract-ocr sudo aptインストールtesseract-ocr
` | `
If you wish to install the Developer Tools which can be used for training, run the following command: トレーニングに使用できるDeveloper Toolsをインストールしたい場合は、次のコマンドを実行してください。
` | `
sudo apt install libtesseract-dev sudo aptインストールlibtesseract-dev
` | `
The following instructions are for building on Linux, which also can be applied to other UNIX like operating systems. 以下の手順はLinux上で構築するためのものです。これは他のUNIXのようなオペレーティングシステムにも適用できます。
### Dependencies ###依存関係
* A compiler for C and C++: GCC or Clang * CおよびC ++用のコンパイラ:GCCまたはClang
* GNU Autotools: autoconf, automake, libtool * GNU Autotools:autoconf、automake、libtool
* pkg-config * pkg-config
* Leptonica * レプトニカ
* libpng, libjpeg, libtiff * libpng、libjpeg、libtiff
### Ubuntu ### Ubuntu
If they are not already installed, you need the following libraries (Ubuntu 16.04/14.04): まだインストールされていない場合は、次のライブラリが必要です(Ubuntu 16.04 / 14.04)。
` | `
sudo apt-get install g++ # or clang++ (presumably) sudo apt-get g ++#またはclang ++(たぶん)
sudo apt-get install autoconf automake libtool sudo apt-get install autoconf automake libtool
sudo apt-get install pkg-config sudo apt-get install pkg-config
sudo apt-get install libpng-dev sudo apt-get libpng-devのインストール
sudo apt-get install libjpeg8-dev sudo apt-get libjpeg8-devをインストールしてください。
sudo apt-get install libtiff5-dev sudo apt-get libtiff5-devをインストールする
sudo apt-get install zlib1g-dev sudo apt-get install zlib1g-dev
` | `
if you plan to install the training tools, you also need the following libraries: トレーニングツールをインストールする予定の場合は、次のライブラリも必要です。
` | `
sudo apt-get install libicu-dev sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev sudo apt-get libcairo2-devをインストールする
` | `
### Leptonica ###レプトニカ
You also need to install Leptonica. Ensure that the development headers for Leptonica are installed before compiling Tesseract. またLeptonicaをインストールする必要があります。 Tesseractをコンパイルする前に、Leptonicaの開発用ヘッダーがインストールされていることを確認してください。
Tesseract versions and the minimum version of Leptonica required: TesseractのバージョンとLeptonicaの最小バージョンが必要です:
Tesseract Leptonica Ubuntu Tesseract レプトニカ Ubuntu
:-------------------: :---------------------------------------: :--------- :-------------------: :---------------------------------------: :---------
4.00 1.74.2 Ubuntu 18.04 4.00 1.74.2 Ubuntu 18.04
3.05 1.74.0 Must build from source 3.05 1.74.0 ソースからビルドする必要があります
3.04 1.71 Ubuntu 16.04 3.04 1.71 Ubuntu 16.04
3.03 1.70 Ubuntu 14.04 3.03 1.70 Ubuntu 14.04
3.02 1.69 Ubuntu 12.04 3.02 1.69 Ubuntu 12.04
3.01 1.67 3.01 1.67
One option is to install the distro's Leptonica package: 1つの選択肢はディストリビューションのLeptonicaパッケージをインストールすることです。
` | `
sudo apt-get install libleptonica-dev sudo apt-getインストールlibleptonica-dev
` | `
but if you are using an oldish version of Linux, the Leptonica version may be too old, so you will need to build from source. しかし、あなたが古いバージョンのLinuxを使っているなら、Leptonicaバージョンは古すぎるかもしれないので、ソースからビルドする必要があるでしょう
The sources are at https://github.com/DanBloomberg/leptonica . The instructions for building are given in Leptonica README. ソースはhttps://github.com/DanBloomberg/leptonicaにあります。構築方法はLeptonica READMEにあります。
Note that if building Leptonica from source, you may need to ensure that /usr/local/lib is in your library path. This is a standard Linux bug, and the information at Stackoverflow is very helpful. ソースからLeptonicaをビルドする場合、/ usr / local / libがあなたのライブラリパスにあることを確認する必要があるかもしれないことに注意してください。これはLinuxの標準的なバグです。Stackoverflowの情報は非常に役に立ちます。
## Installing Tesseract from Git ## GitからTesseractをインストールする
Please follow instructions in https://github.com/tesseract-ocr/tesseract/wiki/Compiling--GitInstallation [https://github.com/tesseract-ocr/tesseract/wiki/Compiling--GitInstallation](https://github.com/tesseract-ocr/tesseract/wiki/Compiling-%E2%80%]の手順に従ってください。 93-GitInstallation)
Also read Install Instructions インストール方法も読んでください。
## Install elsewhere / without root ##他の場所に/ rootなしでインストール
Tesseract can be configured to install anywhere, which makes it possible to install it without root access. Tesseractはどこにでもインストールできるように設定できるため、rootアクセスなしでインストールできます。
To install it in $HOME/local: $ HOME / localにインストールするには:
` | `
./autogen.sh ./autogen.sh
./configure --prefix=$HOME/local/ ./configure --prefix = $ HOME / local /
make 作る
make install インストールする
` | `
To install it in $HOME/local using Leptonica libraries also installed in $HOME/local: $ HOME / localにもインストールされているLeptonicaライブラリを使用して$ HOME / localにインストールするには:
` | `
./autogen.sh ./autogen.sh
LIBLEPT_HEADERSDIR=$HOME/local/include ./configure \ LIBLEPT_HEADERSDIR = $ HOME / local / include ./configure \
--prefix=$HOME/local/ --with-extra-libraries=$HOME/local/lib --prefix = $ HOME / local / --with-extra-libraries = $ HOME / local / lib
make 作る
make install インストールする
` | `
In some system, you might also need to specify the path to the pkg-config before running the configure script: システムによっては、 configureスクリプトを実行する前にpkg-configへのパスを指定する必要があるかもしれません:
` | `
export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig PKG_CONFIG_PATH = $ HOME / local / lib / pkgconfigをエクスポートします。
` | `
## Video representation of the Compiling process for Tesseract 4.0 and Leptonica 1.7.4 on Ubuntu 16.xx ## Ubuntu 16.xx上のTesseract 4.0およびLeptonica 1.7.4のコンパイルプロセスのビデオ表示
* Video Build from Source Leptonica 1.7.4 *ビデオソースLeptonica 1.7.4からビルド
* Video Build from Source Tesseract-OCR 4.0 *ビデオソースTesseract-OCR 4.0からビルド
## Language Data ##言語データ
* Download the data file(s) for the language(s) you interest in. * あなたが興味を持っている言語のデータファイルをダウンロードしてください。
* Move it to the tessdata directory (e.g. 'mv tessdata $TESSDATA_PREFIX' if defined TESSDATA_PREFIX) * tessdataディレクトリに移動してください(例:TESSDATA_PREFIXが定義されている場合は 'mv tessdata $ TESSDATA \ _PREFIX')
You can also use: また使用することができます:
` | `
export TESSDATA_PREFIX=/some/path/to/tessdata TESSDATA_PREFIX = / some / path /から/ tessdataにエクスポートします。
` | `
to point to your tessdata directory (example: if your tessdata path is '/usr/local/share/tessdata' you have to use 'export TESSDATA_PREFIX='/usr/local/share/'). tessdataディレクトリを指すようにします(例:tessdataパスが '/ usr / local / share / tessdata'の場合は、 'export TESSDATA \ _PREFIX =' / usr / local / share / 'を使用する必要があります)。
# Windows #ウィンドウズ
## master branch, 3.05 and later ## masterブランチ、3.05以降
#### Using Tesseract #### Tesseractを使う
!!! IMPORTANT !!! To use Tesseract in your application (to include tess or to link it into your app) see this very simple example https://github.com/tesseract-ocr/tesseract/wiki/User-App-Example. !!!重要!!! アプリケーションでTesseractを使用する(tessを含める、またはそれをアプリケーションにリンクする)には、次の非常に簡単な例を参照してください。https://github.com/tesseract-ocr/tesseract/wiki/User-App-Example
#### Build the latest library ####最新のライブラリを構築する
1. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/. 1. [https://cppan.org/client/cppan-master-Windows-client.zip]最新のCPPAN(C ++アーカイブネットワーク https:// cppan.org /)クライアントを https:/からダウンロードします。 / cppan.org / client /
2. Run cppan --build pvt.cppan.demo.google.tesseract.tesseract-master. 2. cppan --build pvt.cppan.demo.google.tesseract.tesseract-masterを実行します。
#### For visual studio project using tesseract #### tesseractを使ったビジュアルスタジオプロジェクトのために
1. Setup Vcpkg the Visual C++ Package Manager. 1. VcpkgをVisual C ++パッケージマネージャに設定します。
2. Run vcpkg install tesseract:x64-windows for 64-bit. Use --head for the master branch. 2. 64ビット用に vcpkg install tesseract:x64-windowsを実行します。マスターブランチには--headを使用してください。
#### Static linking ####静的リンク
To build a self-contained tesseract.exe executable (without any DLLs or runtime dependencies), use Vcpkg as above with the following command: 自己完結型の tesseract.exe実行可能ファイルを(DLLやランタイムの依存関係なしで)構築するには、上記のVcpkgを以下のコマンドで使用します。
- vcpkg install tesseract:x64-windows-static for 64-bit - 64ビット用の vcpkg install tesseract:x64-windows-static
- vcpkg install tesseract:x86-windows-static for 32-bit - 32ビット用の vcpkg install tesseract:x86-windows-static
Use --head for the master branch. It may still require one DLL for the OpenMP runtime, vcomp140.dll (which you can find in the Visual C++ Redistributable 2015). マスターブランチには--headを使用してください。 OpenMPランタイム用に1つのDLL、 vcomp140.dll(これはVisual C ++ Redistributable 2015にあります)を必要とするかもしれません。
#### Build training tools ####トレーニングツールを作成する
Today it is possible to build a full set of tess training tools on Windows with Visual Studio. 今日では、Windows上でVisual Studioを使用してフルセットのテストレーニングツールを構築することが可能です。
The latest versions (Win10, VS2015/VS2017) are preferable. 最新バージョン(Win10、VS2015 / VS2017)が望ましいです。
To do this: これをする:
1. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/. 1. [https://cppan.org/client/cppan-master-Windows-client.zip]最新のCPPAN(C ++アーカイブネットワーク https:// cppan.org /)クライアントを https:/からダウンロードします。 / cppan.org / client /
2. Run cppan --build pvt.cppan.demo.google.tesseract-master. 2. cppan --build pvt.cppan.demo.google.tesseract-masterを実行します。
#### Develop Tesseract #### Tesseractを開発する
For development purposes of Tesseract itself do the next steps: Tesseract自身の開発目的のために**次のステップを実行してください。
1. Download and install Git, CMake and put them in PATH. 1. Git、CMakeをダウンロードしてインストールし、それらをPATHに入れます。
2. Download the latest CPPAN (C++ Archive Network https://cppan.org/) client from https://cppan.org/client/. CPPAN is a source package distribution system. Add CPPAN client in PATH too. (VS2015 redist is required.) 2. [https://cppan.org/client/cppan-master-Windows-client.zip]最新のCPPAN(C ++アーカイブネットワーク https:// cppan.org /)クライアントを https:/からダウンロードします。 / cppan.org / client /。 CPPANはソースパッケージ配布システムです。 PATHにもCPPANクライアントを追加します。 (VS2015の再リストが必要です。)
3. If you have a release archive, unpack it to tesseract dir. 3.リリースアーカイブがある場合は、それを tesseractディレクトリに解凍します。
If you're using master branch (4.0) run master branch(4.0)を使っている場合
` | `
git clone https://github.com/tesseract-ocr/tesseract tesseract gitクローンhttps://github.com/tesseract-ocr/tesseract tesseract
` | `
4. Run 4.実行
` | `
cd tesseract cdテセラクト
cppan cppan
mkdir build && cd build mkdir build && cd build
cmake .. してください。
` | `
5. Build a solution (tesseract.sln) in your Visual Studio version. 5. Visual Studioのバージョンでソリューション( tesseract.sln)を作成します。
If you want to build and install from command line (e.g. Release build) you can use this command: コマンドラインからビルドしてインストールしたい場合(例:Release build)、このコマンドを使用できます。
` | `
cmake --build . --config Release --target install cmake --build --configリリース--target install
` | `
If you want to install to other directory that C:\Program Files (you will need admin right for this), you need to specify install path during configuration: C:\ Program Filesという他のディレクトリにインストールしたい場合(これには管理者権限が必要です)、設定時にインストールパスを指定する必要があります。
` | `
cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX=inst cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_INSTALL_PREFIX = inst
` | `
For development purposes of training tools after cloning a repo from previous paragraph, run 前の段落からリポジトリを複製した後のトレーニングツールの開発目的
` | `
cppan --build . cppan - ビルドします。
` | `
You'll see a solution link appeared in the root directory of Tesseract. Tesseractのルートディレクトリにソリューションリンクが表示されます。
## Building for x64 platform ## x64プラットフォーム用に構築
If you're building with cppan+cmake, run cmake as follows: cppan + cmakeを使用して構築している場合は、次のようにcmakeを実行してください。
` | `
mkdir win64 && cd win64 mkdir win64 && cd win64
cppan .. cppan ..
cmake .. -G "Visual Studio 14 2015 Win64" cmake .. -G "Visual Studio 14 2015 Win64"
` | `
If you're building with cppan, edit cppan.yml and uncomment this line: cppanでビルドしている場合は、cppan.ymlを編集してこの行のコメントを外します。
` | `
#generator: Visual Studio 14 2015 Win64 -> generator: Visual Studio 14 2015 Win64 #generator:Visual Studio 14 2015 Win64 - >ジェネレータ:Visual Studio 14 2015 Win64
` | `
Then run cppan --generate . - it will create a solution link for you. それから `cppan --generate 'を実行してください - それはあなたのための解決リンクを作成するでしょう。
(For VS2017, use '15 2017' instead of '14 2015'.) (VS2017では、'14 2015 'の代わりに'15 2017'を使用してください。)
## 3.05 ## 3.05
If you have Visual Studio 2015, checkout the https://github.com/peirick/VS2015_Tesseract repository for Visual Studio 2015 Projects for Tessearct and dependencies. and click on build_tesseract.bat. After that you still need to download the language packs. Visual Studio 2015をお持ちの場合は、[Tessearctおよび依存関係のためのVisual Studio 2015プロジェクト]のhttps://github.com/peirick/VS2015_Tesseractリポジトリ(https://github.com/peirick/VS2015_Tesseract)をチェックし、build_tesseractをクリックしてください。 。コウモリ。その後も、言語パックをダウンロードする必要があります。
## 3.03rc-1 ## 3.03rc-1
Have a look at blog How to build Tesseract 3.03 with Visual Studio 2013. ブログVisual Studio 2013でTesseract 3.03をビルドする方法をご覧ください。
## 3.02 ## 3.02
For tesseract-ocr 3.02 please follow instruction in Visual Studio 2008 Developer Notes for Tesseract-OCR. tesseract-ocr 3.02についてはVisual Studio 2008 Tesseract-OCR開発者向けノートの指示に従ってください。 -tesseractocr-sources)
## 3.01 ## 3.01
Download these packages from the Downloads Archive on SourceForge page: SourceForgeのダウンロードアーカイブページからこれらのパッケージをダウンロードしてください。
* tesseract-3.01.tar.gz - Tesseract source * tesseract-3.01.tar.gz - Tesseractのソース
* tesseract-3.01-win_vs.zip - Visual studio (2008 & 2010) solution with necessary libraries * tesseract-3.01-win_vs.zip - 必要なライブラリを備えたビジュアルスタジオ(2008&2010)ソリューション
* tesseract-ocr-3.01.eng.tar.gz - English language file for Tesseract (or download other language training file) * tesseract-ocr-3.01.eng.tar.gz - Tesseract用の英語ファイル(または他の言語トレーニングファイルをダウンロードする)
Unpack them to one directory (e.g. tesseract-3.01). Note that tesseract-ocr-3.01.eng.tar.gz names the root directory 'tesseract-ocr' instead of 'tesseract-3.01'. それらを1つのディレクトリに解凍します(例: tesseract-3.01)。 tesseract-ocr-3.01.eng.tar.gz`tesseract-3.01'の代わりに`tesseract-ocr'にルートディレクトリを指定することに注意してください。
Windows relevant files are located in vs2008 directory (e.g. 'tesseract-3.01\vs2008'). The same build process as usual applies: Open tesseract.sln with VC++Express 2008 and build all (or just Tesseract.) It should compile (in at least release mode) without having to install anything further. The dll dependencies and Leptonica are included. Output will be in tesseract-3.01\vs2008\bin (or tesseract-3.01\vs2008\bin.rd or tesseract-3.01\vs2008\bin.dbg based on configuration build). Windows関連ファイルはvs2008ディレクトリにあります(例: 'tesseract-3.01 \ vs2008')。いつもと同じビルドプロセスが適用されます:VC ++ Express 2008でtesseract.slnを開き、すべて(または単にTesseract)をビルドします。それ以上インストールしなくてもコンパイルできます(少なくともリリースモードで)。 dllの依存関係とLeptonicaが含まれています。出力はtesseract-3.01 \ vs2008 \ bin(または構成構築に基づいてtesseract-3.01 \ vs2008 \ bin.rdまたはtesseract-3.01 \ vs2008 \ bin.dbg)になります。
## Mingw+Msys ## Mingw + Msys
For Mingw+Msys have a look at blog Compiling Leptonica and Tesseract-ocr with Mingw+Msys. Mingw + MsysはブログMingw + MsysでLeptonicaとTesseract-ocrをコンパイルするをご覧ください。 。
## Msys2 ## Msys2
Download and install MSYS2 Installer from https://msys2.github.io/ https://msys2.github.io/からMSYS2インストーラをダウンロードしてインストールします
The core packages groups you need to install if you wish to build from PKGBUILDs are: PKGBUILDからビルドしたい場合にインストールする必要があるコアパッケージグループは以下のとおりです。
- base-devel for any building - あらゆる建物の基礎開発
- msys2-devel for building msys2 packages - msys2パッケージをビルドするためのmsys2-devel
- mingw-w64-i686-toolchain for building mingw32 packages - mingw32パッケージをビルドするためのmingw-w64-i686-toolchain
- mingw-w64-x86_64-toolchain for building mingw64 packages - mingw64パッケージをビルドするためのmingw-w64-x86_64-toolchain
To build the tesseract-ocr release package, use PKGBUILD from https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-tesseract-ocr tesseract-ocrリリースパッケージを構築するには、https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-tesseract-ocrからPKGBUILDを使用します
## Cygwin ## Cygwin
To build on Cygwin have a look at blog How to build Tesseract on Cygwin. Cygwin上で構築するには、ブログCygwin上でTesseractを構築する方法をご覧ください。
Tesseract as well as the training utilities for 3.04.00 onwards are available as Cygwin packages. Tesseractと3.04.00以降のトレーニングユーティリティはCygwinパッケージとして利用可能です。
` | `
Tesseract specific packages to be installed: インストールする特定のパッケージを分解します。
tesseract-ocr 3.04.01-1 tesseract-ocr 3.04.01-1
tesseract-ocr-eng 3.04-1 tesseract-ocr-eng 3.04-1
tesseract-training-core 3.04-1 tesseract-training-core 3.04-1
tesseract-training-eng 3.04-1 tesseract-training-eng 3.04-1
tesseract-training-util 3.04.01-1 tesseract-training-util 3.04.01-1
` | `
## Mingw-w64 ## Mingw-w64
Mingw-w64 allows building 32- or 64-bit executables for Windows. Mingw-w64では、Windows用の32ビットまたは64ビットの実行可能ファイルを構築できます。
It can be used for native compilations on Windows, Windows上でネイティブコンパイルに使用できます。
but also for cross compilations on Linux (which are easier and faster than native compilations). しかし、Linux上でのクロスコンパイル(これはネイティブのコンパイルよりも簡単で速いです)のためにもあります。
Most large Linux distributions already contain packages with the tools need for a cross build. ほとんどの大規模なLinuxディストリビューションには、既にクロスビルドに必要なツールを含むパッケージが含まれています。
Before building Tesseract, it is necessary to build some prerequisites. Tesseractを構築する前に、いくつかの前提条件を構築する必要があります。
For Debian and similar distributions (e. g. Ubuntu), the cross tools can be installed like that: Debianやそれに類するディストリビューション(Ubuntuなど)では、クロスツールは以下のようにインストールすることができます。
` | `
# Development environment targeting 32- and 64-bit Windows (required) #32ビットおよび64ビットWindowsを対象とした開発環境(必須)
apt-get install mingw-w64 apt-get mingw-w64をインストールしてください。
# Development tools for 32- and 64-bit Windows (optional) 32ビットおよび64ビットWindows用の開発ツール(オプション)
apt-get install mingw-w64-tools apt-get mingw-w64-toolsをインストールする
` | `
These prerequisites will be needed: これらの前提条件が必要になります。
* libpng, libtiff, zlib (binaries for Mingw-w64 available as part of the GTK+ bundles) * libpng、libtiff、zlib(Mingw-w64のバイナリはGTK +バンドルの一部として入手可能)
* libicu * libicu
* liblcms2 * liblcms2
* openjpeg * openjpeg
* leptonica * leptonica
# macOS # マックOS
Typically a package manager like Fink, Homebrew or MacPorts is needed in addition to Apple's Xcode. 通常、Fink、Homebrew、MacPortsなどのパッケージマネージャが、AppleのXcodeに加えて必要です。
Xcode and the related command line tools provides the compiler (llvm-gcc) and linker, but also libraries like zlib. The package manager provides free software packages which are not part of Xcode. Xcodeと関連するコマンドラインツールはコンパイラ( llvm-gcc)とリンカを提供しますが、zlibのようなライブラリも提供します。パッケージマネージャはXcodeの一部ではないフリーソフトウェアパッケージを提供します。
The Xcode Command Line Tools can be installed by running xcode-select --install. Xcodeコマンドラインツールは xcode-select --installを実行することでインストールできます。
Note that Tesseract 4 can be built with OpenMP support, but that requires additional installations. Tesseract 4はOpenMPサポートでビルドすることができますが、追加のインストールが必要です。
## macOS with Fink Finkによる## macOS
Fink (as of 2017-04) neither provides Leptonica nor the packages needed for the Tesseract training tools, Fink(2017-04現在)はLeptonicaもTesseractトレーニングツールに必要なパッケージも提供していません。
so it cannot be recommended for building Tesseract. そのため、Tesseractを構築するのにはお勧めできません。
## macOS with MacPorts ## macOSとMacPorts
### Prepare support for OpenMP (optional) ### OpenMPのサポートを準備する(オプション)
Install OpenMP: OpenMPをインストールします。
` | `
sudo port install libomp sudoポートインストールlibomp
` | `
The following method which gets, compiles and installs OpenMP manually should no longer be needed: OpenMPを手動で取得、コンパイル、インストールする次の方法はもう必要ありません。
` | `
# Install cmake if it is not available. #cmakeが利用できない場合はインストールしてください。
sudo port install cmake sudo port install cmake
git clone https://github.com/llvm-mirror/openmp.git git clone https://github.com/llvm-mirror/openmp.git
cd openmp cd openmp
mkdir build mkdirビルド
cd build CDビルド
cmake .. してください。
make 作る
sudo make install sudo make install
` | `
### Install required packages ###必要なパッケージをインストールする
` | `
sudo port install autoconf \ sudo port install autoconf \
automake \ automake \
libtool \ libtool \
pkgconfig \ pkgconfig \
leptonica レプトニカ
` | `
### Compilation ###コンパイル
Compilation itself relies on the Autotools suite: コンパイル自体はAutotools suiteに依存しています。
` | `
git clone https://github.com/tesseract-ocr/tesseract.git git clone https://github.com/tesseract-ocr/tesseract.git
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
./configure ./configure
make 作る
sudo make install sudo make install
` | `
If you want support for multithreading, you have to install OpenMP first (see above) マルチスレッドをサポートしたい場合は、最初にOpenMPをインストールする必要があります(上記参照)。
and tell the compiler and linker how to activate OpenMP support. そしてコンパイラとリンカにOpenMPサポートを有効にする方法を伝えます。
This is done by adding that information to the options for configure: これは configureのオプションにその情報を追加することで行われます。
` | `
./configure CXXFLAGS="-Xpreprocessor -fopenmp -I/opt/local/include/libomp -Wall -O2" LDFLAGS=-L/opt/local/lib/libomp LIBS=-lomp ./configure CXXFLAGS = " - Xプリプロセッサ-fopenmp -I / opt / local / include / libomp -Wall -O2" LDFLAGS = -L / opt / local / lib / libomp LIBS = -lomp
` | `
If compilation fails at the make command, with libtool erring on missing instructions, you may be building with MacPort's g++ compiler, with known issues. The community recommends to use clang, but a workaround for g++ is to re-configure the build: makeコマンドでコンパイルが失敗し、libtoolが足りない命令を誤って表示した場合、[既知の問題]を伴って、MacPortの g ++コンパイラでビルドしているかもしれません(https://github.com/tesseract-ocr/tesseract/プル/ 1474)。コミュニティは clangを使うことを推奨しますが、g ++の回避策はビルドを再設定することです:
./configure CXXFLAGS=-Wa,-q ./configure CXXFLAGS = -Wa、-q
And then proceed with make. そして makeを続けます。
### Install Tesseract with training tools ###トレーニングツールを使ってTesseractをインストールする
In the above training tools are not installed. You can install not only Tesseract but also training tools like below. 上記のトレーニングツールはインストールされていません。 Tesseractだけでなく、以下のようなトレーニングツールもインストールできます。
#### Install packages required by training tools ####トレーニングツールに必要なパッケージをインストールする
` | `
sudo port install cairo pango sudoポートインストールcairo pango
sudo port install icu +devel sudoポートインストールicu + devel
` | `
#### Build and Install ####ビルドしてインストールする
` | `
git clone https://github.com/tesseract-ocr/tesseract/ git clone https://github.com/tesseract-ocr/tesseract/
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
./configure ./configure
make training トレーニングをする
sudo make install training-install sudo make installトレーニングインストール
` | `
## macOS with Homebrew 自作の## macOS
### Install dependencies ###インストール依存関係
` | `
brew install automake autoconf libtool brew install automake autoconf libtool
brew install pkgconfig bkgインストールpkgconfig
brew install icu4c インストールicu4cを醸造
brew install leptonica 醸造インストールレプトニカ
brew install gcc インストールGCCを醸造
` | `
### Install Tesseract with training tools ###トレーニングツールを使ってTesseractをインストールする
In the above, training tool dependencies are not installed. You can install them like below. 上記では、トレーニングツールの依存関係はインストールされていません。以下のようにインストールすることができます。
` | `
brew install pango インストールパンゴを醸造
` | `
### Compile ###コンパイル
As of January 2017, the clang builds but OpenMP will only use a single thread, reducing performance. For best results, use gcc. 2017年1月現在、clangはビルドされますが、OpenMPはシングルスレッドのみを使用するため、パフォーマンスが低下します。最良の結果を得るには、gccを使用してください。
The exact values of CPPFLAGS and LDFLAGS can be read from brew info icu4c. If you want to build training module, you should also link pango libraries as -L/usr/local/Cellar/pango/1.42.4/lib. | CPPFLAGSLDFLAGSの正確な値は brew info icu4cから読むことができます。トレーニングモジュールを構築したい場合は、 pangoライブラリを -L / usr / local / Cellar / pango / 1.42.4 / libとしてリンクする必要があります。
```bash bash
git clone https://github.com/tesseract-ocr/tesseract/ git clone https://github.com/tesseract-ocr/tesseract/
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
./configure CC=gcc-8 CXX=g++-8 CPPFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib ./configure CC = gcc-8 CXX = g ++ - 8 CPPFLAGS = -I / usr / local / opt / icu4c / include LDFLAGS = -L / usr / local / opt / icu4c / lib
make -j make -j
sudo make install # if desired sudo make install##必要ならば
make training # if installed with training dependencies トレーニング依存関係がインストールされている場合は、トレーニング番号を作成します。
` | `
# Common Errors #よくあるエラー
* To fix this error *このエラーを修正する
` | `
./configure: line 4237: syntax error near unexpected token `-mavx,' ./configure:4237行:予期しないトークン-mavxの近くに構文エラー
./configure: line 4237: AX_CHECK_COMPILE_FLAG(-mavx, avx=1, avx=0)' | ./configure:4237行目:AX_CHECK_COMPILE_FLAG(-mavx、avx = 1、avx = 0) '
` | `
ensure that autoconf-archive is installed. Don't forget to run ./autogen.sh after the installation of autoconf-archive. Note this error happens often under CentOS, where autoconf-archive is missing and no package is available. Some projects help with installing. autoconf-archiveがインストールされていることを確認してください。 autoconf-archiveのインストール後に。/ autogen.shを実行することを忘れないでください。このエラーはCentOSの下でしばしば発生することに注意してください。そこでは autoconf-archiveがなく、利用可能なパッケージもありません。 いくつかのプロジェクトはインストールを手助けします。
The latest code from GitHub does not require autoconf-archive. GitHubからの最新のコードは autoconf-archiveを必要としません。
* If configure fails with such error "configure: error: Leptonica 1.74 or higher is required." Try to install libleptonica-dev package. * configureがこのようなエラーで失敗した場合 "configure:error:Leptonica 1.74以上が必要です。" libleptonica-devパッケージをインストールしてみてください。
* If you are sure you have installed leptonica (for example in /usr/local) then probably pkg-config is not looking at your install folder (check with pkg-config --variable pc_path pkg-config). *もしあなたが(例えば/ usr / localに)leptonicaをインストールしたと確信しているなら、おそらくpkg-configはあなたのインストールフォルダを見ていません( pkg-config --variable pc_path pkg-configでチェックしてください)。
A solution is to set PKG_CONFIG_PATH : example :PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 解決策はPKG_CONFIG_PATHを設定することです:例: PKG_CONFIG_PATH = / usr / local / lib / pkgconfig
* On some systems autotools does not create m4 directory automatically (giving the error: "configure: error: cannot find macro directory 'm4'"). *一部のシステムでは、autotoolsはm4ディレクトリを自動的に作成しません( "configure:error:マクロディレクトリ 'm4'が見つかりません"というエラーが出ます)。
In this case you must create m4 directory (mkdir m4), and then rerun the above commands starting with ./configure. この場合、m4ディレクトリ( mkdir m4)を作成してから、。/ configureで始まる上記のコマンドを再実行しなければなりません。
# Miscellaneous #その他
* Standalone Tesseract build bash script * スタンドアロンTesseractビルドbashスクリプト
最終更新:2019年08月19日 20:52