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

Sergio Ibarra-Espinosa @erg|o@|b@rr@ @end|ng |rom u@p@br
Tue Oct 13 18:19:27 CEST 2020


I'm, sorry but I don't understand your question. To my understanding,
adding the mentioned MACROS should be enough to add the flag -fopenmp.
Actually, when I build the package, gfortran already uses the flag -fopenmp:

gfortran -fno-optimize-sibling-calls *-fopenmp* -fpic  -g -O2
-fdebug-prefix-map=/build/r-base-8T8CYO/r-base-4.0.3=.
-fstack-protector-strong  -c  get_threads.f90 -o get_threads.o




Em ter., 13 de out. de 2020 às 12:41, Erin Hodgess <erinm.hodgess using gmail.com>
escreveu:

>
> I’m sure that you have done this, but did you set a compiler option of
> -fopenmp, please?
>
> Thanks
>
> On Tue, Oct 13, 2020 at 9:35 AM Sergio Ibarra-Espinosa <
> sergio.ibarra using usp.br> wrote:
>
>> 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
>> <https://www.google.com/maps/search/Rua+do+Mat%C3%A3o,+1226?entry=gmail&source=g>
>> - 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]]
>>
>> ______________________________________________
>> R-package-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>
> --
> Erin Hodgess, PhD
> mailto: erinm.hodgess using gmail.com
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list