NTL库是C++数论库。
https://libntl.org/
一、安装MinGW
下载MinGW安装器MinGW-get-setup
根据需求选择安装的包(一定要装msys和gmp)
二、安装NTL
因为我们在win上安装了unix-like平台MinGW,所以直接参考官方Unix安装教程
下载合适版本的Unix ntl安装包
打开刚才安装的msys,进入放置安装包的文件夹,解压
gunzip ntl-xxx.tar.gz
tar xf ntl-xxx.tar
切换到src文件夹
cd ntl-xxx/src
这里我按照官方教程走出现了问题,报
-pthread does not work
参考官方文档
If you don’t want thread safety, run:
% ./configure NTL_THREADS=off
This will also turn off thread boosting (see below), and you won’t have to pass the option -pthread through to compile your programs.
运行
./configure NTL_THREADS=off
解决pthread问题
然后在当前文件夹下继续运行
make
这里报了缺少gmp包的错
回到MinGW安装GMP
make正常执行
执行
make check
稍微花一些时间,我写了这篇步骤
执行
make install