Created
December 22, 2020 02:03
-
-
Save rnbguy/a2df19e786b408e182186415d5745ce7 to your computer and use it in GitHub Desktop.
ERAN on Alpine (ETH Robustness Analyzer for Neural Networks)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ash | |
# set -e | |
git clone --depth 1 https://github.com/eth-sri/ERAN.git | |
cd ERAN | |
has_cuda=0 | |
while : ; do | |
case "$1" in | |
"") | |
break;; | |
-use-cuda|--use-cuda) | |
has_cuda=1;; | |
*) | |
echo "unknown option $1, try -help" | |
exit 2;; | |
esac | |
shift | |
done | |
git clone https://github.com/cddlib/cddlib.git | |
cd cddlib | |
./bootstrap | |
libtoolize | |
./bootstrap | |
./configure | |
make | |
make install | |
cd .. | |
wget https://packages.gurobi.com/9.0/gurobi9.0.3_linux64.tar.gz | |
tar -xf gurobi9.0.3_linux64.tar.gz | |
cd gurobi903/linux64/src/build | |
sed -ie 's/^C++FLAGS =.*$/& -fPIC/' Makefile | |
make | |
cp libgurobi_c++.a ../../lib/ | |
cp ../../lib/libgurobi90.so /usr/lib | |
cd ../.. | |
python3 setup.py install | |
cd ../.. | |
rm gurobi9.0.3_linux64.tar.gz | |
export GUROBI_HOME="$(pwd)/gurobi903/linux64" | |
export PATH="${PATH}:${GUROBI_HOME}/bin" | |
export CPATH="${CPATH}:${GUROBI_HOME}/include" | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:${GUROBI_HOME}/lib | |
git clone https://github.com/eth-sri/ELINA.git | |
cd ELINA | |
if test "$has_cuda" -eq 1 | |
then | |
./configure -use-cuda -use-deeppoly -use-gurobi -use-fconv | |
else | |
./configure -use-deeppoly -use-gurobi -use-fconv | |
fi | |
make | |
make install | |
cd .. | |
git clone https://github.com/eth-sri/deepg.git | |
cd deepg/code | |
mkdir build | |
make shared_object | |
cp ./build/libgeometric.so /usr/lib | |
cd ../.. | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/lib | |
wget https://files.sri.inf.ethz.ch/eran/nets/tensorflow/mnist/mnist_relu_3_50.tf | |
ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine | |
RUN apk update --no-cache | |
RUN apk add --no-cache git wget build-base automake autoconf libtool mpfr-dev gmp-dev m4 python3 texlive texlive-dvi | |
WORKDIR /root | |
ADD ./alpine-install.sh ./alpine-install.sh | |
RUN ash ./alpine-install.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment