Skip to content

Commit de1c955

Browse files
ldrummAlexeySachkov
authored andcommitted
Enable cmake argument passthrough in the SYCL configure wrapper (#17189)
Hundreds of `--cmake-opt=-DFOO=BAR` on the command line make it hard to see the wood for the trees, so introduce an alternative which is to simply pass unknown argument flags straight through to cmake. This should make using the wrapper a little more pleasant and readable.
1 parent e42590e commit de1c955

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

buildbot/configure.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77

88

9-
def do_configure(args):
9+
def do_configure(args, passthrough_args):
1010
# Get absolute path to source directory
1111
abs_src_dir = os.path.abspath(
1212
args.src_dir if args.src_dir else os.path.join(__file__, "../..")
@@ -242,6 +242,7 @@ def do_configure(args):
242242
]
243243
)
244244

245+
cmake_cmd += passthrough_args
245246
print("[Cmake Command]: {}".format(" ".join(map(shlex.quote, cmake_cmd))))
246247

247248
try:
@@ -394,11 +395,11 @@ def main():
394395
"--native-cpu-libclc-targets",
395396
help="Target triples for libclc, used by the Native CPU backend",
396397
)
397-
args = parser.parse_args()
398+
args, passthrough_args = parser.parse_known_intermixed_args()
398399

399400
print("args:{}".format(args))
400401

401-
return do_configure(args)
402+
return do_configure(args, passthrough_args)
402403

403404

404405
if __name__ == "__main__":

sycl/doc/GetStartedGuide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Secondly, set the `CUDA_LIB_PATH` environment variable and pass the CMake
227227
variable `CUDA_TOOLKIT_ROOT_DIR` as follows:
228228

229229
```sh
230-
CUDA_LIB_PATH=/path/to/cuda/toolkit/lib64/stubs CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda --cmake-opt="-DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda/toolkit"
230+
CUDA_LIB_PATH=/path/to/cuda/toolkit/lib64/stubs CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/configure.py --cuda -DCUDA_TOOLKIT_ROOT_DIR=/path/to/cuda/toolkit
231231

232232
CUDA_LIB_PATH=/path/to/cuda/toolkit/lib64/stubs CC=gcc CXX=g++ python $DPCPP_HOME/llvm/buildbot/compile.py
233233

@@ -260,7 +260,7 @@ variable `SYCL_BUILD_PI_HIP_ROCM_DIR` which can be passed using the
260260

261261
```sh
262262
python $DPCPP_HOME/llvm/buildbot/configure.py --hip \
263-
--cmake-opt=-DSYCL_BUILD_PI_HIP_ROCM_DIR=/usr/local/rocm
263+
-DSYCL_BUILD_PI_HIP_ROCM_DIR=/usr/local/rocm
264264
```
265265
If further customization is required — for instance when the layout of
266266
individual directories can not be inferred from `SYCL_BUILD_PI_HIP_ROCM_DIR`

sycl/doc/design/SYCLNativeCPU.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ SYCL Native CPU uses [libclc](https://github.com/intel/llvm/tree/sycl/libclc) to
4747
SYCL Native CPU uses the [oneAPI Construction Kit](https://github.com/codeplaysoftware/oneapi-construction-kit) (OCK) in order to support some core SYCL functionalities and improve performances, the OCK is fetched by default when SYCL Native CPU is enabled, and can optionally be disabled using the `NATIVECPU_USE_OCK` CMake variable (please note that disabling the OCK will result in limited functionalities and performances on the SYCL Native CPU backend):
4848

4949
```
50-
python3 buildbot/configure.py \
51-
--native_cpu \
52-
--cmake-opt=-DNATIVECPU_USE_OCK=Off
50+
python3 buildbot/configure.py --native_cpu -DNATIVECPU_USE_OCK=Off
5351
```
5452

5553
By default the oneAPI Construction Kit is pulled at the project's configure time using CMake `FetchContent`. This behaviour can be overridden by setting `NATIVECPU_OCK_USE_FETCHCONTENT=Off` and `OCK_SOURCE_DIR=<path>`

0 commit comments

Comments
 (0)