Build Instructions for Windows
Overview:
We recommend using vcpkg to install necessary dependencies for each of ArrayFire's backends: CPU, CUDA, and OpenCL.
All backends require FreeImage >= 3.16.
vcpkg install --triplet x64-windows freeimage
vcpkg install --triplet x64-windows glfw3 freetype
Using freetype installed using the above command is sufficient for developement purposes.
- Graphics support is enabled at runtime depending on availability of forge and respective dependencies.
- For development purposes, forge can be built as part of ArrayFire build using the cmake option
AF_BUILD_FORGE
. - Forge, our high-performance visualization library, is automatically downloaded and built as an external project by CMake.
- GLFW (>= 3.0.4)
vcpkg install --triplet x64-windows freeimage openblas fftw3
- Alternative BLAS libraries: MKL and LAPACKE
- Alternative FFT libraries: MKL and ACML 6.1 iFortran (known to fail FFT tests)
vcpkg install --triplet x64-windows boost freeimage
In addition to Boost (>= v1.51) and FreeImage, you will also need:
- Latest CUDA drivers. Note: There are known issues with 37x drivers.
- CUDA Toolkit >= 9.0
- Note: Visual Studio 2017 (v15.5 and above) comes with platform toolset v141,
which NVCC does not support as of v9.1.
- Follow these instructions to install the v140 platform toolset.
- Follow the build instructions below to configure the project to point to the v140 toolset.
Required: Install oneAPI Base Toolkit with compiler and libraries.
Once the toolkit is installed, enable necessary paths to all compilers and libraries by running the setvars script. For example:
"C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
Building the oneAPI backend requires setting the AF_BUILD_ONEAPI=1
CMake option since the oneAPI backend is disabled by default.
vcpkg install --triplet x64-windows boost freeimage openblas
In addition to Boost (>= v1.48), FreeImage, and a host-side BLAS library (openblas, in this instance), you will also need to install one of the available OpenCL SDKs along with Python 2.
- Available OpenCL SDKs:
- CUDA Toolkit >= 7.0
- AMDAPPSDK >= 2.9
- Intel OpenCL SDK >= 4.4
- Python 2
Note: clBLAS, clFFT and Boost.Compute are automatically downloaded and built by CMake.
1. Configure ArrayFire
cd arrayfire
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 backend 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" ..
Consult with the "CUDA backend" section above for how to download and install the v140 toolset in Visual Studio 2017.
2. Build ArrayFire
Once ArrayFire has been configured, you may build ArrayFire by opening the
build\ArrayFire.sln
file in Visual Studio.
Our Using ArrayFire on Microsoft Windows with Visual Studio details how to setup a development environment with ArrayFire projects.
-
Boost
- Version 1.71 is known to have build issues when using Visual Studio 2019 version. Kindly upgrade boost to 1.72 which has the fix for this compilation error.
- The ArrayFire Community
-
Getting ArrayFire
- Installers
- Installing via Package Managers
- Source
- Using ArrayFire on
- Building from Source
- Linux
- OSX
- Windows
- Building Dependencies
- Known Issues
- Contributing Code to ArrayFire
- Development Guidelines
- Recognition