mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [Mingw-cross-env-list] OpenMP support


From: Aleksandr' Tiŝin
Subject: Re: Re: [Mingw-cross-env-list] OpenMP support
Date: Wed, 16 Sep 2009 22:38:33 +0300

Thank you for your reply!

I was short in my letter due to the fact that English is not my native language and I was afraid that I will be misunderstood.
Yes, there is support of OpenMP technology in the GCC but mingw-cross-env compiles GCC without it.

There is short test program that compiles fine on a native GCC (with -fopenmp parameter):
 
#include <omp.h>
#include <stdio.h>

int main (int argc, char *argv[]) {
  int th_id, nthreads;
  omp_set_num_threads(10);
  printf("Number of processors: %d\n", omp_get_num_procs());
  #pragma omp parallel private(th_id)
  {
    th_id = omp_get_thread_num();
    printf("Hello World from thread %d\n", th_id);
    #pragma omp barrier
    if ( th_id == 0 ) {
      nthreads = omp_get_num_threads();
      printf("There are %d threads\n",nthreads);
    }
  }
  return 0;
}

but it fails with mingw-cross-env with "no omp.h file" error.

I was looking for omp.h, libgomp.a, libgomp.spec files in mingw folder manually but they are absent there.
So, how to fix it?

Thanks!

P.S. Sorry for my English.

2009/9/16 Volker Grabsch <address@hidden>

Aleksandr' Tiŝin <address@hidden> schrieb:
> Hello!
> How can I enable OpenMP support?
> Thanks!

Is your question really specific to mingw-cross-env? According to

   http://gcc.gnu.org/wiki/openmp

OpenMP is part of GCC since 4.2.x, and we're current using GCC 4.4.0,
so it should just work.

If you have any short test program that compiles fine on a native
GCC but fails with mingw-cross-env, please post it here. Otherwise
I don't see how we could possibly help you.

In addition, I strongly recommend to have a look at the classic
http://catb.org/~esr/faqs/smart-questions.html#beprecise
which contains lots of valuable suggestions about how to enable
other people to help you. Although the tone of that article is
very questionable, I haven't yet seen a better summary on that
topic.


Greets,

   Volker

--
Volker Grabsch
---<<(())>>---
Administrator
NotJustHosting GbR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]