forked from crytic/echidna
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-libff.sh
More file actions
executable file
·30 lines (24 loc) · 873 Bytes
/
Copy pathinstall-libff.sh
File metadata and controls
executable file
·30 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/bash
set -eux
source .github/scripts/host.sh
if [ -f $HOME/.local/lib/libff"$EXT" ]; then
echo "libff exists, exiting..."
exit 0
fi
git clone https://github.com/scipr-lab/libff --recursive
cd libff
git submodule init && git submodule update
ARGS="-DCMAKE_INSTALL_PREFIX=$PREFIX -DWITH_PROCPS=OFF"
CXXFLAGS=""
if [ "$HOST_OS" = "macOS" ]; then
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include
export CXXFLAGS=-I/usr/local/opt/openssl/include
ARGS="$ARGS -DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include/openssl -DCURVE=ALT_BN128 -DCMAKE_INSTALL_NAME_DIR=$PREFIX/lib"
sed -i '' 's/STATIC/SHARED/' libff/CMakeLists.txt # Fix GHC segfaults from hell (idk why)
sed -i '' 's/STATIC/SHARED/' depends/CMakeLists.txt
fi
mkdir build
cd build
CXXFLAGS="-fPIC $CXXFLAGS" cmake $ARGS ..
make && make install