-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from imitator-model-checker/develop
Develop
- Loading branch information
Showing
777 changed files
with
58,742 additions
and
34,180 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,76 @@ | ||
# PPL version | ||
PPL_VERSION=1.2 | ||
#!/bin/bash | ||
|
||
# Patches folder | ||
PATCH_FOLDER="${GITHUB_WORKSPACE}/.github/patches" | ||
set -a | ||
|
||
if [[ "$RUNNER_OS" = "Linux" ]]; then | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq wget unzip curl build-essential g++ m4 ocaml-native-compilers camlp4-extra ocaml oasis ocaml-findlib \ | ||
libextlib-ocaml libextlib-ocaml-dev libfileutils-ocaml-dev \ | ||
libgmp-dev libgmp-ocaml libgmp-ocaml-dev libmpfr-dev \ | ||
libppl-dev \ | ||
graphviz plotutils | ||
# check OS | ||
case $(uname) in | ||
'Linux') | ||
RUNNER_OS='Linux' | ||
;; | ||
'Darwin') | ||
RUNNER_OS='macOS' | ||
;; | ||
*) | ||
echo "This script only supports Linux or OSX" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
if [[ "$DISTRIBUTED" = "True" ]]; then | ||
sudo apt-get install -qq openmpi-bin openmpi-common libopenmpi-dev | ||
# ignore sudo commands when the user is root | ||
sudo() { | ||
[[ $EUID = 0 ]] || set -- command sudo "$@" | ||
"$@" | ||
} | ||
|
||
# installing version without Bytes package | ||
git clone https://github.com/xavierleroy/ocamlmpi | ||
(cd ocamlmpi; git reset --hard c6eaf91; make clean; make MPIINCDIR=/usr/lib/openmpi/include; make opt; sudo make install) | ||
rm -rf ocamlmpi | ||
# script folder | ||
if [ -z "${GITHUB_WORKSPACE}" ]; then | ||
SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
PATCH_FOLDER="$(dirname $SCRIPT_FOLDER)/patches" | ||
ROOT_FOLDER="$(dirname $(dirname $SCRIPT_FOLDER))" | ||
cd "$ROOT_FOLDER" | ||
else | ||
SCRIPT_FOLDER="${GITHUB_WORKSPACE}/.github/scripts" | ||
PATCH_FOLDER="${GITHUB_WORKSPACE}/.github/patches" | ||
fi | ||
|
||
# Installting Bytes Package | ||
git clone https://github.com/chambart/ocaml-bytes.git | ||
(cd ocaml-bytes; ./configure --prefix=/usr --libdir=/usr/lib/ocaml/; make; sudo make install) | ||
rm -rf ocaml-bytes | ||
fi | ||
# install dependencies | ||
if [[ "$RUNNER_OS" = "Linux" ]]; then | ||
DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq wget unzip curl build-essential libtinfo-dev g++ m4 opam python3 \ | ||
libgmp-dev libmpfr-dev libppl-dev \ | ||
graphviz plotutils | ||
elif [[ "$RUNNER_OS" = "macOS" ]]; then | ||
brew install opam gmp plotutils ppl | ||
|
||
# install opam and ocaml libraries | ||
opam init -a | ||
opam install -y extlib fileutils oasis | ||
eval $(opam env) | ||
|
||
# install mlgmp | ||
git clone https://github.com/monniaux/mlgmp.git && cd mlgmp | ||
git apply "${PATCH_FOLDER}/gmp.patch" | ||
make && sudo make install && cd .. | ||
rm -rf mlgmp | ||
sudo cp METAS/META.gmp $(opam var lib)/gmp/META | ||
brew install opam gmp ppl graphviz plotutils | ||
fi | ||
|
||
# installing PPL | ||
wget -q --no-check-certificate https://www.bugseng.com/products/ppl/download/ftp/releases/${PPL_VERSION}/ppl-${PPL_VERSION}.zip | ||
unzip -qq ppl-${PPL_VERSION}.zip | ||
# python fix | ||
[ ! -x "$(command -v python)" ] && sudo ln -s $(which python3) "/usr/bin/python" | ||
|
||
cd ppl-${PPL_VERSION} | ||
if [[ "$RUNNER_OS" = "Linux" ]]; then | ||
./configure --prefix=/usr | ||
elif [[ "$RUNNER_OS" = "macOS" ]]; then | ||
# patch clang | ||
patch -p0 < "${PATCH_FOLDER}/clang5.patch" | ||
# install opam and ocaml libraries | ||
[[ ${DOCKER_RUNNING} ]] && opam init -a --disable-sandboxing || opam init -a | ||
|
||
# compile ppl | ||
./configure --prefix=$(opam var prefix) --with-mlgmp=$(opam var lib)/gmp --disable-documentation --enable-interfaces=ocaml | ||
make | ||
fi | ||
cd interfaces/OCaml && make -j 4 && sudo make install && cd ../../.. | ||
rm -rf ppl-${PPL_VERSION}* | ||
opam install -y extlib fileutils oasis alcotest | ||
eval $(opam env) | ||
|
||
# Build IMITATOR | ||
if [[ "$RUNNER_OS" = "Linux" ]]; then | ||
sudo cp METAS/META.ppl /usr/lib/ocaml/METAS/ | ||
elif [[ "$RUNNER_OS" = "macOS" ]]; then | ||
# patch oasis | ||
patch -p0 < "${PATCH_FOLDER}/oasis-config.patch" | ||
# install mlgmp | ||
[ ! -d "$(opam var lib)/gmp" ] && bash "${SCRIPT_FOLDER}/install-mlgmp.sh" | ||
|
||
# patch ppl META file | ||
patch -p0 < "${PATCH_FOLDER}/META.ppl.patch" | ||
# instal ppl | ||
[ ! -d "$(opam var lib)/ppl" ] && bash "${SCRIPT_FOLDER}/install-ppl.sh" | ||
|
||
echo $(ls -al) | ||
sudo cp METAS/META.ppl $(opam var lib)/ppl/META | ||
# patch oasis for OSX | ||
if [[ "$RUNNER_OS" = "macOS" ]]; then | ||
patch -p0 <"${PATCH_FOLDER}/oasis-config.patch" | ||
fi | ||
|
||
platform=`echo "${RUNNER_OS}" | awk '{print tolower($1)}'` | ||
tag="${GITHUB_REF_NAME##*/}" | ||
if [[ "$DISTRIBUTED" = "True" ]]; then | ||
sh build-patator.sh | ||
cd bin | ||
mv "patator" "patator-${tag}-${platform}-amd64" | ||
else | ||
sh build.sh | ||
# Build IMITATOR | ||
dune build | ||
|
||
# rename artefact | ||
if [ ! -z "${GITHUB_WORKSPACE}" ]; then | ||
cd bin | ||
platform=$(echo "${RUNNER_OS}" | awk '{print tolower($1)}') | ||
tag="${GITHUB_REF_NAME##*/}" | ||
mv "imitator" "imitator-${tag}-${platform}-amd64" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# clone mlgmp from github | ||
git clone https://github.com/monniaux/mlgmp.git && cd mlgmp | ||
|
||
# apply patch for Ocaml > 4.05.0 | ||
git apply "${PATCH_FOLDER}/gmp.patch" | ||
|
||
# compile and install | ||
make && make install && cd .. | ||
rm -rf mlgmp | ||
|
||
# copy META file | ||
cp METAS/META.gmp "$(opam var lib)/gmp/META" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# PPL version | ||
PPL_VERSION=1.2 | ||
|
||
# download PPL | ||
wget -q --no-check-certificate https://www.bugseng.com/products/ppl/download/ftp/releases/${PPL_VERSION}/ppl-${PPL_VERSION}.zip | ||
unzip -qq ppl-${PPL_VERSION}.zip | ||
|
||
cd ppl-${PPL_VERSION} | ||
|
||
# Patch clang for OSX | ||
if [[ "$RUNNER_OS" = "macOS" ]]; then | ||
# patch clang | ||
patch -p0 <"${PATCH_FOLDER}/clang5.patch" | ||
EXTRA_ARGS="--with-gmp=$(brew --prefix)" | ||
fi | ||
|
||
# compile ppl | ||
./configure --prefix=$(opam var prefix) --with-mlgmp=$(opam var lib)/gmp ${EXTRA_ARGS} --disable-documentation --enable-interfaces=ocaml | ||
|
||
# compile Ocaml interface | ||
cd interfaces/OCaml && make -j 4 && make install && cd ../../.. | ||
rm -rf ppl-${PPL_VERSION}* | ||
|
||
# copy META file | ||
cp METAS/META.ppl "$(opam var lib)/ppl/META" |
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
Oops, something went wrong.