Question

I did as the R extension documentation to set

PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)

in the src/Makevars file.

On linux it builds fine while on windows it gets various errors like:

undefined reference to `omp_get_num_threads'
undefined reference to `omp_get_thread_num'
undefined reference to `GOMP_barrier'

From the documentation I feel openmp is supported on Windows now. Is it right? How to solve the errors if it is supported by official Rtools?

An old post related: using openmp in windows R, does rtools support openmp? , which says openmp not supported on windows at that time.

Was it helpful?

Solution

The error is actually caused by UTF-8 BOM in the src/Makevars.win file, removing BOM fixed it for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top