arrayfire / arrayfire-windows-scripts

Batch Scripts for Building ArrayFire on Windows
BSD 3-Clause "New" or "Revised" License
11 stars 6 forks source link

Build ArrayFire on Windows

This repository contains sample batch scripts for building ArrayFire on Windows.

Index

Source Requirements

Software Requirements

How to use the scripts

common.bat

This file contains common macros. This is probably the only file that you will need to change. The variables are explained below.

Variables you will likely need to change

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

Variables you may want to change but do not need to

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.

Dependency Variables - Do not need to be changed

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

Variables you most likely will not need to change

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

rebuild_arrayfire.bat

build_arrayfire.bat

run_test.bat

run_single_test.bat

run_example.bat

Building ArrayFire

The example below assume that C:\workspace is the working directory. That is, WORKSPACE=C:\workspace

This 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.

License