From bf931e9ba969ff2798ffdd0279e1d4d0c3f1159e Mon Sep 17 00:00:00 2001 From: Uma Zalakain Date: Fri, 8 Jan 2021 20:31:43 +0000 Subject: [PATCH] Add some installation instructions --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 16eb85aa2..bfe76d34e 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,42 @@ Prerequisits: Java 8+ SDK, `git` 4. Download IDEA IntelliJ (http://www.jetbrains.com/idea/) and choose to install the Scala Plugin during setup. 5. Launch IntelliJ. From the menu choose `File` -> `Open...`. Then, select `$SHINE_ROOT` and press `OK`. 6. From the menu bar choose `Run` -> `Edit Configurations...`. Under `Templates` choose `ScalaTest` and add the following line to `VM parameters`: `-Djava.library.path=lib/executor/lib/Executor/build -Xss26m` (this will tell IntelliJ where to find the Executor library and use 26MB of thread stack size which is needed for arithmetic simplifactions sometimes). + +#### Dependencies and linking to OpenCL + +##### On NixOS: + +1. Add `pkgs.intel-ocl` to `hardware.opengl.extraPackages` and `nixos-rebuild`. + Running `nix-shell -p clinfo --run clinfo` should show OpenCL support. +2. You will need `sbt`, `cmake` and `gcc` to compile the project: `nix-env -iA nixos.sbt nixos.cmake nixos.gcc`. +3. You will need `clang` to run some of the tests, however some utilities clash with `gcc`s, so we need to: + ``` + nix-env --set-flag priority 15 gcc-wrapper # give gcc less priority + nix-env -iA nixos.clang # install clang + ``` +4. Help `FindOpenCL` find the OpenCL library in NixOS: + ``` + export LD_LIBRARY_PATH="${nix-build '' --no-build-output ocl-icd}/lib/:$LD_LIBRARY_PATH" + sbt compile + ``` + (From now on `sbt compile` does not need to be told where the OpenCL bindings are.) +5. We can now run the tests with `sbt test`. + +##### On Debian: + +1. Install Portable OpenCL: `apt-get install pocl` +2. Install the build dependencies: + ``` + apt-get install cmake software-properties-common g++ clang-7 libxtst6 libxrender1 libxext6 + ln -s /usr/bin/clang-7 /usr/bin/clang + ln -s /usr/bin/clang-cpp-7 /usr/bin/clang++ + ``` +3. Compile with `sbt compile` and test with `sbt test`. + + +##### As a Docker image + +You can find the build file for a Docker image here: +https://github.com/michel-steuwer/docker-scala-opencl + +Note that AMD's SDK is stored with git lfs, so you will have to download it after checking out the repository.