Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<nixos>' --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.