From e58e2d366db8cc90efd39b1880e82152b1ebef45 Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Fri, 10 Dec 2021 00:53:26 +0100 Subject: [PATCH 1/2] Add system dependency step for interpreter --- external-stg-interpreter/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/external-stg-interpreter/README.md b/external-stg-interpreter/README.md index 15ac304..d64ce3d 100644 --- a/external-stg-interpreter/README.md +++ b/external-stg-interpreter/README.md @@ -12,7 +12,11 @@ The interpreter was tested only on Linux. ``` git clone git@github.com:grin-compiler/ghc-whole-program-compiler-project.git ``` -2. Build from the interpreter's folder +2. Setup system dependencies + ``` + apt update && apt install -y pkg-config libbz2-dev + ``` +3. Build from the interpreter's folder ``` cd ghc-whole-program-compiler-project/external-stg-interpreter From a63119423e0d0cc2a5a97c16b04bf6c11527c6f0 Mon Sep 17 00:00:00 2001 From: Jappie Klooster Date: Fri, 10 Dec 2021 01:11:50 +0100 Subject: [PATCH 2/2] Add system dependencies and ghcup/cabal instructions --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e137cdd..04795bb 100644 --- a/README.md +++ b/README.md @@ -63,11 +63,43 @@ I.e. `external-stg-compiler` is such an example. If you change the External STG IR, then GHC-WPC must be recompiled. -0. Install (exact version): +0. Install system dependencies: + ``` + apt install -y \ + autoconf \ + build-essential \ + curl \ + gcc \ + git \ + libc6-dev \ + libffi-dev \ + libgmp-dev \ + libncurses-dev \ + libtinfo5 \ + python3 \ + python3-sphinx \ + wget \ + xz-utils + ``` +1. Install ghcup + ``` + curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh + ``` + +2. Install (exact version): - GHC 8.8.3 + ``` + ghcup install ghc 8.8.3 && ghcup set ghc 8.8.3 + ``` - happy 1.19.12 + ``` + cabal update && cabal install happy-1.19.12 + ``` - alex 3.2.5 -1. Clone this repository. + ``` + cabal install alex-3.2.5 + ``` +3. Clone this repository. ``` git clone --recursive git@github.com:grin-compiler/ghc-whole-program-compiler-project.git ``` @@ -75,11 +107,11 @@ If you change the External STG IR, then GHC-WPC must be recompiled. ``` git submodule update --init --recursive ``` -2. Install modpak tooling +4. Install modpak tooling ``` (cd mod-pak ; stack install) ``` -3. Compile GHC-WPC in `./ghc-wpc` folder with Hadrian (see [ghc.dev](https://ghc.dev) for details). +5. Compile GHC-WPC in `./ghc-wpc` folder with Hadrian (see [ghc.dev](https://ghc.dev) for details). ``` cd ghc-wpc ./boot @@ -88,10 +120,10 @@ If you change the External STG IR, then GHC-WPC must be recompiled. ``` **IMPORTANT:** use hadrian/build-stack -4. **At this point you have a working GHC-WPC.** +6. **At this point you have a working GHC-WPC.** The next steps are about the compilation of GHC-WPC tooling and the usage of GHC-WPC. -5. Go back to the repository top folder and set the path to the local GHC-WPC build in the corresponding part of `./stack.yaml`. +7. Go back to the repository top folder and set the path to the local GHC-WPC build in the corresponding part of `./stack.yaml`. change the following line to your GHC-WPC build path: ``` extra-path: @@ -102,12 +134,12 @@ If you change the External STG IR, then GHC-WPC must be recompiled. extra-path: - /home/USER/PROJECT/ghc-whole-program-compiler-project/ghc-wpc/_build/stage1/bin ``` -6. Install the external stg tooling with the following commands: +8. Install the external stg tooling with the following commands: ``` stack --stack-root `pwd`/.stack-root install ``` *NOTE:* the stack root is set to the local folder to prevent spamming the global stack sandbox. -7. Use `gen-exe` and `ext-stg` from terminal. *(it should be in PATH due to the stack install)* +9. Use `gen-exe` and `ext-stg` from terminal. *(it should be in PATH due to the stack install)* ## TODO **Ext-STG IR**