Skip to content

Multi OS Building Instructions

gcielniak edited this page Feb 9, 2019 · 6 revisions

Tutorials

To build the tutorials you will first need to setup your environment - see instructions below for your OS. In addition to your compiler, you will need: Git, CMake, OpenCL and Boost.

When the environment is ready, follow these instructions:

  • clone repository git clone https://github.com/gcielniak/OpenCL-Tutorials.git
  • change the branch to multi_os git checkout multi_os
  • build: mkdir build & cd build, cmake .., make

Each tutorial has a separate directory with executables, kernels and other files.

Environment Setup

Windows

Tested on Windows 10.

  • Tools

  • OpenCL

  • Boost

    • download the latest Windows binaries and install to the default directory (e.g. C:\local). You will need to choose the right version for your VS: e.g. boost_1_69_0-msvc-14.1-64.exe for VS2017.
    • add environmental variables so that CMake can locate your Boost installation: setx BOOST_INCLUDEDIR C:\local\boost_1_69_0 and setx BOOST_LIBRARYDIR C:\local\boost_1_69_0\lib64-msvc-14.1. This will need to be modified if you use a different version of Boost or VS.

Linux

Tested on a mint Ubuntu 16.04, desktop version.

  • Tools

    • install Git and CMake: sudo apt-get install git cmake
  • OpenCL

    • install development files: sudo apt-get install ocl-icd-opencl-dev
  • Boost

    • install a Boost version containing the Compute library (has to be >= 1.61)
      • download sources: wget -O boost_1_69_0.tar.gz https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
      • unpack tar xzvf boost_1_69_0.tar.gz
      • build cd boost_1_69_0, ./bootstrap.sh --prefix=/usr/local and ./b2. You can use ./b2 -j number_of_cores for faster compilation.
      • and install sudo ./b2 install
    • add environmental variables so that CMake can locate your new Boost installation: BOOST_INCLUDEDIR=/usr/local/include, BOOST_LIBRARYDIR=/usr/local/lib.

macOS

Tested on OS X El Captain. OpenCL is already installed on macOS.

  • Tools

    • install Homebrew package manager: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)". More info on what Homebrew is.
    • install Git and CMake using Hombebrew : brew install git cmake
  • Boost

    • install Boost using Homebrew: brew install boost
Clone this wiki locally