From 8a847048182cf8f936956011cdebc76b54a2bf0d Mon Sep 17 00:00:00 2001 From: hapqe Date: Fri, 30 Aug 2024 11:45:10 +0200 Subject: [PATCH 1/2] Fixing GHC version (to 8.10.7) and adding the required Cabal version. Since commit b174a7f, the GHC version is 8.10.7 and the Cabal version is 3.4. This is now reflected in the GettingStarted.md file. --- GettingStarted.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GettingStarted.md b/GettingStarted.md index d22c141..b08f2a0 100644 --- a/GettingStarted.md +++ b/GettingStarted.md @@ -20,7 +20,7 @@ of macOS Big Sur (11.5.2) on 2021-08-21. `ghcup`. You may need to run the install command twice, the second time after being prompted to install the XCode command line tools. Instructions will be displayed in the terminal. You may need to use `ghcup tui` to - select an appropriate GHC version (GHC 8.10.5). + select an appropriate GHC version (GHC 8.10.7) and Cabal version (Cabal 3.4). 1. Install the [Homebrew](https://brew.sh/) package manager. @@ -81,7 +81,7 @@ of Windows 10 on 2021-08-21. 1. Install the [Haskell toolchain](https://www.haskell.org/ghcup/) using `ghcup`. `HLS` and `Stack` are optional installations, but make sure to install `MSys2`. You may need to use `ghcup tui` to select an appropriate - GHC version (GHC 8.10.5). + GHC version (GHC 8.10.7) and Cabal version (Cabal 3.4). 1. Install the [Chocolatey](https://chocolatey.org/) package manager. @@ -166,7 +166,7 @@ These instructions were tested manually in a fresh installation of Ubuntu Linux 1. Install the [Haskell toolchain](https://www.haskell.org/ghcup/) using `ghcup`. You may need to use `ghcup tui` to select an appropriate GHC - version (GHC 8.10.5). + version (GHC 8.10.7) and Cabal version (Cabal 3.4). ### Build and Run an Example From c416debffdfe892bd5a8cb3a935a6e55fa5390d5 Mon Sep 17 00:00:00 2001 From: hapqe Date: Fri, 30 Aug 2024 12:13:42 +0200 Subject: [PATCH 2/2] Added fixes MacOS-related problems into GettingStarted.md The MacOs section now lists some potential fixes for issues that could arrise. --- GettingStarted.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/GettingStarted.md b/GettingStarted.md index b08f2a0..505bf10 100644 --- a/GettingStarted.md +++ b/GettingStarted.md @@ -61,6 +61,37 @@ of macOS Big Sur (11.5.2) on 2021-08-21. cabal run triangle ``` +### Potential Fixes (tested on an M3 MacBook Pro) + + 1. Install the correct LLVM version + + If you face the following error during the build-process: + + ```sh + : error: + Warning: Couldn't figure out LLVM version! + Make sure you have installed LLVM between [9 and 13) + ghc: could not execute: opt + cabal: Failed to build wgpu-raw-hs-0.4.0.0 (which is required by + exe:triangle-glfw from wgpu-hs-0.4.0.0). + ``` + + You need to make sure the correct LLVM version is installed. It can be installed with: + + ```sh + brew install llvm@12 + # make sure to add it to your path: + export PATH=$PATH:/opt/homebrew/opt/llvm@12/bin/ + ``` + + 1. Add the Dylib to correct path: + + If you are still getting a linking error, try adding it to `DYLD_LIBRARY_PATH` instead of `LD_LIBRARY_PATH`: + + ```sh + export DYLD_LIBRARY_PATH=$(pwd)/wgpu-raw-hs-codegen/wgpu-native/target/debug/:$DYLD_LIBRARY_PATH + ``` + ![triangle demo](triangle-demo.png) ## Microsoft Windows