2020-11-10 03:15:02 +08:00
|
|
|
#!/bin/bash
|
2020-12-25 01:41:01 +08:00
|
|
|
##===- utils/get-capnp.sh - Install CapnProto ----------------*- Script -*-===##
|
|
|
|
#
|
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
#
|
|
|
|
# This script downloads, compiles, and installs CapnProto into $/ext
|
|
|
|
# Cap'nProto is use by ESI cosim aka Elastic Silicon Interfaces cosimulation as
|
|
|
|
# a message format and RPC client/server.
|
|
|
|
#
|
2021-03-10 11:56:59 +08:00
|
|
|
# It will also optionally install pycapnp.
|
|
|
|
#
|
2020-12-25 01:41:01 +08:00
|
|
|
##===----------------------------------------------------------------------===##
|
2020-11-10 03:15:02 +08:00
|
|
|
|
2021-03-10 11:56:59 +08:00
|
|
|
echo "Do you wish to install pycapnp? Cosim integration tests require pycapnp."
|
|
|
|
read -p "Yes to confirm: " yn
|
|
|
|
case $yn in
|
2021-04-01 09:51:58 +08:00
|
|
|
[Yy]* ) pip3 install pycapnp;;
|
2021-03-10 11:56:59 +08:00
|
|
|
* ) echo "Skipping.";;
|
|
|
|
esac
|
|
|
|
|
2021-04-01 09:51:58 +08:00
|
|
|
mkdir -p "$(dirname "$BASH_SOURCE[0]")/../ext"
|
2020-11-10 03:15:02 +08:00
|
|
|
EXT_DIR=$(cd "$(dirname "$BASH_SOURCE[0]")/../ext" && pwd)
|
|
|
|
CAPNP_VER=0f1bf4fce79923fb4974aa55a53e26450f83f286
|
2021-03-10 11:56:59 +08:00
|
|
|
echo "Installing capnproto..."
|
2020-11-10 03:15:02 +08:00
|
|
|
|
|
|
|
echo $EXT_DIR
|
|
|
|
cd $EXT_DIR
|
|
|
|
|
|
|
|
git clone https://github.com/capnproto/capnproto.git
|
|
|
|
cd capnproto
|
|
|
|
git checkout $CAPNP_VER
|
|
|
|
cd c++
|
|
|
|
autoreconf -i
|
|
|
|
./configure --prefix=$EXT_DIR
|
2021-03-10 11:56:59 +08:00
|
|
|
make -j$(nproc)
|
2020-11-10 03:15:02 +08:00
|
|
|
make install
|
|
|
|
cd ../../
|
2021-03-10 11:56:59 +08:00
|
|
|
|
|
|
|
echo "Done."
|