-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an `install-build-deps` script to replace the manual commands in the README. See commit message(s) for details. __WARNING:__ This commit is based on the commit in #4054; if you merge this it will merge that one too. (The script includes the `libunwind-dev` package added in that commit.) You'll probably want to do a quick check that this works on MacOS and update the commit message appropriately.
- Loading branch information
Showing
2 changed files
with
99 additions
and
63 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 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,85 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Install OS packages containing dependencies required to build K. | ||
# | ||
set -Eeuo pipefail | ||
|
||
die() { local ec="$1"; shift; echo "ERROR: $@"; exit $ec; } | ||
|
||
inst_Debian() { | ||
echo '===== Debian packages:' | ||
sudo apt-get install -q \ | ||
bison \ | ||
build-essential \ | ||
clang-15 \ | ||
cmake \ | ||
curl \ | ||
flex \ | ||
g++ \ | ||
gcc \ | ||
libboost-test-dev \ | ||
libfmt-dev \ | ||
libgmp-dev \ | ||
libjemalloc-dev \ | ||
libmpfr-dev \ | ||
libsecp256k1-dev \ | ||
libunwind-dev \ | ||
libyaml-dev \ | ||
libz3-dev \ | ||
lld-15 \ | ||
llvm-15-tools \ | ||
m4 \ | ||
maven \ | ||
openjdk-17-jdk \ | ||
pkg-config \ | ||
python3 \ | ||
python3-dev \ | ||
z3 \ | ||
zlib1g-dev | ||
|
||
if stack --version >/dev/null 2>&1; then | ||
echo 'Using existing Haskell Stack installation.' | ||
else | ||
echo '===== Haskell Stack:' | ||
curl -sSL https://get.haskellstack.org/ | sh | ||
fi | ||
} | ||
|
||
inst_MacOS() { | ||
echo '===== Brew packages' | ||
brew install \ | ||
bison \ | ||
boost \ | ||
cmake \ | ||
flex \ | ||
fmt \ | ||
gcc \ | ||
gmp \ | ||
openjdk \ | ||
jemalloc \ | ||
libyaml \ | ||
llvm \ | ||
make \ | ||
maven \ | ||
mpfr \ | ||
pkg-config \ | ||
python \ | ||
secp256k1 \ | ||
stack \ | ||
zlib \ | ||
z3 | ||
} | ||
|
||
try() { | ||
local command="$1"; shift | ||
local platform="$1"; shift | ||
|
||
echo "===== Checking for $command for platform $platform" | ||
$command --version >/dev/null 2>&1 || return 1 | ||
echo "----- Found platform $platform" | ||
inst_$platform | ||
} | ||
|
||
try apt-get Debian && exit 0 | ||
try brew MacOS && exit 0 | ||
die 1 'Cannot find known platform. Your system appears to be unsupported.' |