File size: 1,162 Bytes
de93bc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -euxo pipefail

python -m ipykernel install --user --name ssp --display-name "Python (ssp)"

# Pick the active environment prefix in Binder
PREFIX="${CONDA_PREFIX:-${NB_PYTHON_PREFIX:-}}"
if [ -z "${PREFIX}" ]; then
  PREFIX="$(python -c 'import sys, os; print(os.path.dirname(os.path.dirname(sys.executable)))')"
fi
echo "Using PREFIX=${PREFIX}"

if [ ! -d "StochasticCIL" ]; then
  git clone https://github.com/epapoutsellis/StochasticCIL.git
fi

cd StochasticCIL
git fetch --all --tags
git checkout svrg

# Ensure annotated tag for `git describe`
git config user.email "binder@local"
git config user.name "Binder Build"

if git rev-parse -q --verify refs/tags/v1.0 >/dev/null; then
  if [ "$(git cat-file -t v1.0)" != "tag" ]; then
    git tag -d v1.0
    git tag -a v1.0 -m "Version 1.0"
  fi
else
  git tag -a v1.0 -m "Version 1.0"
fi

mkdir -p build
cd build

cmake ../ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
  -DCONDA_BUILD=OFF \
  -DCMAKE_BUILD_TYPE=Release \
  -DLIBRARY_LIB="${PREFIX}/lib" \
  -DLIBRARY_INC="${PREFIX}" \
  -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
  -DPython_EXECUTABLE="${PREFIX}/bin/python"

make -j"$(nproc)"
make install