๐ Requirements
Before installing NEUROVEDIK, ensure you have the following:
Operating System
- Windows 10/11 (x64)
- Linux (Ubuntu 20.04+, CentOS 8+)
- macOS 12+ (Intel only)
Build Tools
- CMake 3.16+
- GCC 10+ / Clang 12+ / MSVC 2019+
- Python 3.7+ (for bindings)
Recommended Hardware
- Intel Skylake-X or newer (AVX-512)
- AMD Zen 4 (AVX-512 support)
- 8GB RAM minimum
Note: NEUROVEDIK includes scalar fallbacks, so it will work on any x64
CPU.
AVX-512 is optional but provides the best performance.
๐ฆ Installation
Option 1: Clone from GitHub
bash
# Clone the repository
git clone https://github.com/neurovedik/neurovedik.git
cd neurovedik
# Verify the structure
ls -la
Option 2: Download Release
Download the latest release from GitHub Releases.
๐จ Building from Source
cmd
REM Run the build script
build.bat
REM Or use CMake directly
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64
cmake --build . --config Release
bash
# Install dependencies
sudo apt install cmake gcc g++ python3-dev
# Build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Install (optional)
sudo make install
bash
# Install Xcode command line tools
xcode-select --install
# Install CMake via Homebrew
brew install cmake
# Build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(sysctl -n hw.ncpu)
๐ Python Setup
Install the Python bindings for easy integration with your data science workflow:
bash
# Install from source (in the project root)
pip install -e .
# Verify installation
python -c "import NEUROVEDIK; print(NEUROVEDIK.get_cpu_features())"
If you see CPU feature information, the installation was successful!
๐ Your First Program
Python Example
python
hello_neurovedik.py
import NEUROVEDIK
# Create large integers
a = NEUROVEDIK.BigInt.from_int(123456789012345678901234567890)
b = NEUROVEDIK.BigInt.from_int(987654321098765432109876543210)
# Multiply using Vedic algorithms
result = NEUROVEDIK.multiply(a, b)
print(f"Result: {result.to_int()}")
# Check which SIMD features are available
features = NEUROVEDIK.get_cpu_features()
print(f"AVX-512: {features['avx512f']}")
print(f"AVX2: {features['avx2']}")
# RSA-style modular exponentiation
base = NEUROVEDIK.BigInt.from_int(12345)
exp = NEUROVEDIK.BigInt.from_int(65537)
mod = NEUROVEDIK.BigInt.from_int(1000000007)
cipher = NEUROVEDIK.modexp(base, exp, mod)
print(f"ModExp result: {cipher.to_int()}")
C Example
c
hello_neurovedik.c
#include "neurovedik.h"
#include <stdio.h>
int main() {
// Allocate BigInts
BigInt* a = nv_alloc(32); // 32 limbs = 2048 bits
BigInt* b = nv_alloc(32);
BigInt* result = nv_alloc(64);
// Initialize with values
nv_from_hex(a, "123456789ABCDEF...");
nv_from_hex(b, "FEDCBA987654321...");
// Multiply (auto-selects best algorithm)
nv_multiply(a, b, result);
// Print result
char* hex = nv_to_hex(result);
printf("Result: %s\n", hex);
// Cleanup
nv_free(a);
nv_free(b);
nv_free(result);
return 0;
}
โ Verification
Run the verification suite to ensure everything works correctly:
bash
# Run Python verification
python verify_algorithms.py
# Expected output:
# โ All 56 tests passed!
# โ CPU Features: AVX-512 detected
# โ Algorithms verified: Vedic, Karatsuba, NTT, Montgomery