-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
openmp_wrapper.h stubs signature use __GOMP_NOTHROW #3923
Conversation
Fix microsoft#3915. OpenMP stubs do not use the noexcept attibute which is present in the gcc version of openmp, and which trigger compilation errors as seen below. dmlc-core uses the same technique and macro. /usr/lib/gcc/x86_64-linux-gnu/9/include/omp.h:114:12: error: declaration of ‘int omp_get_thread_num() noexcept’ has a different exception specifier 114 | extern int omp_get_thread_num (void) __GOMP_NOTHROW; | ^~~~~~~~~~~~~~~~~~ ... xxx/include/LightGBM/utils/openmp_wrapper.h:81:14: note: from previous declaration ‘int omp_get_thread_num()’ 81 | inline int omp_get_thread_num() {return 0;} | ^~~~~~~~~~~~~~~~~~
The lint plan fails with cpplint not being found. Sounds like a setup issue, and that is ran on travis it seems. All the other checks look happy though. |
Yes make sense, just changed it Co-authored-by: James Lamb <[email protected]>
cpplint is working now and yields the following errror:
@bsergean Could you please fix it? |
On line 96 there isn't any cast that I can see. Do you know what's going on ? Is it in the inlined code that a cast exists ? |
Sorry, I'm not a cpp coder. If you are sure this error is false positive, feel free to mark that line as |
To cpp reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@jameslamb Your review comment was addressed I believe, but your review blocks merging. Could you please unblock? |
sorry, didn't realize my review was blocking |
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Fix #3915. OpenMP stubs do not use the noexcept attibute which is present in the gcc version of openmp, and which trigger compilation errors as seen below. dmlc-core uses the same technique and macro.
/usr/lib/gcc/x86_64-linux-gnu/9/include/omp.h:114:12: error: declaration of ‘int omp_get_thread_num() noexcept’ has a different exception specifier
114 | extern int omp_get_thread_num (void) __GOMP_NOTHROW;
| ^~~~~~~~~~~~~~~~~~
...
xxx/include/LightGBM/utils/openmp_wrapper.h:81:14: note: from previous declaration ‘int omp_get_thread_num()’
81 | inline int omp_get_thread_num() {return 0;}
| ^~~~~~~~~~~~~~~~~~