forked from trueagi-io/hyperon-experimental
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-hyperonc.sh
executable file
·58 lines (50 loc) · 1.82 KB
/
install-hyperonc.sh
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
56
57
58
#!/bin/sh
HYPERONC_URL=https://github.com/trueagi-io/hyperon-experimental.git
HYPERONC_REV=main
while getopts 'u:r:' opt; do
case "$opt" in
u)
HYPERONC_URL="$OPTARG"
;;
r)
HYPERONC_REV="$OPTARG"
;;
?|h)
echo "Usage: $(basename $0) [-u hyperonc_repo_url] [-r hyperonc_revision]"
echo "-u hyperonc_repo_url Git repo URL to get hyperonc source code"
echo "-r hyperonc_revision Revision of hyperonc to get from Git"
exit 1
;;
esac
done
echo "hyperonc repository URL: $HYPERONC_URL"
echo "hyperonc revision: $HYPERONC_REV"
if test "$AUDITWHEEL_POLICY" = "manylinux2014"; then
yum install -y perl-devel openssl-devel zlib-devel
fi
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh
sh /tmp/rustup.sh -y && rm /tmp/rustup.sh
export PATH="${PATH}:${HOME}/.cargo/bin"
cargo install cbindgen
python3 -m pip install cmake==3.24 conan==2.5.0 pip==23.1.2
PATH="${PATH}:${HOME}/.local/bin"
conan profile detect --force
mkdir -p ${HOME}/hyperonc
cd ${HOME}/hyperonc
git init
git remote add origin $HYPERONC_URL
git fetch --depth=1 origin $HYPERONC_REV
git reset --hard FETCH_HEAD
mkdir -p ${HOME}/hyperonc/c/build
cd ${HOME}/hyperonc/c/build
# Rust doesn't support building shared libraries under musllinux environment, so musllinux is currently unsupported
CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=ON"
# Local prefix is used to support MacOSX Apple Silicon GitHub actions environment.
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${HOME}/.local"
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release"
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${HOME}/hyperonc/conan_provider.cmake"
echo "hyperonc CMake arguments: $CMAKE_ARGS"
cmake $CMAKE_ARGS ..
make
make check
make install