-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_pycutest
55 lines (48 loc) · 2.01 KB
/
install_pycutest
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
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Usage: bash install_pycutest
# Requirements: having Python installed via actions/setup-python.
set -e
set -x
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "PyCUTEst is not available on $RUNNER_OS" 1>&2
exit 1
elif [[ "$RUNNER_OS" == "Linux" ]]; then
# Download CUTEst and its dependencies
mkdir "$GITHUB_WORKSPACE/cutest"
git clone --depth 1 --branch v2.1.24 https://github.com/ralna/ARCHDefs.git "$GITHUB_WORKSPACE/cutest/archdefs"
git clone --depth 1 --branch v2.0.6 https://github.com/ralna/SIFDecode.git "$GITHUB_WORKSPACE/cutest/sifdecode"
git clone --depth 1 --branch v2.0.17 https://github.com/ralna/CUTEst.git "$GITHUB_WORKSPACE/cutest/cutest"
git clone --depth 1 --branch v0.5 https://bitbucket.org/optrove/sif.git "$GITHUB_WORKSPACE/cutest/mastsif"
# Set the environment variables
export ARCHDEFS="$GITHUB_WORKSPACE/cutest/archdefs"
export SIFDECODE="$GITHUB_WORKSPACE/cutest/sifdecode"
export CUTEST="$GITHUB_WORKSPACE/cutest/cutest"
export MASTSIF="$GITHUB_WORKSPACE/cutest/mastsif"
export MYARCH=pc64.lnx.gfo
{
echo "ARCHDEFS=$ARCHDEFS"
echo "SIFDECODE=$SIFDECODE"
echo "CUTEST=$CUTEST"
echo "MASTSIF=$MASTSIF"
echo "MYARCH=$MYARCH"
} >> "$GITHUB_ENV"
# Build and install CUTEst
/usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/jfowkes/pycutest/master/.install_cutest.sh)"
elif [[ "$RUNNER_OS" == "macOS" ]]; then
# Install gfortran
sudo ln -fs /usr/local/bin/gfortran-12 /usr/local/bin/gfortran
sudo ln -fs /usr/local/Cellar/gcc@12/*/lib/gcc/12/*.dylib /usr/local/lib/
# Install CUTEst
brew tap optimizers/cutest
brew install cutest --without-single
brew install mastsif
# Set the environment variables
for f in "archdefs" "sifdecode" "cutest" "mastsif"; do
while IFS= read -r line; do
echo "${line#export }" >> "$GITHUB_ENV"
done <<< "$(cat "$(brew --prefix $f)/$f.bashrc")"
done
fi
# Install PyCUTEst
echo "PYCUTEST_CACHE=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
python -m pip install --progress-bar=off pycutest