<div dir="ltr">Dear Simon and Dirk,<br><br>Thank you so much for the answers. I really appreciate your help. <br><br>Best regards,<br>Naeem <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 9, 2021 at 8:32 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
(I replied earlier but that seems to have gotten lost. Apologies to anybody<br>
who may receive two copies, and thanks to Simon for his answer.  -- Dirk)<br>
<br>
<br>
On 9 August 2021 at 17:04, Naeem Khoshnevis wrote:<br>
| Do you know a workaround for this issue?<br>
<br>
Wrap the #include by #ifdef _OPENMP and #endif<br>
<br>
Test for presence of OpenMP (for example via a configure script). <br>
<br>
Use the standard R compilation flags. RcppArmadillo uses<br>
<br>
  PKG_CXXFLAGS = -I../inst/include @OPENMP_FLAG@<br>
  PKG_LIBS= @OPENMP_FLAG@ $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)<br>
<br>
where @OPENMP_FLAG@ gets set if OpenMP is found.  Other packages just use<br>
<br>
  PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) <br>
  PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)<br>
<br>
relying on R which sets SHLIB_OPENMP_CXXFLAGS.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="https://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">https://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div>