On 08/01/2010 01:40, Yaakov (Cygwin/X) wrote:
However, I just encountered tonight a much larger conflict: OpenMP/C++
and <math.h> are incompatible. STC attached:

Here's the file I meant to attach.


Yaakov
// http://en.wikipedia.org/wiki/OpenMP#Hello_World
// with an #include <math.h>
// if you also #include <algorithm>, this *really* blows up

#include <math.h>
#include <omp.h>
#include <iostream>

int main (int argc, char *argv[]) {
        int th_id, nthreads;
#pragma omp parallel private(th_id)
        {
                th_id = omp_get_thread_num();
                std::cout << "Hello World from thread" << th_id << "\n";
#pragma omp barrier
                if ( th_id == 0 ) {
                        nthreads = omp_get_num_threads();
                        std::cout << "There are " << nthreads << " threads\n";
                }
        }
        return 0;
}

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to