Comments Off on NTL


NTL is a C++ library for doing number theory. NTL supports arbitrary length integer and arbitrary precision floating point arithmetic, finite fields, vectors, matrices, polynomials, lattice basis reduction and basic linear algebra.

Set up the environment and version

ml gnu12 utils/gmp libs/ntl
  • Available version : 11.5.1


Use case – random number generator

mkdir Random; cd Random
wget https://latticechallenge.org/svp-challenge/download/generator.zip
unzip generator.zip
  • Set up and test
# In the <Random> directory
ml gnu12 utils/gmp libs/ntl
#===== Error message =====
g++ -g3 -O0 -Wall -static -o generate_random generate_random.cpp -lntl -lgmp -lm
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: generate_random] Error 1
# ===== Correction =====
# Remove the -static option in the compilation
g++ -g3 -O0 -Wall -o generate_random generate_random.cpp -lntl -lgmp -lm