Repository navigation
Expand file tree
/
Copy pathbuild_for_develop.bat
More file actions
66 lines (55 loc) · 1.63 KB
/
Copy pathbuild_for_develop.bat
File metadata and controls
66 lines (55 loc) · 1.63 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
REM check if oneAPI has been activated, only try activating if not
dpcpp.exe --version >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
set ERRORLEVEL=
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"
IF ERRORLEVEL 1 exit /b 1
)
REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted.
set ERRORLEVEL=
rmdir /S /Q build_cmake
mkdir build_cmake
rmdir /S /Q install
mkdir install
cd install
set "INSTALL_PREFIX=%cd%"
cd ..\build_cmake
set "DPCPP_ROOT=%ONEAPI_ROOT%\compiler\latest\windows"
if defined USE_GTEST (
set "_BUILD_CAPI_TEST=ON"
) else (
set "_BUILD_CAPI_TEST=OFF"
)
cmake -G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
"-DCMAKE_CXX_FLAGS=-Wno-unused-function /EHa" ^
"-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" ^
"-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX%" ^
"-DDPCPP_ROOT=%DPCPP_ROOT%" ^
"-DCMAKE_C_COMPILER:PATH=%DPCPP_ROOT%\bin\icx.exe" ^
"-DCMAKE_CXX_COMPILER:PATH=%DPCPP_ROOT%\bin\dpcpp.exe" ^
"-DBUILD_CAPI_TESTS=%_BUILD_CAPI_TEST%" ^
"%cd%\..\dpctl-capi"
IF %ERRORLEVEL% NEQ 0 exit /b 1
ninja -n
IF %ERRORLEVEL% NEQ 0 exit /b 1
if defined USE_GTEST (
ninja check
IF %ERRORLEVEL% NEQ 0 exit /b 1
)
ninja install
IF %ERRORLEVEL% NEQ 0 exit /b 1
cd ..
xcopy install\lib\*.lib dpctl /E /Y
xcopy install\bin\*.dll dpctl /E /Y
mkdir dpctl\include
xcopy dpctl-capi\include dpctl\include /E /Y
REM required by _sycl_core(dpctl)
set "DPCTL_SYCL_INTERFACE_LIBDIR=dpctl"
set "DPCTL_SYCL_INTERFACE_INCLDIR=dpctl\include"
set "CC=icx.exe"
set "CXX=dpcpp.exe"
python setup.py clean --all
python setup.py build_ext --inplace develop
python -m unittest dpctl.tests
IF %ERRORLEVEL% NEQ 0 exit /b 1