Skip to content
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

gcc: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-parameter' #2

Open
danielgordon10 opened this issue Apr 1, 2021 · 2 comments

Comments

@danielgordon10
Copy link

I am getting this error when trying to compile some go code. Do you know what might be causing it?

Longer error message

ERROR: /home/daniel/thirdwave/twa/go/lib/geometry/BUILD.bazel:29:8: GoLink twa/go/lib/geometry/geometry_test_/geometry_test failed (Exit 1): builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder link -sdk external/go_sdk -installsuffix linux_amd64 -arc ... (remaining 175 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox builder failed: error executing command bazel-out/host/bin/external/go_sdk/builder link -sdk external/go_sdk -installsuffix linux_amd64 -arc ... (remaining 175 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
external/go_sdk/pkg/tool/linux_amd64/link: running external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc failed: exit status 1
gcc: error: unrecognized command line option '-Qunused-arguments'; did you mean '-Wunused-parameter'?

link: error running subcommand external/go_sdk/pkg/tool/linux_amd64/link: exit status 2
Target //twa/go/lib/geometry:geometry_test failed to build
@liuliu
Copy link
Owner

liuliu commented Apr 1, 2021

Yeah. The way this rule works is by having the https://github.com/liuliu/rules_cuda/blob/main/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc.tpl as your de-facto compiler / linker. Under the hood, it parses parameters and pass to nvcc.

On linker phase, Bazel will collect all linker parameters and pass into the linker.

Depending on your bazelrc settings, if it uses nvcc, it may not understand all the modern linker parameters: https://github.com/liuliu/rules_cuda/blob/main/.bazelrc#L2, in that case, it may encounter this error.

There are two ways to workaround this: 1. Use clang rather than nvcc (as demonstrated in the example bazelrc file as cuda_clang) that should understand much more modern flags; 2. Update your CUDA toolkit so nvcc is a bit more modern. 3. Change the crosstool_wrapper_driver_is_not_gcc.tpl file such that this particular parameter is omitted.

@liuliu
Copy link
Owner

liuliu commented Apr 3, 2021

@danielgordon10 if you have an example to reprod this issue, I can help to resolve it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants