| English | 한국어 | 日本語 | Tiếng Việt |
Ada example
https://github.com/bobhyun/TS-ANPR/tree/main/examples/Ada/anpr
1. Copying the Engine Files
[Note] In this example, the engine file is extracted to the examples/bin/ directory to share it with other examples. However, for actual deployment, the engine file is typically copied to the directory where the application’s executable file is located.
- For Windows x86 64-bit
Extract the engine file to the
examples/bin/windows-x86_64directory7z x tsanpr*-windows-x86_64.7z - For Windows x86 32-bit
Extract the engine file to the
examples/bin/windows-x86directory7z x tsanpr*-windows-x86.7z - For Linux x86 64-bit
Extract the engine file to the
examples/bin/linux-x86_64directorytar xvf tsanpr*-linux-x86_64.tar.xz - For Linux arm 64-bit
Extract the engine file to the
examples/bin/linux-aarch64directorytar xvf tsanpr*-linux-aarch64.tar.xz - Directory structure
examples ├── bin │ ├─── windows-x86_64 # engine directory for Windows (x86_64) │ │ ├── tsanpr.dll │ │ ├── tsanpr-2505M.eon │ │ └── tshelper.exe │ ├─── windows-x86 # engine directory for Windows (x86) │ │ ├── tsanpr.dll │ │ ├── tsanpr-2505M.eon │ │ └── tshelper.exe │ ├── linux-x86_64 # engine directory for Linux (x86_64) │ │ ├── libtsanpr.so │ │ ├── tsanpr-2505M.eon │ │ └── tshelper │ └── linux-aarch64 # engine directory for Linux (arm64) │ ├── libtsanpr.so │ ├── tsanpr-2505M.eon │ └── tshelper ├── img # image directory └── Ada └── anpr # project directory ├── bin # executable directory ├── obj # object files directory ├── src # source directory │ ├── anpr.adb │ ├── tsanpr.ads │ ├── tsanpr-windows.adb │ └── tsanpr-unix.adb ├── anpr.gpr ├── alire.toml ├── compile.bat ├── compile.sh └── Makefile
2. Build and Run
2.1 Using Alire (Recommended)
Alire is the modern package manager for Ada that automatically manages toolchains and dependencies.
-
Install Alire
Windows:
- Download from https://alire.ada.dev
- Extract and add
alrto your PATH
Linux:
Recommended: Manual installation (all distributions)
Download the latest version from Alire Releases:
# Download the latest release (check the releases page for current version) wget https://github.com/alire-project/alire/releases/download/v2.1.0/alr-2.1.0-bin-x86_64-linux.zip unzip alr-2.1.0-bin-x86_64-linux.zip sudo mv bin/alr /usr/local/bin/Or visit https://alire.ada.dev to download and add to PATH
Alternative: Using package manager (may have older version)
- Debian/Ubuntu:
sudo apt-get update sudo apt-get install alire - Fedora/RHEL/CentOS:
sudo dnf install alire
Note: If you encounter
Unexpected property count: 0error with package manager installed version, please use the manual installation method above to get the latest version. -
Build
alr buildOn first build, Alire will automatically download and install GNAT compiler and GPRbuild. Simply press Enter when prompted.
-
Run
alr runOr run directly:
bin/anpr
2.2 Using GNAT/GPRbuild (Traditional Method)
2.2.1 Windows
-
GNAT Installation
- Download and install GNAT Community
- Add GNAT bin directory to PATH
-
How to Build
compile.batOr using GPRbuild:
gprbuild -p -P anpr.gpr -XOS=Windows_NT -
How to Run
For proper UTF-8 character display (recommended for non-ASCII characters):
chcp 65001 bin\anpr.exeOr without UTF-8 encoding (may show corrupted non-ASCII text):
bin\anpr.exe
2.2.2 Linux
-
Dependency Installation
-
Debian / Ubuntu Linux
sudo apt-get update sudo apt-get install gnat gprbuild -
Oracle Linux / RedHat (RHEL) / CentOS
sudo yum install gcc-gnat gprbuild -
Fedora
sudo dnf install gcc-gnat gprbuild
-
-
How to Build
chmod +x compile.sh ./compile.shOr using GPRbuild:
gprbuild -p -P anpr.gpr -XOS=UNIXOr using Make:
make -
How to Run
bin/anprNote for Character Encoding: Non-ASCII characters should display correctly on Linux systems that support UTF-8 by default. If you encounter display issues, ensure your terminal is set to UTF-8 encoding.