Skip to content

[SYCL] Modify configure script #1421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linux_post_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 $ARGS
- name: Compile
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

# Nested build directory
/build*
!buildbot

#==============================================================================#
# Explicit files to ignore (only matches one).
Expand Down
11 changes: 8 additions & 3 deletions buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 'ON'
llvm_enable_assertions = 'ON'
llvm_enable_doxygen = 'OFF'
llvm_enable_sphinx = 'OFF'
Expand All @@ -42,6 +43,9 @@ def do_configure(args):
libclc_targets_to_build = 'nvptx64--;nvptx64--nvidiacl'
sycl_build_pi_cuda = 'ON'

if args.no_werror:
sycl_werror = 'OFF'

if args.no_assertions:
llvm_enable_assertions = 'OFF'

Expand Down Expand Up @@ -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),
Expand All @@ -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)])
Expand Down Expand Up @@ -120,7 +124,8 @@ def main():
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
parser.add_argument("--no-assertions", action='store_true', help="build without 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("--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")

Expand Down
3 changes: 2 additions & 1 deletion sycl/doc/GetStartedGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ 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
* `--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)
Expand Down