i am having serious troubles with GCC threadprivate support:
the following (minimal) code compiles correctly using intel compile 10 or 11 (possibly also earlier) but fails miserably using even the gcc4.4.1.
I believe this is a bug in gcc ... please correct me if i am wrong on this.
Is there any way i can get around this ? Otherwise i'll have to abandon gcc for my application
thank you
Riccardo
- Code: Select all
#include <iostream>
#include <omp.h>
//this compiles correctly both with Intel and GCC
double c = 1;
#pragma omp threadprivate(c)
//this does not compile ...even with GCC4.4.1!!!!!!!!!!!
class A
{
public :
A(){mtmp = 1.0;}
A(const A& b){mtmp=b.mtmp;}
~A(){};
double mtmp;
};
A objA;
#pragma omp threadprivate(objA)
int main( int argc, char* argv[] )
{
std::cout << "testing omp 3" << std::endl;
}
