Home (original) (raw)

Welcome to the forge wiki!

Document Outline:

Forge Dependencies

Linux/Unix: Dependencies should be available via respective package managers.Windows: We recommend vcpkg.

Cloning Forge

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

CMake Options of Forge

CMake Options:

Options Descrition Default
BUILD_SHARED_LIBS Build Shared Library ON
CMAKE_BUILD_TYPE Set build type Release1
CMAKE_INSTALL_PREFIX Location for install target
FG_BUILD_DOCS Build documentation ON 2
FG_BUILD_EXAMPLES Build examples ON 3
FG_RENDERING_BACKEND Choice of Rendering backend OpenGL 4
FG_USE_WINDOW_TOOLKIT Choice of window toolkit glfw3 5
FG_WITH_FREEIMAGE Use Freeimage library ON 6

OS Specific Build Steps

Windows

Prerequisites

Build Steps

1. Configure

Dependency installation is also taken care of by the below cmake configure command.

cd forge mkdir build cd build cmake -G "Visual Studio 16 2019" -A x64
-DCMAKE_TOOLCHAIN_FILE="\scripts\buildsystems\vcpkg.cmake"
-DVCPKG_MANIFEST_DIR=..\vcpkg ..

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

cmake -Tv140 -G "Visual Studio 15 2017 Win64"
-DCMAKE_TOOLCHAIN_FILE="\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 thebuild\Forge.sln file in Visual Studio.

Install Dependencies

With latest master, there is no need to install dependencies manually. However, in the case your workflow is setup in such fashion do keep note of the following points.

install(FILES $<TARGET_FILE:Freetype::Freetype> ...)

Linux

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

Prerequisites

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

Fontconfig package installs freetype as it's dependency.

Build Steps

cd /path/to/dir/forge mkdir build && cd build && cmake .. 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, 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 gcc version suitable for CUDA compilation from the Arch repositories and then run the followinng commad.

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

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

OSX

The instructions are based on OSX 10.9 or later.

Prerequisites

Install Dependencies

brew install boost fontconfig freeimage glfw3

Build Steps

cd /path/to/dir/forge mkdir build && cd build && cmake .. 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, examples are installed to /usr/local/forge.

To change the install prefix use

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

Installation

Make sure you are still in build folder, then: