Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
388 views
in Technique[技术] by (71.8m points)

c++ - How to install GNU MP (GMP) in Codeblocks on Linux mint

I was able to install GMP following a tutorial using MSYS2 in Windows, however I am quite unsure of how to do the same on Linux Mint. I can't use Windows as I need to use C++17, which MSYS2 doesn't let me do because my windows is outdated, so to use C++17 I use Linux. I am using a clang compiler, but I don't know how to install GMP to use with it on Codeblocks. https://gmplib.org/

question from:https://stackoverflow.com/questions/65648379/how-to-install-gnu-mp-gmp-in-codeblocks-on-linux-mint

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Download gmp from here.

wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
unxz gmp-6.2.1.tar.xz
tar xzvf gmp-6.2.1.tar
cd gmp-6.2.1
./configure
make
sudo make install

it should be installed under /usr/local/.

The debian way: Enable the sources repositories under your /etc/apt/sources.list.d/ then install apt-src to easily build the package:

sudo apt update
sudo apt install apt-src
apt-src update
apt-src install gmp
apt-src build gmp

Next step install the *.deb file through apt, dpkg or gdebi.

Why building gmp?: because only the source package is available on debian/ubuntu derivatives (Source Package: gmp (2:6.1.2+dfsg-2) )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...