Search code examples
c++windowsropenmp

using openmp in windows R, does rtools support openmp?


I got lots of error messages when trying to use openmp in a c++ code for building my R package on windows 7:

c:/rtools/mingw/bin/../lib/gcc/mingw32/4.5.0/libgomp.a(parallel.o):(.text+0x19): undefined      reference to `_imp__pthread_getspecific'
c:/rtools/mingw/bin/../lib/gcc/mingw32/4.5.0/libgomp.a(parallel.o):(.text+0x7a): undefined reference to `_imp__pthread_mutex_lock'
c:/rtools/mingw/bin/../lib/gcc/mingw32/4.5.0/libgomp.a(env.o):(.text+0x510): undefined reference to `_imp__pthread_mutex_init'

...

Is Rtools not supporting openmp? Does anyone know how to use openmp in windows R packages please?


Solution

  • No, per discussions on the R-devel mailing list. It also came up on the Rcpp-devel list.

    R itself does not use OpenMP on Windows, so there is not support in Rtools. On other OSs R does of course have OpenMP support.