This code and following instruction is tested on Ubuntu 20.04, with g++ 9.4 and CMake 3.24.
git clone https://github.com/dujiajun/PSU
cd PSU
git clone https://github.com/osu-crypto/libOTe
cd libOTe
git checkout 3a40823f0507710193d5b90e6917878853a2f836
git clone https://github.com/ladnir/cryptotools
cd cryptotools
git checkout 4a83de286d05669678364173f9fdfe45a44ddbc6
cd ..
# in PSU/libOTe
python build.py --setup --boost --relic
Using CMake Preset is to store multi-platform libraries in single directories.
Make sure you enables Use CMakePresets.json to drive CMake configure, build, and test in Visual Studio settings.
- Open
libOTe
folder with Visual Studio. VS will automatically createCMakePresets.json
file. - Modify the
CMakePresets.json
, adding following items tocacheVariables
"ENABLE_NP": "ON",
"ENABLE_KOS": "ON",
"ENABLE_IKNP": "ON",
"ENABLE_SILENTOT": "ON",
"ENABLE_RELIC": "ON"
- Click Build - Install libOTe menu.
Choose a place to store compiled headers and static libraries, denoted by /path_to_PSU/libOTe/out/install/linux
. If empty, it will be installed in /usr/local
.
cd libOTe
python build.py --install=/path_to_PSU/libOTe/out/install/linux -- -D ENABLE_RELIC=ON -D ENABLE_NP=ON -D ENABLE_KOS=ON -D ENABLE_IKNP=ON -D ENABLE_SILENTOT=ON
If you change the install dir, do not forget to modify relevant directories in PSU's CMakeLists.txt
.
- Open
PSU
folder with VS. - Modify the
CMakePresets.json
, adding following item tocacheVariables
"PRESET_NAME": "${presetName}"
- Click Build - Build All Menu.
Set the variable PRESET_NAME
(If install dir is /path_to_PSU/libOTe/out/install/linux
, PRESET_NAME
will be linux
) or modify CMakeLists.txt
.
mkdir build # in PSU dir
cd build
cmake .. -D PRESET_NAME=linux
make -j