[R] -fopenmp

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 3 06:15:18 CEST 2014


On 02/04/2014 22:30, Filippo wrote:
> Hi everybody,
> just wanted to know if it is possible to use the openmp library in
> Fortran code to be used within R.

Yes, on a supported platform.  But

1) The posting guide tells you this is not the correct list for 
questions about compiled code.

2) 'Writing R Extensions' tells you how to do this.

3) ?SHLIB tells you about valid inputs, which do not include arbitrary 
flags.

> I tried this simple thing:
>
> subroutine test
> !$OMP parallel
> write(*,*) 'hello'
> !$OMP end parallel
> end subroutine test
>
> and I compiled in the following way:
>
> R CMD SHLIB test.f90 -fopenmp
>
> but is seems not working.
> The program correctly print me out four times 'hello' if I compile
> outside R simply using gfortran with the flag -fopenmp.
> If someone can help me I would be very grateful.
> Thanks in advance and regards
> Filippo Monari
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list