Installation of GMP, PBC, gdb under Ubuntu

1. Install GMP

1. First open the pbc user manual, if there is no manual, you can use this link: PBC English version user manualinsert image description here

2. Find the version of GMP and select the version you want to use. I am using gmp-6.2.1.tar.xz here.
insert image description here
3. If it is a windows system, you can use Xftp to upload. Here it is recommended to create a folder for storage For this library, for example, I first built a pbclibrary directory, and there are two directories below, one is gmp, and the other is pbc

#创建pbclibrary
mkdir pbclibrary
#进入目录
cd pbclibrary
#在创建gmp
mkdir gmp

4. Then upload gmp-6.2.1.tar.xz to the gmp directory

#使用解压命令
tar -zxvf gmp-6.2.1.tar.xz

5. Then enter the decompression directory and execute the following command

./configure
sudo make
sudo make check
sudo make install

6. Download related dependencies

sudo apt-get update
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install m4

Second, the installation of PBC

1. First download the pbc compressed package: PBCLibrary manual
, put it in the newly created pbc directory and decompress it

#解压命令
tar -zxvf pbc-0.5.14.tar.gz

2. Then execute the following command

./configure
make
make install

3. Verify that the PBC installation is successful

Find pbc under pbc-0.5.14 in the decompression directory, and execute it under pbc

./pbc

enter

g:=rnd(G1); 
g; 

h := rnd(G2);
h;

pairing(g,h);

a := rnd(Zr); 
b :=rnd(Zr);
pairing(g^a,g^b);


a := rnd(Zr); 
b:=rnd(Zr);
pairing(g,h)^(a*b);

insert image description here
If the above results appear, the installation is successful.

Fourth, the installation of gdb

This is used to interrupt the C code, and it can be ignored if it is not needed.

1. Download

There are two ways
1. Download through the official website, upload through Xftp, click me to download , after downloading, jump directly to Title 2 to perform the operation

2. Download directly with the command

 wget http://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.gz

2. Enter the decompressed directory and enter the following command

#解压命令
tar -zxf  gdb-12.1.tar.gz 

#进入到解压后的目录
cd  gdb-12.1/

#进入后输入以下命令,生成makefile文件
#1
./configure
#2
make
#此时make的时间较长

#3
make install

3. Check whether the installation is successful


#返回上一层
 cd ..

#查看文件版本
gdb -v


insert image description here
If the corresponding version number appears, it is successful.

Guess you like

Origin blog.csdn.net/qq_41977843/article/details/126765593