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

Ignored -std=c++17 on Mac OS X #10

Closed
genos opened this issue Aug 11, 2023 · 5 comments
Closed

Ignored -std=c++17 on Mac OS X #10

genos opened this issue Aug 11, 2023 · 5 comments

Comments

@genos
Copy link

genos commented Aug 11, 2023

First off, thank you very much for this tutorial! I've been meaning to pick up both bazel and MLIR, so this is extremely helpful.

One thing I stumbled over in getting set up: apparently, bazel automatically detects XCode and picks a different toolchain, which led to it ignoring the -std=c++17 setting. Exporting BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 in my shell ensured that the setting went through. I thought I'd share to save others the trouble I went through.

Thanks again!

@steeve
Copy link

steeve commented Aug 18, 2023

I use this with success

build       --cxxopt='-std=c++17'
build       --host_cxxopt='-std=c++17'

j2kun added a commit that referenced this issue Aug 18, 2023
@j2kun
Copy link
Owner

j2kun commented Aug 18, 2023

I tried putting both the env and the cxxopt flags in

5d09716

@genos would you have a chance to test it? I don't have a mac to try it on.

@genos
Copy link
Author

genos commented Aug 18, 2023

Interestingly, putting the environment flag in my .bazelrc (after removing it from my ~/.zshrc) didn't work, but putting the other pieces in did. That is, the following .bazelrc works for me:

build --action_env=BAZEL_CXXOPTS=-std=c++17
build --cxxopt='-std=c++17'
build --host_cxxopt='-std=c++17'
test --test_output=all

@j2kun
Copy link
Owner

j2kun commented Aug 18, 2023

Thanks! Marking as fixed.

@j2kun j2kun closed this as completed Aug 18, 2023
@genos
Copy link
Author

genos commented Aug 18, 2023

@j2kun Just remembered I've got another change needed to get things working on 🍎 silicon; I'll open a new issue to cover it. See (or feel free to ignore!) #11.

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

No branches or pull requests

3 participants