[R-sig-hpc] OpenMP Problem

Dirk Eddelbuettel edd at debian.org
Thu Sep 17 17:04:23 CEST 2009

On 17 September 2009 at 07:39, Jan de Leeuw wrote:
| On OS X using gcc-4.5 I have

gcc 4.5? Wow, living on the edge! Just yesterday on r-devel, BDR just blamed
gcc-4.4 for bugginess...
| deleeuw at cuddyvalley:~/Desktop/ > echo $CFLAGS
| -m64 -O3 -fopenmp -mtune=native
| deleeuw at cuddyvalley:~/Desktop/ > echo $LDFLAGS
| -m64 -fopenmp
| for all compilations, including the compilation of
| the R-devel trunk. Then after R SHLIB tiny.c I get
|  > dyn.load("tiny.so")
|  > a<-.C("tiny")
| number of threads is 2
| number of threads is 2
| I am thread 0
| I am thread 1

For what it's worth I see the same on Debian testing using gcc 4.3.

edd at ron:~/src/progs/R/openMP> cat buildMe.sh 
MAKEFLAGS='SHLIB_CFLAGS=-fopenmp'  R CMD SHLIB TinyR.c -fopenmp

edd at ron:~/src/progs/R/openMP> cat runMe.r 

a <- .C("tiny")

edd at ron:~/src/progs/R/openMP> ./runMe.r 
number of threads is 2
I am thread 0
number of threads is 2
I am thread 1
edd at ron:~/src/progs/R/openMP> 


Three out of two people have difficulties with fractions.

More information about the R-sig-hpc mailing list