-
Notifications
You must be signed in to change notification settings - Fork 6
/
common.bat
144 lines (124 loc) · 5.58 KB
/
common.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
REM DIRECTORIES
REM USE DOUBLE QUOTES IF PATHS INCLUDE SPACES
SET WORKSPACE=C:/workspace
SET AF_DIR=%WORKSPACE%/arrayfire
REM AF_INSTALL_PATH is where ArrayFire files are installed.
REM AF_INSTALL_PATH can be relative path from AF_DIR/build or absolute path
SET AF_INSTALL_PATH="package"
SET DEPS_DIR=%WORKSPACE%/dependencies
REM Relative to AF_DIR
SET BUILD_DIR=build
REM BUILD_TYPE can be Release, Debug, RelWithDebInfo, MinSizeRel
SET BUILD_TYPE=Release
REM THIS OPTIONS IS USED TO SET NO OPTIMIZATIONS WHEN USING RELEASE
REM THIS LEADS TO A FASTER COMPILATION TIME, AT THE EXPENSE OF PERFORMANCE AT RUNTIME
SET MIN_BUILD_TIME=OFF
REM ARRAYFIRE BUILD OPTIONS
REM SELECT WHICH BACKENDS TO BUILD BY SETTING THEM TO ON
SET CPU=ON
SET CUDA=OFF
SET OPENCL=OFF
SET UNIFIED=OFF
SET GRAPHICS=OFF
REM BILD NONFREE COMPONENTS SUCH AS SIFT
REM THIS HAS A NON-FREE LICENSE
SET BUILD_NONFREE=OFF
REM CPU ASYNCHRONOUS OPTION
SET CPU_ASYNC=ON
REM Set CUDA_COMPUTE_DETECT to OFF to disable auto detection.
REM If no CUDA computes are detected (for example when running on a remote machine)
REM it will default to 20, 30, 50, unless at least one of CUDA_COMPUTE_XY (below) are set to ON
SET CUDA_COMPUTE_DETECT=ON
REM Set these to ON for adding a architecture while compiling.
REM If CUDA_COMPUTE_DETECT is turned on, the detected computes will be enabled automatically and override any OFF computes.
SET CUDA_COMPUTE_20=OFF
SET CUDA_COMPUTE_30=OFF
SET CUDA_COMPUTE_35=OFF
SET CUDA_COMPUTE_37=OFF
SET CUDA_COMPUTE_50=OFF
SET CUDA_COMPUTE_52=OFF
SET CUDA_COMPUTE_60=OFF
SET CUDA_COMPUTE_61=OFF
REM TOGGLE EXAMPLES AND TESTS
SET EXAMPLES=ON
SET TESTS=ON
REM FREEIMAGE_TYPE can be OFF, STATIC, DYNAMIC
SET FREEIMAGE_TYPE=STATIC
REM CPU_FFT_TYPE can be FFTW, ACML, MKL
REM Note: ACML 6.1 has known failure issues
SET CPU_FFT_TYPE=FFTW
REM CPU_BLAS_TYPE can be LAPACKE, MKL
REM Ideally, BLAS_TYPE and LAPACK_TYPE should be the same
SET CPU_BLAS_TYPE=LAPACKE
REM CPU_LAPACK_TYPE can be LAPACKE, MKL
SET CPU_LAPACK_TYPE=LAPACKE
REM PATH SETTING TO RUN EXECUTABLES
SET FI_DIR=%DEPS_DIR%/freeimage-3.17.0_x64
SET FFTW_DIR=%DEPS_DIR%/fftw-3.3.4
SET ACML_DIR=%DEPS_DIR%/acml/ifort64
SET MKL_DIR=%DEPS_DIR%/mkl
SET LAPACKE_DIR=%DEPS_DIR%/lapacke
SET GLFW_DIR=%DEPS_DIR%/glfw
SET BOOST_DIR=%DEPS_DIR%/boost_1_56_0
SET PATH_EXT=%AF_DIR%\%BUILD_DIR%\package\lib;
REM FREEIMAGE
SET FREEIMAGE_OPTIONS=
if "%FREEIMAGE_TYPE%"=="DYNAMIC" (
SET FREEIMAGE_OPTIONS=-DFREEIMAGE_FOUND:STRING=ON -DUSE_FREEIMAGE_STATIC:BOOL=OFF -DFREEIMAGE_INCLUDE_PATH:STRING="%FI_DIR%" -DFREEIMAGE_STATIC_LIBRARY:STRING="%FI_DIR%/FreeImageLib.lib" -DFREEIMAGE_DYNAMIC_LIBRARY:STRING="%FI_DIR%/FreeImage.lib"
SET PATH_EXT=%PATH_EXT%%FI_DIR%;
) else ( REM STATIC
SET FREEIMAGE_OPTIONS=-DFREEIMAGE_FOUND:STRING=ON -DUSE_FREEIMAGE_STATIC:BOOL=ON -DFREEIMAGE_INCLUDE_PATH:STRING="%FI_DIR%" -DFREEIMAGE_STATIC_LIBRARY:STRING="%FI_DIR%/FreeImageLib.lib" -DFREEIMAGE_DYNAMIC_LIBRARY:STRING="%FI_DIR%/FreeImage.lib"
)
REM FFT
SET FFT_OPTIONS=
if "%CPU_FFT_TYPE%"=="FFTW" (
SET FFT_OPTIONS=-DFFTW_ROOT:STRING="%FFTW_DIR%" -DFFTW_LIB:STRING="%FFTW_DIR%/libfftw3-3.lib" -DFFTWF_LIB:STRING="%FFTW_DIR%/libfftw3f-3.lib" -DFFTWL_LIB:STRING="%FFTW_DIR%/libfftw3l-3.lib"
SET PATH_EXT=%PATH_EXT%%FFTW_DIR%;
) else (
if "%CPU_FFT_TYPE%"=="ACML" (
REM SET ACML PATH HERE
SET FFT_OPTIONS=-DFFTW_ROOT:STRING="%ACML_DIR%" -DFFTW_LIBRARIES:STRING="%ACML_DIR%/lib/acml_fftw.lib" -DFFTW_LIB:STRING="" -DFFTWF_LIB:STRING=""
SET PATH_EXT=%PATH_EXT%%ACML_DIR%\lib;
) else (
REM SET MKL PATH HERE
SET FFT_OPTIONS=-DFFTW_ROOT:STRING="%MKL_DIR%" -DFFTW_LIBRARIES:STRING="%MKL_DIR%/lib/mkl_rt.lib" -DFFTW_LIB:STRING="" -DFFTWF_LIB:STRING=""
SET PATH_EXT=%PATH_EXT%%MKL_DIR%\bin;
)
)
SET BLAS_OPTIONS=
if "%CPU_BLAS_TYPE%"=="LAPACKE" (
REM SET LAPACKE PATH HERE
SET BLAS_OPTIONS=-DUSE_CPU_F77_BLAS:BOOL=ON -DUSE_OPENCL_F77_BLAS:BOOL=ON -DCBLAS_INCLUDE_DIR:STRING="%LAPACKE_DIR%/include" -DCBLAS_cblas_LIBRARY:STRING="%LAPACKE_DIR%/lib/libblas.lib"
SET PATH_EXT=%PATH_EXT%%LAPACKE_DIR%\bin;
) else (
REM SET MKL PATH HERE
SET BLAS_OPTIONS=-DUSE_CPU_MKL:BOOL=ON -DUSE_OPENCL_MKL:BOOL=ON -DCBLAS_mkl_rt_INCLUDE:STRING="%MKL_DIR%/include" -DCBLAS_mkl_rt_LIBRARY:STRING="%MKL_DIR%/lib/mkl_rt.lib"
SET PATH_EXT=%PATH_EXT%%MKL_DIR%\bin;
)
SET LAPACK_OPTIONS=
if "%CPU_LAPACK_TYPE%"=="LAPACKE" (
REM SET LAPACKE PATH HERE
SET LAPACK_OPTIONS=-DLAPACKE_ROOT:STRING="%LAPACKE_DIR%"
REM SET LAPACK_OPTIONS=-DLAPACK_INCLUDE_DIR:STRING="%LAPACKE_DIR%/include" -DLAPACKE_LIB:STRING="%LAPACKE_DIR%/lib/liblapacke.lib" -DLAPACK_LIB:STRING="%LAPACKE_DIR%/lib/liblapack.lib"
SET PATH_EXT=%PATH_EXT%%LAPACKE_DIR%\bin;
) else (
REM SET MKL PATH HERE
SET LAPACK_OPTIONS=-DUSE_CPU_MKL:BOOL=ON -DUSE_OPENCL_MKL:BOOL=ON -DLAPACKE_INCLUDES:STRING="%MKL_DIR%/include" -DLAPACKE_LIB:STRING="%MKL_DIR%/lib/mkl_rt.lib;" -DLAPACK_LIB:STRING="%MKL_DIR%/lib/mkl_rt.lib"
SET PATH_EXT=%PATH_EXT%%MKL_DIR%\bin;
)
SET GRAPHICS_OPTIONS=
if "%GRAPHICS%"=="ON" (
SET GRAPHICS_OPTIONS=-DBUILD_GRAPHICS:BOOL=ON -DGLFW_ROOT_DIR="%GLFW_DIR%" -DGLFW_INCLUDE_DIR:STRING="%GLFW_DIR%/include" -DGLFW_LIBRARY="%GLFW_DIR%/lib/glfw3.lib"
SET PATH_EXT=%PATH_EXT%%DEPS_DIR%\glfw\lib;
) else (
SET GRAPHICS_OPTIONS=-DBUILD_GRAPHICS:BOOL=OFF
)
if "%CUDA%"=="ON" (
SET PATH_EXT=%PATH_EXT%%CUDA_PATH%\bin;%CUDA_PATH%\nvvm\bin;
)
REM TOOLS CONFIGURATION
SET THREADS=8
SET GIT_EXE="git.exe"
SET CMAKE="C:\Program Files (x86)\CMake\bin\cmake"
SET CMAKE_GENERATOR=-G "Visual Studio 12 2013 Win64"
SET CTEST="C:\Program Files (x86)\CMake\bin\ctest.exe" --force-new-ctest-process --output-on-failure