Open coatless opened 1 year ago
James,
thank you! I removed // [[Rcpp::plugins(openmp)
.
It's unfortunate that MacOS users need to invest so much effort to install and recompile the package to benefit from OpenMP support, but at least it runs.
@ninohardt we're slowly moving toward adding the omp.h
headers into the new "Mac for Rtools" approach.
https://github.com/coatless-mac/macrtools
Right now, your users should be able to get Xcode CLI, gfortran, and an assortment of R development binaries.
Nino,
Hope all is well. Glancing at the updated package, I think everything should now be in order for your CRAN submission.
That is, you are using an
#ifdef _OPENMP
to protect against including OpenMP headers (<omp.h>
) if they are absent from the crippled compiler inside a custommyomp.h
https://github.com/ninohardt/echoice2/blob/114108d009fddfe3b63791afaeee1394e3bac967/src/myomp.h#L1
However, the next line down, you are including:
This plugin only works with the standalone Rcpp functions (
evalCpp()
,cppFunction()
, andsourceCpp()
). Within a package context, it isn't setting any variables required. You can remove this line as a result.The true compiler flags for
OpenMP
are being set insrc/Makevars
:https://github.com/ninohardt/echoice2/blob/114108d009fddfe3b63791afaeee1394e3bac967/src/Makevars#L2-L3
In particular, note that
SHLIB_OPENMP_CXXFLAGS
appears twice over.