|
| 1 | +# Quick Start Guide for libadic |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +Before building libadic, ensure you have the following dependencies installed: |
| 6 | + |
| 7 | +### Required Dependencies |
| 8 | +- **CMake** (>= 3.15): Build system generator |
| 9 | +- **C++ Compiler** with C++17 support (GCC 7+, Clang 5+, or MSVC 2017+) |
| 10 | +- **GMP** (GNU Multiple Precision Arithmetic Library) |
| 11 | +- **Python 3.7+** (for Python bindings) |
| 12 | + |
| 13 | +### Installing Dependencies |
| 14 | + |
| 15 | +#### Ubuntu/Debian |
| 16 | +```bash |
| 17 | +sudo apt-get update |
| 18 | +sudo apt-get install -y cmake build-essential libgmp-dev python3-dev |
| 19 | +``` |
| 20 | + |
| 21 | +#### macOS (with Homebrew) |
| 22 | +```bash |
| 23 | +brew install cmake gmp python |
| 24 | +``` |
| 25 | + |
| 26 | +#### Windows (with vcpkg) |
| 27 | +```powershell |
| 28 | +vcpkg install gmp |
| 29 | +``` |
| 30 | + |
| 31 | +## Building the Library |
| 32 | + |
| 33 | +### Quick Build (Recommended) |
| 34 | +```bash |
| 35 | +# Clone the repository |
| 36 | +git clone https://github.com/vadyushkins/libadic.git |
| 37 | +cd libadic |
| 38 | + |
| 39 | +# Create build directory |
| 40 | +mkdir build && cd build |
| 41 | + |
| 42 | +# Configure and build |
| 43 | +cmake .. -DCMAKE_BUILD_TYPE=Release |
| 44 | +make -j$(nproc) |
| 45 | + |
| 46 | +# Run tests to verify installation |
| 47 | +ctest --verbose |
| 48 | +``` |
| 49 | + |
| 50 | +### Install Python Bindings |
| 51 | +```bash |
| 52 | +# From the repository root |
| 53 | +pip install . |
| 54 | + |
| 55 | +# Verify installation |
| 56 | +python -c "import libadic; print(f'libadic version: {libadic.__version__}')" |
| 57 | +``` |
| 58 | + |
| 59 | +## Running Validation Tests |
| 60 | + |
| 61 | +### Quick Validation |
| 62 | +```bash |
| 63 | +# Run C++ mathematical validation tests |
| 64 | +./build/tests/test_math_validations |
| 65 | + |
| 66 | +# Run Python Reid-Li tests |
| 67 | +python tests/python/test_reid_li_working.py |
| 68 | +``` |
| 69 | + |
| 70 | +### Full Validation Suite |
| 71 | +```bash |
| 72 | +# Run complete validation (includes comparison with other libraries) |
| 73 | +cd docs/validation |
| 74 | +./run_validation.sh |
| 75 | +``` |
| 76 | + |
| 77 | +## Verifying Reid-Li Implementation |
| 78 | + |
| 79 | +The library's core feature is the Reid-Li criterion implementation. To verify it works: |
| 80 | + |
| 81 | +```python |
| 82 | +import libadic |
| 83 | + |
| 84 | +# Set up parameters |
| 85 | +p = 5 |
| 86 | +precision = 15 |
| 87 | + |
| 88 | +# Get primitive characters |
| 89 | +chars = libadic.enumerate_primitive_characters(p, p) |
| 90 | + |
| 91 | +# Find an odd character and compute L'_p(0, χ) |
| 92 | +for chi in chars: |
| 93 | + if chi.is_odd(): |
| 94 | + # This internally computes Φ_p(χ) = Σ χ(a) log Γ_p(a) |
| 95 | + lp_derivative = libadic.kubota_leopoldt_derivative(0, chi, precision) |
| 96 | + print(f"L'_p(0, χ) = {lp_derivative}") |
| 97 | + break |
| 98 | +``` |
| 99 | + |
| 100 | +## Troubleshooting |
| 101 | + |
| 102 | +### CMake not found |
| 103 | +If you get "cmake: command not found", install CMake using your package manager as shown above. |
| 104 | + |
| 105 | +### GMP not found |
| 106 | +If CMake reports "Could NOT find GMP", ensure GMP is installed and set the path: |
| 107 | +```bash |
| 108 | +cmake .. -DGMP_ROOT=/path/to/gmp |
| 109 | +``` |
| 110 | + |
| 111 | +### Python module import error |
| 112 | +If Python can't import libadic after installation: |
| 113 | +```bash |
| 114 | +# Ensure you're using the same Python version for building and running |
| 115 | +python --version |
| 116 | +pip show libadic |
| 117 | + |
| 118 | +# Reinstall with verbose output |
| 119 | +pip install . -v |
| 120 | +``` |
| 121 | + |
| 122 | +## Next Steps |
| 123 | + |
| 124 | +- Read [MATHEMATICAL_REFERENCE.md](docs/MATHEMATICAL_REFERENCE.md) for theoretical background |
| 125 | +- See [examples/](examples/) directory for usage examples |
| 126 | +- Check [tests/](tests/) for comprehensive test cases |
| 127 | +- Review [VALIDATION_REPORT.md](docs/validation/validation_output/VALIDATION_REPORT.md) for proof of uniqueness |
0 commit comments