Skip to content

Installation

This guide explains how to install and configure FTP_CALCULATOR for Rust, Python, and Excel.


Prerequisites

For all environments

  • Git: To clone the repository.
    sudo apt install git  # Linux (Debian/Ubuntu)
    
  • Rust: To compile the crates.
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
    

For Rust and Python

  • Python 3.8+:
    sudo apt install python3 python3-pip  # Linux
    
  • Build tools:
    sudo apt install build-essential  # Linux
    

For Excel (Windows only)


Installation

1. Clone the repository

git clone https://github.com/ton_org/FTP_CALCULATOR.git
cd FTP_CALCULATOR

2. Install Rust dependencies

cargo install cbindgen  # To generate C headers

3. Install Python dependencies

pip install -r python/requirements.txt

4. Compile Rust bindings

For Python (PyO3)

cd crates/ftp_core_bindings_pyo3
maturin develop  # Installs the Python module locally

For Excel (C)

cd crates/ftp_core_bindings_c
cargo build --release

5. Configure the Excel add-in (Windows)

  1. Compile the C# project:
    cd excel/AddIn
    dotnet build
    
  2. Copy the .xll file:

    • The TonAddIn.xll file is generated in excel/AddIn/bin/Debug/.
    • Copy it to an accessible folder (e.g., ~/Desktop/).
  3. Load in Excel:

    • Open Excel.
    • Go to File > Options > Add-ins > Browse.
    • Select TonAddIn.xll.

Verification

  • Test the Python bindings:
    python -c "from ftp_core_python import add; print(add(2, 3))"  # Should display 5
    
  • Test the Excel add-in: In an Excel cell, type:
    =RustAdd(2, 3)  # Should return 5