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

set_omp_num_threads compiling error (utils.cpp) #5

Closed
gvogler opened this issue May 6, 2023 · 5 comments
Closed

set_omp_num_threads compiling error (utils.cpp) #5

gvogler opened this issue May 6, 2023 · 5 comments
Labels

Comments

@gvogler
Copy link

gvogler commented May 6, 2023

Hi!

When compiling in R (macOS, arm64) I am getting the following error:

utils.cpp:336:3: error: use of undeclared identifier 'omp_set_num_threads'; did you mean 'set_omp_num_threads'? omp_set_num_threads(threads); ^~~~~~~~~~~~~~~~~~~ set_omp_num_threads utils.cpp:333:6: note: 'set_omp_num_threads' declared here void set_omp_num_threads(int threads) ^ 1 error generated. make: *** [utils.o] Error 1

@rtobar rtobar added the bug label May 6, 2023
rtobar added a commit that referenced this issue May 6, 2023
The cimg_use_openmp macro is *always* defined by CImg.h, but its *value*
is either 0 or 1 depending on whether OpenMP is defined or not. This was
breaking compilation on platforms without OpenMP.

This fix should address #5.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
@rtobar
Copy link
Collaborator

rtobar commented May 6, 2023

@gvogler thanks for reporting this. Could you try the fix I just pushed to the fix-omp-compilation branch? Thanks!

rtobar added a commit that referenced this issue May 6, 2023
The cimg_use_openmp macro is *always* defined by CImg.h, but its *value*
is either 0 or 1 depending on whether OpenMP is defined or not. This was
breaking compilation on platforms without OpenMP.

This also uncovered an issue with our code calling Rcpp::cerr instead of
Rcpp::Rcerr, which has been fixed now.

This fix should address #5.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
@rtobar
Copy link
Collaborator

rtobar commented May 8, 2023

@gvogler any chance of testing this? We're waiting for feedback to confirm it's all working to then submit a new version to CRAN. If I head nothing in the next 24 hours I'll assume it's all good (it was when testing locally). Thanks!

@gvogler
Copy link
Author

gvogler commented May 8, 2023

@rtobar That version compiled without problems. Thanks!

@rtobar
Copy link
Collaborator

rtobar commented May 8, 2023

@gvogler that on the fix-omp-compilation branch

@rtobar
Copy link
Collaborator

rtobar commented May 9, 2023

@gvogler thanks for reporting back, we'll merge now and try to upload to CRAN.

@rtobar rtobar closed this as completed May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants