From 7aeb2d4e61875b35aa8a1bb32e1e1a1d39e2a01b Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Sat, 28 Mar 2020 13:30:54 +0100 Subject: [PATCH 1/2] 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 --- .github/workflows/linux_post_commit.yml | 2 +- .gitignore | 1 + buildbot/configure.py | 11 ++++++++--- sycl/doc/GetStartedGuide.md | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux_post_commit.yml b/.github/workflows/linux_post_commit.yml index 1180493d4dfae..e52c25a5f5b0a 100644 --- a/.github/workflows/linux_post_commit.yml +++ b/.github/workflows/linux_post_commit.yml @@ -35,7 +35,7 @@ jobs: mkdir -p $GITHUB_WORKSPACE/build cd $GITHUB_WORKSPACE/build python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --no-ocl $ARGS + -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --werror $ARGS - name: Compile run: | python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \ diff --git a/.gitignore b/.gitignore index dfeba61ddba1f..3d8e2be46252d 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ # Nested build directory /build* +!buildbot #==============================================================================# # Explicit files to ignore (only matches one). diff --git a/buildbot/configure.py b/buildbot/configure.py index f80859b3affa9..f9c48846391d5 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -26,6 +26,7 @@ def do_configure(args): llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti;libdevice' libclc_targets_to_build = '' sycl_build_pi_cuda = 'OFF' + sycl_werror = 'OFF' llvm_enable_assertions = 'ON' llvm_enable_doxygen = 'OFF' llvm_enable_sphinx = 'OFF' @@ -42,6 +43,9 @@ def do_configure(args): libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl' sycl_build_pi_cuda = 'ON' + if args.werror: + sycl_werror = 'ON' + if args.assertions: llvm_enable_assertions = 'ON' @@ -69,7 +73,7 @@ def do_configure(args): "-DLIBCLC_TARGETS_TO_BUILD={}".format(libclc_targets_to_build), "-DSYCL_BUILD_PI_CUDA={}".format(sycl_build_pi_cuda), "-DLLVM_BUILD_TOOLS=ON", - "-DSYCL_ENABLE_WERROR=ON", + "-DSYCL_ENABLE_WERROR={}".format(sycl_werror), "-DCMAKE_INSTALL_PREFIX={}".format(install_dir), "-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests. "-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen), @@ -78,7 +82,7 @@ def do_configure(args): "-DSYCL_ENABLE_XPTI_TRACING=ON" # Explicitly turn on XPTI tracing ] - if not args.no_ocl: + if args.system_ocl: cmake_cmd.extend([ "-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir), "-DOpenCL_LIBRARY={}".format(icd_loader_lib)]) @@ -120,7 +124,8 @@ def main(): parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA") parser.add_argument("--assertions", action='store_true', help="build with assertions") parser.add_argument("--docs", action='store_true', help="build Doxygen documentation") - parser.add_argument("--no-ocl", action='store_true', help="download OpenCL deps via CMake") + parser.add_argument("--system-ocl", action='store_true', help="use OpenCL deps from system (no download)") + parser.add_argument("--werror", action='store_true', help="Treat warnings as errors") parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries") parser.add_argument("--cmake-opt", action='append', help="Additional CMake option not configured via script parameters") diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index 4074fab5cd7b5..c813ede5c211e 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -93,7 +93,7 @@ python %DPCPP_HOME%\llvm\buildbot\compile.py -s %DPCPP_HOME%\llvm -o %DPCPP_HOME You can use the following flags with `configure.py`: - * `--no-ocl` -> Download OpenCL deps via cmake (can be useful in case of troubles) + * `--system-ocl` -> Don't Download OpenCL deps via cmake but use the system ones * `--cuda` -> use the cuda backend (see [Nvidia CUDA](#build-dpc-toolchain-with-support-for-nvidia-cuda)) * `--shared-libs` -> Build shared libraries * `-t` -> Build type (debug or release) From acddc8b74641417e7526fb72f7084d5c42a16a54 Mon Sep 17 00:00:00 2001 From: hiaselhans Date: Tue, 31 Mar 2020 19:34:43 +0200 Subject: [PATCH 2/2] [buildbot] use Werror as default again Signed-off-by: hiaselhans --- .github/workflows/linux_post_commit.yml | 2 +- buildbot/configure.py | 8 ++++---- sycl/doc/GetStartedGuide.md | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linux_post_commit.yml b/.github/workflows/linux_post_commit.yml index e52c25a5f5b0a..a7945e1e76adc 100644 --- a/.github/workflows/linux_post_commit.yml +++ b/.github/workflows/linux_post_commit.yml @@ -35,7 +35,7 @@ jobs: mkdir -p $GITHUB_WORKSPACE/build cd $GITHUB_WORKSPACE/build python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \ - -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --werror $ARGS + -s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release $ARGS - name: Compile run: | python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \ diff --git a/buildbot/configure.py b/buildbot/configure.py index f9c48846391d5..2a37f24931c13 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -26,7 +26,7 @@ def do_configure(args): llvm_enable_projects = 'clang;llvm-spirv;sycl;opencl-aot;xpti;libdevice' libclc_targets_to_build = '' sycl_build_pi_cuda = 'OFF' - sycl_werror = 'OFF' + sycl_werror = 'ON' llvm_enable_assertions = 'ON' llvm_enable_doxygen = 'OFF' llvm_enable_sphinx = 'OFF' @@ -43,8 +43,8 @@ def do_configure(args): libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl' sycl_build_pi_cuda = 'ON' - if args.werror: - sycl_werror = 'ON' + if args.no_werror: + sycl_werror = 'OFF' if args.assertions: llvm_enable_assertions = 'ON' @@ -125,7 +125,7 @@ def main(): parser.add_argument("--assertions", action='store_true', help="build with assertions") parser.add_argument("--docs", action='store_true', help="build Doxygen documentation") parser.add_argument("--system-ocl", action='store_true', help="use OpenCL deps from system (no download)") - parser.add_argument("--werror", action='store_true', help="Treat warnings as errors") + parser.add_argument("--no-werror", action='store_true', help="Don't treat warnings as errors") parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries") parser.add_argument("--cmake-opt", action='append', help="Additional CMake option not configured via script parameters") diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index c813ede5c211e..464c7587269ef 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -94,6 +94,7 @@ python %DPCPP_HOME%\llvm\buildbot\compile.py -s %DPCPP_HOME%\llvm -o %DPCPP_HOME You can use the following flags with `configure.py`: * `--system-ocl` -> Don't Download OpenCL deps via cmake but use the system ones + * `--no-werror` -> Don't treat warnings as errors when compiling llvm * `--cuda` -> use the cuda backend (see [Nvidia CUDA](#build-dpc-toolchain-with-support-for-nvidia-cuda)) * `--shared-libs` -> Build shared libraries * `-t` -> Build type (debug or release)