-
Notifications
You must be signed in to change notification settings - Fork 47
Home
Welcome to the forge wiki!
Overview:
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.
vcpkg install --triplet x64-windows boost freeimage freetype glbinding glfw3 glm
Using freetype installed using the above command is sufficient for developement purposes. However, if the intention behind building forge is to create a custom package(using cpack
), then we recommend using a static version of freetype that can be installed in vcpkg using the instructions from this page.
As of writing this page, there is an issue with freetype (dynamic library version) provided by vcpkg when we do the following
install(FILES $<TARGET_FILE:Freetype::Freetype> ...)
freetype link-library(lib file) is installed instead of the dll file. Until this is fixed upstream, the above mentioned work around can be employed to correctly package forge usign cpack
.
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.
The instructions are based on Ubuntu 16.04. Change the packages and package manager to the distro of your choice.
- 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
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.
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).
The instructions are based on OSX 10.9 or later.
- Required: cmake(v3.5.1 and above)
brew install cmake
brew install boost fontconfig freeimage glbinding glfw3 glm
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