Skip to content
pradeep edited this page Jun 21, 2018 · 9 revisions

Welcome to the forge wiki!

Overview:

Building from Source

Clone forge repository.

$ git clone https://github.com/arrayfire/forge.git

CMake Options:

Options Descrition Default
FG_BUILD_DOCS Build documentation ON 1
FG_BUILD_EXAMPLES Build examples ON 2
FG_ENABLE_HUNTER Enable Hunter packager OFF
FG_USE_SYSTEM_CL2HPP Use system cl2.hpp header OFF
FG_USE_WINDOW_TOOLKIT Choice of window toolkit glfw3 3
FG_WITH_FREEIMAGE Use Freeimage library ON
CMAKE_BUILD_TYPE Set build type Release
  • 1 If doxygen is found.
  • 2 CPU examples are built always. CUDA & OpenCL examples are built if CUDA toolkit and OpenCL libraries are found.
  • 3 SDL2 is the only current alternative.

Windows

Prerequisites

  • Microsoft Visual Studio 2015 or later
  • CMake v3.5.1 and above
  • vcpkg (latest version)

Install Dependencies

vcpkg install --triplet x64-windows boost freeimage freetype glbinding glfw3 glm

Build Steps

1. Configure

cd forge
mkdir build
cd build
cmake -G "Visual Studio 15 2017 Win64" \
  -DCMAKE_TOOLCHAIN_FILE="<vcpkg_dir>\scripts\buildsystems\vcpkg.cmake" ..

If you are building the CUDA examples with Visual Studio 2017 (v15.5 and above), you will need to point to the v140 toolset during the configuration step:

cmake -Tv140 -G "Visual Studio 15 2017 Win64" \
  -DCMAKE_TOOLCHAIN_FILE="<vcpkg_dir>\scripts\buildsystems\vcpkg.cmake" ..

Follow the instructions from here to install v140 toolset in Visual Studio 2017.

2. Build ArrayFire

Once Forge has been configured, you may build Forge by opening the build\Forge.sln file in Visual Studio.

Linux

The instructions are based on Ubuntu 16.04. Change the packages and package manager to the distro of your choice.

Prerequisites

  • Required: gcc (>=4.7), g++, git (>=1.8), make, cmake(v3.5.1 and above)
  • Recommended: FreeImage (version 3), cmake-curses-gui
sudo apt-get install -y build-essential git cmake
sudo apt-get install -y cmake-curses-gui

Install Dependencies

sudo apt-get install -y libboost-all-dev libfontconfig1-dev libfreeimage-dev libglfw3-dev libglm-dev

Please follow instructions over here to install glbinding. Fontconfig package installs freetype as it's dependency.

Build Steps

cd /path/to/dir/forge
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8 # or number of threads of your choosing

The default installation prefix is /usr/local. That is, includes are installed to /usr/local/include, libs are installed to /usr/local/lib, tests and examples are installed to /usr/local/forge.

To change the install prefix use

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dir

NOTE: If the default gcc on your machine is gcc >= 6.1 and you will have to do the following to build CUDA examples.

For example on archlinux, you'd have to install gcc5 from the repositories and then run the followinng commad.

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dir -DCUDA_HOST_COMPILER:FILEPATH=/usr/bin/g++-5

Then run make install (use sudo to install to system directories).

OSX

The instructions are based on OSX 10.9 or later.

Prerequisites

  • Required: cmake(v3.5.1 and above)
brew install cmake

Install Dependencies

brew install boost fontconfig freeimage glfw3 glm

Build Steps

cd /path/to/dir/forge
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8 # or number of threads of your choosing

The default installation prefix is /usr/local. That is, includes are installed to /usr/local/include, libs are installed to /usr/local/lib, tests and examples are installed to /usr/local/forge.

To change the install prefix use

cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/install/dir
Clone this wiki locally