From 32f6c3943454b0491507c5bae898561756dd8679 Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Tue, 22 Nov 2022 16:45:47 +0100 Subject: [PATCH 1/2] Restrict vcpkg installation script to only work on Linux 64-bit architectures --- INSTALL.md | 42 ++++++++++++++++++++++++++++++++++++++++-- scripts/vcpkg.sh | 7 +++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 114c9eb88..e8c73ec26 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -20,11 +20,30 @@ export PKG_CONFIG_PATH="_OpenSSL_prefix_/lib/pkgconfig:$PKG_CONFIG_PATH" ```shell $ git clone https://github.com/Microsoft/vcpkg.git /path/to/vcpkg $ cd /path/to/vcpkg && git checkout 2022.09.27 && ./bootstrap-vcpkg.sh - $ cd /path/to/scilla + ``` + +- Set the following environment variables: + + ```shell $ export VCPKG_ROOT=/path/to/vcpkg - $ $VCPKG_ROOT/vcpkg install --triplet x64-linux-dynamic $ export PKG_CONFIG_PATH="/path/to/scilla/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH" ``` + +When building Scilla on Ubuntu systems the relevant vcpkg files are +automatically installed in the directory +/path/to/scilla/vcpkg_installed. For other operating systems the vcpkg +files must be generated manually before building Scilla by running the command + + ```shell + $ cd /path/to/scilla & path/to/vcpkg/vcpkg install --triplet + ``` + +Please see the vcpkg documentation at + +https://vcpkg.io/en/docs/README.html + +for more information. + ## OS-specific setup for building Scilla @@ -111,6 +130,25 @@ ulimit -n 1024 After you have proceeded with installation if an error with regards to `version` file during `make` occurs, see [here](https://github.com/Zilliqa/scilla/wiki/macOS-troubleshooting) for the solution. +vcpkg + +The command for vcpkg installation depends on the underlying chipset. + +For ARM-based architectures use + + ```shell + $ cd /path/to/scilla & path/to/vcpkg/vcpkg install --triplet arm64-osx-dynamic + ``` + +For Intel-based architectures use + + ```shell + $ cd /path/to/scilla & path/to/vcpkg/vcpkg install --triplet x64-osx-dynamic + ``` + +Please note that building Scilla using vcpkg on MacOS is still experimental. + +
Nix and NixOS diff --git a/scripts/vcpkg.sh b/scripts/vcpkg.sh index 2479da10e..3236b01bd 100755 --- a/scripts/vcpkg.sh +++ b/scripts/vcpkg.sh @@ -39,6 +39,13 @@ then exit 0 fi +# If not on a linux 64-bit system, exit early. +if ! uname -a | grep "Linux" | grep "x86_64" +then + echo "Found non-Linux 64-bit system. Please run 'vcpkg install' manually." + exit 0 +fi + echo "Installing vcpkg" if ! "$VCPKG_ROOT"/vcpkg install --triplet x64-linux-dynamic then From bb72ca87813ff343c211a3a07c2286d046164aeb Mon Sep 17 00:00:00 2001 From: Jacob Johannsen Date: Wed, 23 Nov 2022 00:50:17 +0100 Subject: [PATCH 2/2] Exit with error when running vcpkg.sh on non-Linux system --- scripts/vcpkg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vcpkg.sh b/scripts/vcpkg.sh index 3236b01bd..b1ee733ac 100755 --- a/scripts/vcpkg.sh +++ b/scripts/vcpkg.sh @@ -43,7 +43,7 @@ fi if ! uname -a | grep "Linux" | grep "x86_64" then echo "Found non-Linux 64-bit system. Please run 'vcpkg install' manually." - exit 0 + exit 1 fi echo "Installing vcpkg"