Compilation problem with ICPC + OpenMP...

Compilation problem with ICPC + OpenMP...

Hello.

I am currently testing a parallel code on the MTL and I have some problems with ICPC+OpenMP compilation.

Note : the only command I launch on the MTL is "source /opt/intel/composerxe/bin/compilervars.shintel64" in order to compile with ICPC.

With GMP+OpenMP, I can compile my code without any problems. The makefile I use is this one :

CC = g++
CFLAGS=-Wall -O3 -fopenmp
LDFLAGS=-fopenmp
EXEC=smallbrain

all: $(EXEC)

smallbrain: misc.o algo.o main.o
      $(CC) -o $@ $^ $(LDFLAGS)

algo.o: algo.cpp def.h algo.h
      $(CC) -o $@ -c $< $(CFLAGS)

misc.o: misc.cpp def.h misc.h
      $(CC) -o $@ -c $< $(CFLAGS)

main.o: main.cpp def.h misc.h algo.h
      $(CC) -o $@ -c $< $(CFLAGS)

clean:
      rm *.o

mrproper: clean
      rm $(EXEC)

But, with the following one for Intel ICPC+OpenMP, the compiler warns me about the fact that the "#pragma omp..." are "unrecognized" :

CC=icpc
CFLAGS=-Wall -O3 -fomit-frame-pointer -xSSE4.1 -openmp
LDFLAGS=-openmp
EXEC=smallbrain

all: $(EXEC)

smallbrain: misc.o algo.o main.o
      $(CC) -o $@ $^ $(LDFLAGS)

algo.o: algo.cpp def.h algo.h
      $(CC) -o $@ -c $< $(CFLAGS)

misc.o: misc.cpp def.h misc.h
      $(CC) -o $@ -c $< $(CFLAGS)

main.o: main.cpp def.h misc.h algo.h
      $(CC) -o $@ -c $< $(CFLAGS)

clean:
      rm *.o

mrproper: clean
      rm $(EXEC)

How can I solve this problem ?

Thank you very much

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Not seeing the same problem. I tried to compile the following simple test code (wriitten in C) using icpc and it does not complain about #pragma omp notrecongnized. Please try this code and see it you see the same problem.

Compile options are: icpc -openmp -o pi pi.o -lm

//pi.c - This program will numerically compute the integral of 4/(1+x*x)

#include
#include
#include // I/O

static long num_steps = 100000000;
double step;

int main ()
{
int i;
double x, pi, sum = 0.0;
double start_time, run_time;

step = 1.0/(double) num_steps;

start_time = omp_get_wtime();

#pragma omp parallel for
for (i=1;i<= num_steps; i++){
x = (i-0.5)*step;
sum = sum + 4.0/(1.0+x*x);
}

pi = step * sum;
run_time = omp_get_wtime() - start_time;

std::cout << "run_time: " ;
std::cout << run_time ;
std::cout << "\n";
}

Leave a Comment

Please sign in to add a comment. Not a member? Join today