Before building libadic, ensure you have the following dependencies installed:
- CMake (>= 3.15): Build system generator
- C++ Compiler with C++17 support (GCC 7+, Clang 5+, or MSVC 2017+)
- GMP (GNU Multiple Precision Arithmetic Library)
- Python 3.7+ (for Python bindings)
sudo apt-get update
sudo apt-get install -y cmake build-essential libgmp-dev python3-devbrew install cmake gmp pythonvcpkg install gmp# Clone the repository
git clone https://github.com/vadyushkins/libadic.git
cd libadic
# Create build directory
mkdir build && cd build
# Configure and build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
# Run tests to verify installation
ctest --verbose# From the repository root
pip install .
# Verify installation
python -c "import libadic; print(f'libadic version: {libadic.__version__}')"# Run C++ mathematical validation tests
./build/tests/test_math_validations
# Run Python Reid-Li tests
python tests/python/test_reid_li_working.py# Run complete validation (includes comparison with other libraries)
cd docs/validation
./run_validation.shThe library's core feature is the Reid-Li criterion implementation. To verify it works:
import libadic
# Set up parameters
p = 5
precision = 15
# Get primitive characters
chars = libadic.enumerate_primitive_characters(p, p)
# Find an odd character and compute L'_p(0, χ)
for chi in chars:
if chi.is_odd():
# This internally computes Φ_p(χ) = Σ χ(a) log Γ_p(a)
lp_derivative = libadic.kubota_leopoldt_derivative(0, chi, precision)
print(f"L'_p(0, χ) = {lp_derivative}")
breakIf you get "cmake: command not found", install CMake using your package manager as shown above.
If CMake reports "Could NOT find GMP", ensure GMP is installed and set the path:
cmake .. -DGMP_ROOT=/path/to/gmpIf Python can't import libadic after installation:
# Ensure you're using the same Python version for building and running
python --version
pip show libadic
# Reinstall with verbose output
pip install . -v- Read MATHEMATICAL_REFERENCE.md for theoretical background
- See examples/ directory for usage examples
- Check tests/ for comprehensive test cases
- Review VALIDATION_REPORT.md for proof of uniqueness