Skip to content

Commit e654c1f

Browse files
Work on build_for_develop.bat to bring it on par with Linux shell script
1 parent 948a67b commit e654c1f

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

conda-recipe/bld.bat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
call "%ONEAPI_ROOT%compiler\latest\env\vars.bat"
2-
IF ERRORLEVEL 1 exit 1
2+
IF ERRORLEVEL 1 exit /b 1
33
REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted.
44
set ERRORLEVEL=
55

@@ -21,11 +21,11 @@ cmake -G Ninja ^
2121
"-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%" ^
2222
"-DDPCPP_ROOT=%DPCPP_ROOT%" ^
2323
"%SRC_DIR%/backends"
24-
IF %ERRORLEVEL% NEQ 0 exit 1
24+
IF %ERRORLEVEL% NEQ 0 exit /b 1
2525

2626
ninja -n
2727
ninja install
28-
IF %ERRORLEVEL% NEQ 0 exit 1
28+
IF %ERRORLEVEL% NEQ 0 exit /b 1
2929

3030
cd ..
3131
xcopy install\lib\*.lib dpctl /E /Y
@@ -41,4 +41,4 @@ set "DPPL_SYCL_INTERFACE_INCLDIR=dpctl\include"
4141

4242
"%PYTHON%" setup.py clean --all
4343
"%PYTHON%" setup.py build install
44-
IF %ERRORLEVEL% NEQ 0 exit 1
44+
IF %ERRORLEVEL% NEQ 0 exit /b 1

scripts/build_for_develop.bat

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
call "%ONEAPI_ROOT%compiler\latest\env\vars.bat"
2-
IF ERRORLEVEL 1 exit 1
1+
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"
2+
IF ERRORLEVEL 1 exit /b 1
33
REM conda uses %ERRORLEVEL% but FPGA scripts can set it. So it should be reseted.
44
set ERRORLEVEL=
55

@@ -8,24 +8,35 @@ set "CXX=dpcpp.exe"
88

99
rmdir /S /Q build_cmake
1010
mkdir build_cmake
11-
cd build_cmake
1211

13-
set "DPCPP_ROOT=%ONEAPI_ROOT%compiler\latest\windows"
14-
set "INSTALL_PREFIX=%cd%\..\install"
12+
rmdir /S /Q install
13+
mkdir install
14+
cd install
15+
set "INSTALL_PREFIX=%cd%"
1516

16-
rmdir /S /Q "%INSTALL_PREFIX%"
17+
cd ..\build_cmake
18+
19+
set "DPCPP_ROOT=%ONEAPI_ROOT%\compiler\latest\windows"
20+
set NUMPY_INC=
21+
for /f "delims=" %%a in ('%CONDA_PREFIX%\python.exe -c "import numpy; print(numpy.get_include())"') do @set NUMPY_INC=%%a
22+
set PYTHON_INC=
23+
for /f "delims=" %%a in ('%CONDA_PREFIX%\python.exe -c "import distutils.sysconfig as sc; print(sc.get_python_inc())"') do @set PYTHON_INC=%%a
1724

1825
cmake -G Ninja ^
19-
-DCMAKE_BUILD_TYPE=Release ^
26+
-DCMAKE_BUILD_TYPE=Debug ^
2027
"-DCMAKE_INSTALL_PREFIX=%INSTALL_PREFIX%" ^
21-
"-DCMAKE_PREFIX_PATH=%CONDA_PREFIX%" ^
28+
"-DCMAKE_PREFIX_PATH=%INSTALL_PREFIX%" ^
2229
"-DDPCPP_ROOT=%DPCPP_ROOT%" ^
30+
"-DPYTHON_INCLUDE_DIR=%PYTHON_INC%" ^
31+
"-DGTEST_INCLUDE_DIR=%CONDA_PREFIX\Library\include" ^
32+
"-DGTEST_LIB_DIR=%CONDA_PREFIX%\Library\lib" ^
33+
"-DNUMPY_INCLUDE_DIR=%NUMPY_DIR%" ^
2334
"%cd%\..\backends"
24-
IF %ERRORLEVEL% NEQ 0 exit 1
35+
IF %ERRORLEVEL% NEQ 0 exit /b 1
2536

2637
ninja -n
2738
ninja install
28-
IF %ERRORLEVEL% NEQ 0 exit 1
39+
IF %ERRORLEVEL% NEQ 0 exit /b 1
2940

3041
cd ..
3142
xcopy install\lib\*.lib dpctl /E /Y
@@ -40,6 +51,6 @@ set "DPPL_SYCL_INTERFACE_LIBDIR=dpctl"
4051
set "DPPL_SYCL_INTERFACE_INCLDIR=dpctl\include"
4152

4253
python setup.py clean --all
43-
python setup.py build develop
54+
python setup.py build_ext --inplace develop
4455
python -m unittest dpctl.tests
45-
IF %ERRORLEVEL% NEQ 0 exit 1
56+
IF %ERRORLEVEL% NEQ 0 exit /b 1

0 commit comments

Comments
 (0)