Skip to content

Commit 7aeb2d4

Browse files
committed
modify configure script
* use "--no-ocl" by default -> new "--system-ocl" flag (use system OpenCl headers and do not download) * don't use "DSYCL_WERROR" by default, only on buildbot * don't exclude buildbot dir in gitignore Signed-off-by: hiaselhans <[email protected]>
1 parent f43883b commit 7aeb2d4

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/linux_post_commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
mkdir -p $GITHUB_WORKSPACE/build
3636
cd $GITHUB_WORKSPACE/build
3737
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
38-
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --no-ocl $ARGS
38+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --werror $ARGS
3939
- name: Compile
4040
run: |
4141
python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
# Nested build directory
2525
/build*
26+
!buildbot
2627

2728
#==============================================================================#
2829
# Explicit files to ignore (only matches one).

buildbot/configure.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def do_configure(args):
2626
llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti;libdevice'
2727
libclc_targets_to_build = ''
2828
sycl_build_pi_cuda = 'OFF'
29+
sycl_werror = 'OFF'
2930
llvm_enable_assertions = 'ON'
3031
llvm_enable_doxygen = 'OFF'
3132
llvm_enable_sphinx = 'OFF'
@@ -42,6 +43,9 @@ def do_configure(args):
4243
libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl'
4344
sycl_build_pi_cuda = 'ON'
4445

46+
if args.werror:
47+
sycl_werror = 'ON'
48+
4549
if args.assertions:
4650
llvm_enable_assertions = 'ON'
4751

@@ -69,7 +73,7 @@ def do_configure(args):
6973
"-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build),
7074
"-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda),
7175
"-DLLVM_BUILD_TOOLS=ON",
72-
"-DSYCL_ENABLE_WERROR=ON",
76+
"-DSYCL_ENABLE_WERROR={}".format(sycl_werror),
7377
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
7478
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
7579
"-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen),
@@ -78,7 +82,7 @@ def do_configure(args):
7882
"-DSYCL_ENABLE_XPTI_TRACING=ON" # Explicitly turn on XPTI tracing
7983
]
8084

81-
if not args.no_ocl:
85+
if args.system_ocl:
8286
cmake_cmd.extend([
8387
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
8488
"-DOpenCL_LIBRARY={}".format(icd_loader_lib)])
@@ -120,7 +124,8 @@ def main():
120124
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
121125
parser.add_argument("--assertions", action='store_true', help="build with assertions")
122126
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
123-
parser.add_argument("--no-ocl", action='store_true', help="download OpenCL deps via CMake")
127+
parser.add_argument("--system-ocl", action='store_true', help="use OpenCL deps from system (no download)")
128+
parser.add_argument("--werror", action='store_true', help="Treat warnings as errors")
124129
parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries")
125130
parser.add_argument("--cmake-opt", action='append', help="Additional CMake option not configured via script parameters")
126131

sycl/doc/GetStartedGuide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ python %DPCPP_HOME%\llvm\buildbot\compile.py -s %DPCPP_HOME%\llvm -o %DPCPP_HOME
9393

9494
You can use the following flags with `configure.py`:
9595

96-
* `--no-ocl` -> Download OpenCL deps via cmake (can be useful in case of troubles)
96+
* `--system-ocl` -> Don't Download OpenCL deps via cmake but use the system ones
9797
* `--cuda` -> use the cuda backend (see [Nvidia CUDA](#build-dpc-toolchain-with-support-for-nvidia-cuda))
9898
* `--shared-libs` -> Build shared libraries
9999
* `-t` -> Build type (debug or release)

0 commit comments

Comments
 (0)