-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathdbg_build.bat
More file actions
43 lines (36 loc) · 1.1 KB
/
dbg_build.bat
File metadata and controls
43 lines (36 loc) · 1.1 KB
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
@REM check if oneAPI has been activated, only try activating if not
dpcpp.exe --version >nul 2>&1
if errorlevel 1 (
set ERRORLEVEL=
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"
if %ERRORLEVEL% neq 0 exit 1
)
@REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted.
set ERRORLEVEL=
rmdir /S /Q build
mkdir build
rmdir /S /Q install
mkdir install
cd install
set "INSTALL_PREFIX=%cd%"
cd ..\build
set "DPCPP_HOME=%ONEAPI_ROOT%\compiler\latest\windows"
cmake -G Ninja ^
-DCMAKE_BUILD_TYPE=Debug ^
"-DCMAKE_CXX_FLAGS=-Wno-unused-function /EHsc" ^
"-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" ^
"-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX%" ^
"-DDPCPP_INSTALL_DIR=%DPCPP_HOME%" ^
"-DCMAKE_C_COMPILER:PATH=%DPCPP_HOME%\bin\icx.exe" ^
"-DCMAKE_CXX_COMPILER:PATH=%DPCPP_HOME%\bin\dpcpp.exe" ^
"-DCMAKE_LINKER:PATH=%DPCPP_HOME%\bin\lld-link.exe" ^
"-DDPCTL_BUILD_CAPI_TESTS=ON" ^
".."
if %ERRORLEVEL% neq 0 exit 1
ninja -n
if %ERRORLEVEL% neq 0 exit 1
@REM ninja check
@REM IF %ERRORLEVEL% NEQ 0 exit /b 1
ninja install
if %ERRORLEVEL% neq 0 exit 1
cd ..