Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit e750a4c

Browse files
committed
See previous commit
1 parent 4017400 commit e750a4c

File tree

2 files changed

+49
-32
lines changed

2 files changed

+49
-32
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ It is an **API** of homomorphic binary operations such as binary comparison or b
3838

3939
| Program or Library | Requirement 1 | Requirement 2 | Requirement 3 | Requirement 4 | Requirement 5 | Requirement 6 |
4040
| ------------------ | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- |
41-
| hbc | g++ | make | HElib | c++11 |
42-
| HElib | g++ | make | git | libboost | GMP 6.1.2 | NTL 10.5.0 |
41+
| hbc | g++ | make | libboost | c++11 | HElib |
42+
| HElib | g++ | make | git | NTL 10.5.0 | GMP 6.1.2 |
4343
| NTL 10.5.0 | g++ | make | GMP 6.1.2 |
4444
| GMP 6.1.2 | g++ | make | m4 | perl |
4545

Vagrantfile

+47-30
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,71 @@ Vagrant.configure(2) do |config|
1111
vb.name = "hbc-virtual-machine"
1212
end
1313
config.vm.hostname = "hbc-hostname"
14-
config.vm.provision "shell", inline: <<-SHELL
14+
15+
config.vm.provision :shell, :run => 'always', inline: <<-SHELL
16+
echo " ===== HBC ===== Updating packages..."
1517
sudo apt-get update
1618
sudo apt-get install -y git g++ m4 perl libboost-all-dev htop
1719
sudo apt-get -y autoremove
18-
20+
1921
#Installing GMP
20-
GMP_V=6.1.2
21-
wget https://gmplib.org/download/gmp/gmp-$GMP_V.tar.bz2
22-
tar -xvjf gmp-$GMP_V.tar.bz2
23-
cd gmp-$GMP_V
24-
./configure
25-
make
26-
sudo make install
27-
make check
28-
cd ..
29-
rm -fr gmp-$GMP_V*
30-
unset GMP_V
22+
if [ ! -f "/usr/local/lib/libgmp.a" ]; then
23+
GMP_V=6.1.2
24+
echo " ===== HBC ===== Installing GMP-$GMP_V..."
25+
wget https://gmplib.org/download/gmp/gmp-$GMP_V.tar.bz2
26+
tar -xvjf gmp-$GMP_V.tar.bz2
27+
cd gmp-$GMP_V
28+
./configure
29+
make
30+
sudo make install
31+
make check
32+
cd ..
33+
rm -fr gmp-$GMP_V*
34+
unset GMP_V
35+
else
36+
echo " ===== HBC ===== GMP seems already installed. Skipping..."
37+
fi
3138
3239
#Installing NTL
33-
NTL_V=10.5.0
34-
wget http://www.shoup.net/ntl/ntl-$NTL_V.tar.gz
35-
tar -xvzf ntl-$NTL_V.tar.gz
36-
cd ntl-$NTL_V/src
37-
./configure NTL_GMP_LIP=on
38-
make
39-
sudo make install
40-
cd ../..
41-
rm -fr ntl-$NTL_V*
42-
unset NTL_V
40+
if [ ! -f "/usr/local/lib/libntl.a" ]; then
41+
NTL_V=10.5.0
42+
echo " ===== HBC ===== Installing NTL-$NTL_V..."
43+
wget http://www.shoup.net/ntl/ntl-$NTL_V.tar.gz
44+
tar -xvzf ntl-$NTL_V.tar.gz
45+
cd ntl-$NTL_V/src
46+
./configure NTL_GMP_LIP=on
47+
make
48+
sudo make install
49+
cd ../..
50+
rm -fr ntl-$NTL_V*
51+
unset NTL_V
52+
else
53+
echo " ===== HBC ===== NTL seems already installed. Skipping..."
54+
fi
4355
4456
#Installing HElib
4557
cd /vagrant
46-
if [ ! -d "HElib/src" ]; then
47-
echo "HElib/src not found; Building it again..."
48-
#rm -fr HElib
49-
git clone https://github.com/shaih/HElib.git
58+
if [ ! -f "HElib/src/fhe.a" ]; then
59+
if [ ! -d "HElib" ]; then
60+
echo " ===== HBC ===== HElib not found; Downloading and building it..."
61+
#rm -fr HElib
62+
git clone https://github.com/shaih/HElib.git
63+
else
64+
echo " ===== HBC ===== HElib found but no compiled fhe.a found. Compiling it !"
65+
fi
5066
cd HElib/src
5167
make
5268
#make check
53-
#1 of the check of HElib fails for some reason
69+
#1 of the check of HElib fails for some reason
5470
#make test
5571
cd ../..
72+
else
73+
echo " ===== HBC ===== HElib is present and is assumed to be compiled."
5674
fi
5775
5876
#Building hbc
5977
make hbc
60-
echo "hbc was successfully built ! Run it with: cd /vagrant && ./hbc"
61-
echo "colorscheme desert" > ~/.vimrc
78+
echo " ===== HBC ===== hbc was successfully built ! Run it with: cd /vagrant && ./hbc"
6279
SHELL
6380
end
6481

0 commit comments

Comments
 (0)