Skip to the content.
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.

2. Build and Run

Alire is the modern package manager for Ada that automatically manages toolchains and dependencies.

  1. Install Alire

    Windows:

    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: 0 error with package manager installed version, please use the manual installation method above to get the latest version.

  2. Build

    alr build
    

    On first build, Alire will automatically download and install GNAT compiler and GPRbuild. Simply press Enter when prompted.

  3. Run

    alr run
    

    Or run directly:

    bin/anpr
    

2.2 Using GNAT/GPRbuild (Traditional Method)

2.2.1 Windows
  1. GNAT Installation

  2. How to Build

    compile.bat
    

    Or using GPRbuild:

    gprbuild -p -P anpr.gpr -XOS=Windows_NT
    
  3. How to Run

    For proper UTF-8 character display (recommended for non-ASCII characters):

    chcp 65001
    bin\anpr.exe
    

    Or without UTF-8 encoding (may show corrupted non-ASCII text):

    bin\anpr.exe
    
2.2.2 Linux
  1. 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
      
  2. How to Build

    chmod +x compile.sh
    ./compile.sh
    

    Or using GPRbuild:

    gprbuild -p -P anpr.gpr -XOS=UNIX
    

    Or using Make:

    make
    
  3. How to Run

    bin/anpr
    

    Note 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.