-
Notifications
You must be signed in to change notification settings - Fork 6
/
rebuild_arrayfire.bat
56 lines (45 loc) · 2.28 KB
/
rebuild_arrayfire.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
@echo off
setlocal EnableDelayedExpansion
call common.bat
SET OLDDIR=%CD%
cd %AF_DIR%
if "%1"=="clean" (
REM CLEAN BUILD
echo "Cloning submodules"
"%GIT_EXE%" submodule init
"%GIT_EXE%" submodule update
echo "Cleaning build directory"
REM Clean build space
rmdir /Q /S %BUILD_DIR%
mkdir %BUILD_DIR%
)
cd %BUILD_DIR%
REM Generate cmake
SET CPU_OPTIONS=-DBUILD_CPU:BOOL=OFF
SET CUDA_OPTIONS=-DBUILD_CUDA:BOOL=OFF
SET OPENCL_OPTIONS=-DBUILD_OPENCL:BOOL=OFF
SET UNIFIED_OPTIONS=-DBUILD_UNIFIED:BOOL=OFF
if "%CPU%"=="ON" (
echo "Running CPU CMake Configuration"
SET CPU_OPTIONS=-DBUILD_CPU:BOOL=ON -DBUILD_CPU_ASYNC:BOOL=%CPU_ASYNC% %FFT_OPTIONS% %BLAS_OPTIONS% %LAPACK_OPTIONS%
)
if "%CUDA%"=="ON" (
echo "Running CUDA CMake Configuration"
SET CUDA_OPTIONS=-DBUILD_CUDA:BOOL=ON -DCUDA_COMPUTE_DETECT:BOOL=%CUDA_COMPUTE_DETECT% -DCUDA_COMPUTE_20:BOOL=%CUDA_COMPUTE_20% -DCUDA_COMPUTE_30:BOOL=%CUDA_COMPUTE_30% -DCUDA_COMPUTE_32:BOOL=OFF -DCUDA_COMPUTE_35:BOOL=%CUDA_COMPUTE_35% -DCUDA_COMPUTE_37:BOOL=%CUDA_COMPUTE_37% -DCUDA_COMPUTE_50:BOOL=%CUDA_COMPUTE_50% -DCUDA_COMPUTE_52:BOOL=%CUDA_COMPUTE_52% -DCUDA_COMPUTE_53:BOOL=OFF -DCUDA_COMPUTE_60:BOOL=%CUDA_COMPUTE_60% -DCUDA_COMPUTE_61:BOOL=%CUDA_COMPUTE_61% -DBOOST_INCLUDEDIR:STRING="%BOOST_DIR%"
)
if "%OPENCL%"=="ON" (
echo "Running OpenCL CMake Configuration"
SET OPENCL_OPTIONS=-DBUILD_OPENCL:BOOL=ON -DBOOST_INCLUDEDIR:STRING="%BOOST_DIR%" %BLAS_OPTIONS% %LAPACK_OPTIONS%
)
if "%UNIFIED%"=="ON" (
echo "Running Unified CMake Configuration"
SET UNIFIED_OPTIONS=-DBUILD_UNIFIED:BOOL=ON
)
echo "Generating CMAKE"
%CMAKE% .. %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE:STRING="%BUILD_TYPE%" -DMIN_BUILD_TIME:BOOL=%MIN_BUILD_TIME% -DCMAKE_INSTALL_PREFIX:STRING=%AF_INSTALL_PATH% -DBUILD_TEST:STRING=%TESTS% -DBUILD_EXAMPLES:STRING=%EXAMPLES% -DBUILD_NONFREE=%BUILD_NONFREE% %FREEIMAGE_OPTIONS% %GRAPHICS_OPTIONS% %CPU_OPTIONS% %CUDA_OPTIONS% %OPENCL_OPTIONS% %UNIFIED_OPTIONS%
@echo off
echo "Running msbuild"
REM Build
%CMAKE% --build %AF_DIR%/%BUILD_DIR% --target ALL_BUILD --config %BUILD_TYPE% -- /v:m /clp:ShowCommandLine;Summary /m:%THREADS% /p:WarningLevel=1
%CMAKE% --build %AF_DIR%/%BUILD_DIR% --target INSTALL --config %BUILD_TYPE% -- /v:m /clp:ShowCommandLine;Summary /m:%THREADS% /p:WarningLevel=1
cd %OLDDIR%