This repository contains sample batch scripts for building ArrayFire on Windows.
/dependencies_dir/acml/ifort64
.arrayfire_deps.zip
contains GLFW and FreeImage binaries for VS2015. Other versions of Visual Studio require binaries compiled with those versions.This file contains common macros. This is probably the only file that you will need to change. The variables are explained below.
Variable (in common.bat) | Description |
---|---|
WORKSPACE | Working directory |
AF_DIR | ArrayFire source code directory |
DEPS_DIR | Where the dependencies are extracted from the arrayfire_deps.zip file. Ideally workspace/dependencies |
CPU, CUDA, OPENCL | To select which backends to use, set them to ON. To deselect, set them to OFF |
UNIFIED | To select the unified backend, set it to ON. To deselect, set it to OFF |
GRAPHICS | Enable or disable building graphics. Default is off |
TESTS | ON to build tests, OFF to not build tests |
EXAMPLES | ON to build examples, OFF to not build examples |
Variable (in common.bat) | Description |
---|---|
BUILD_DIR | Build directory relative to AF_DIR |
BUILD_TYPE | Can be Release (Default), Debug, RelWithDebInfo, MinSizeRel |
MIN_BUILD_TIME | This flag removes optimization flags from Release, which gives a faster compilation time at the expense of runtime performance |
CUDA_COMPUTE_DETECT | If building on a remote machine which cannot run CUDA, set this to OFF. If OFF, atleast one CUDACOMPUTE* must be set to ON |
CUDACOMPUTE(XY) | Set these to ON for whichever computes should be added to compilation manually. |
TESTS | ON to build tests, OFF to not build tests |
EXAMPLES | ON to build examples, OFF to not build examples |
BUILD_NONFREE | To build Non-Free components such as SIFT, set this to ON. These have Non-Free licenses. |
Variable (in common.bat) | Description |
---|---|
FREEIMAGE_TYPE | Static or Dynamic library to be used. Optionally, can be set to OFF to disable FreeImage |
CPU_FFT_TYPE | FFT Library. Can be FFTW (default), ACML or MKL |
CPU_BLAS_TYPE | BLAS Library. Can be LAPACKE (default) or MKL (Optionally can be used with OpenBLAS) |
FI_DIR | FreeImage directory. Default is set to be the one from the dependency directory |
FFTW_DIR | FFTW directory. Default is set to be the one from the dependency directory |
ACML_DIR | ACML directory. Download and place ACML here. |
MKL_DIR | MKL directory. Create dependency/mkl/(include/lib/dll). See notes below. |
LAPACKE_DIR | LAPACKE directory. Default is set to be the one from the dependency directory |
GLFW_DIR | GLFW directory. Default is set to be the one from the dependency directory |
BOOST_DIR | Boost directory (only includes required). Default is set to be the one from the dependency directory |
These are system executables. As long as they are installed to the default paths, they should work fine.
Variable (in common.bat) | Description |
---|---|
THREADS | No. of logical processors to dedicate to parallel builds |
GIT_EXE | Git executable |
CMAKE | CMake executable |
CMAKE_GENERATOR | Visual Studio 2013 Win64 generator option |
CTEST | ctest executable |
The example below assume that C:\workspace is the working directory. That is, WORKSPACE=C:\workspace
# Using Git Shell
cd C:\workspace
git clone --recursive -b devel https://github.com/arrayfire/arrayfire.git arrayfire
git clone https://github.com/shehzan10/arrayfire-windows-scripts.git scripts
wget http://ci.arrayfire.org/userContent/arrayfire_deps.zip
unzip arrayfire_deps.zip
cp -r scripts\*.bat .\
.\rebuild_arrayfire.bat clean ## Use clean option when running first time or when doing a clean build
If you have Intel MKL available, you can use it to build ArrayFire. To setup MKL for ArrayFire, follow the steps:
fftw3.h, mkl_blas.h, mkl_cblas.h, mkl_lapacke.h, mkl_types.h, mkl_spblas.h
into mkl/includemkl_core_dll.lib, mkl_rt.lib
into mkl/libmkl_core.dll, mkl_rt.dll, mkl_intel_thread.dll
into mkl/binThis will allow you to use the default setup in the build scripts. You may choose not to copy these, but then will have to configure common.bat to set it up correctly.