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

Fix clang compilation (failing since 0.0.150) #2082

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

rmoyard
Copy link
Contributor

@rmoyard rmoyard commented Sep 19, 2024

Since the v0.0.150, it is not possible to compile Enzyme with clang. The source of the issue is a loop over references (local binding) that contains a lambda function. https://github.com/EnzymeAD/Enzyme/pull/2079/files#diff-ab7735609ebf1b75b3d6baedc231689532dff0a7a8e4e1838c3aed11c99795e5R3111

Clang refuses to compile it because local binding are not variables and cannot be captured by the lambda function. Solution here is to create a variable that can be then captured by the lambda function.

https://stackoverflow.com/questions/50799719/reference-to-local-binding-declared-in-enclosing-function?noredirect=1&lq=1

@wsmoses wsmoses merged commit 662740f into EnzymeAD:main Sep 22, 2024
16 of 27 checks passed
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

Successfully merging this pull request may close these issues.

2 participants