[R-pkg-devel] Fortran with OpenMP on MACOS

Sergio Ibarra-Espinosa @erg|o@|b@rr@ @end|ng |rom u@p@br
Tue Oct 13 17:07:46 CEST 2020


Dear List,

I have a package that was archived (
https://cran-archive.r-project.org/web/checks/2020/2020-10-07_check_results_vein.html
) because I could not solve an issue with OpenMP and Fortran on MACOS.

I have seen that packages with C add precompilation conditions, for
instance:

https://github.com/tesujimath/R-OpenMPController/blob/86bd047e8bfdf3c87877336ff8e2d3b69327fe03/src/omp_set_num_threads_ptr.c#L12

#ifdef _OPENMP
  omp_set_num_threads(*np);
#endif

So, I tried adding those lines in #ifdef _OPENMP #endif in
fortran, with the flag -cpp and the MACROS recommended by the R EXTS manual:

USE_FC_TO_LINK =
PKG_FFLAGS = $(SHLIB_OPENMP_FFLAGS) *-cpp*
PKG_LIBS = $(SHLIB_OPENMP_FFLAGS)

But with R CMD Check i got the message:

Non-portable flags in variable 'PKG_FFLAGS': -cpp

I would be very grateful if someone provides me some guidelines. Thank you
so much

Best, Sergio


*Sergio Ibarra Espinosa*
Postdoc in Atmospheric Sciences, Universidade de São Paulo

+  <++8617643016295>55 11 934 909 778  | +55 11 974 253 791
<+55+11+974+253+791> | sergio.ibarra using usp.br

www.sergioibarra.blogspot.com | *Skype*: sergio_ibarra1
<https://mail.google.com/mail/u/0/#SignatureSanitizer_SafeHtmlFilter_>
Rua do Matão, 1226 - Cidade Universitária São Paulo-SP - Brasil - 05508-090
<http://github.com/ibarraespinosa>
<https://zoom.us/j/6527509021?pwd=VmlXQWliR1JSZGtpS0tJR1A2dUZpZz09>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list