libgomp support in gcc4.7 seems to be missing include and spec file

Edward Berger edwberger at gmail.com
Wed Oct 24 12:06:34 PDT 2012


Updated a machine to current head world and kernel to try openmp.
Using "omp_hello" example below (from
http://users.abo.fi/mats/PP2012/examples/OpenMP/ ) fails.
First the include file omp.h isn't found, commenting out that source
line then gcc complains about libgomp.spec isn't found.

----
/*
  OpenMP example program Hello World.
  The master thread forks a parallel region.
  All threads in the team obtain their thread number and print it.
  Only the master thread prints the total number of threads.
  Compile with: gcc -O3 -fopenmp omp_hello.c -o omp_hello
*/

#include <omp.h>
#include <stdio.h>
#include <stdlib.h>

int main (int argc, char *argv[]) {

  int nthreads, tid;

  /* Fork a team of threads giving them their own copies of variables */
#pragma omp parallel private(nthreads, tid)
  {
    /* Get thread number */
    tid = omp_get_thread_num();
    printf("Hello World from thread = %d\n", tid);

    /* Only master thread does this */
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number of threads = %d\n", nthreads);
    }
  }  /* All threads join master thread and disband */
  exit(0);
}


More information about the Users mailing list