本来只想做个RSA的题,结果环境就搭了好久
首先想用
pip install gmpy2
发现缺东西,要安装gmp,mpfr,mpc
安装:
mkdir -p $HOME/src
mkdir -p $HOME/static
gmp:
sudo apt-get install libgmp-dev
mpfr:http://www.mpfr.org/mpfr-current/#download
v=4.0.2
cd $HOME/src
wget http://www.mpfr.org/mpfr-current/mpfr-${v}.tar.bz2
tar -jxvf mpfr-${v}.tar.bz2 && cd mpfr-${v}
./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static
make && make check && make install
mpc:http://www.multiprecision.org/mpc/download.html
v=1.1.0
cd $HOME/src
wget ftp://ftp.gnu.org/gnu/mpc/mpc-${v}.tar.gz
tar -zxvf mpc-${v}.tar.gz && cd mpc-${v}
./configure --prefix=$HOME/static --enable-static --disable-shared --with-pic --with-gmp=$HOME/static --with-mpfr=$HOME/static
make && make check && make install
gmpy:https://github.com/aleaxit/gmpy
v=2-2.1.0a1
cd $HOME/src
wget https://github.com/aleaxit/gmpy/releases/download/gmpy${v}/gmpy${v}.tar.gz
tar xf gmpy${v}.tar.gz && cd gmpy${v}
sudo python setup.py build_ext --static=$HOME/static install
ok