I've included openmp to my project. I've got -fopenmp in compliler flags.
g++ -std=c++0x -O3 -Wall -c -fmessage-length=0 -march=core2 -fopenmp -ffast-math -fPIC
#pragma omp parallel for for (int i = 0; i < rows; i++) { MatrixXd frame = frames.row(i); output.row(i) = dem(frame); } return output; And I have this output when compiling.
hello.cpp:(.text+0x2d88): undefined reference to `omp_get_num_threads' hello.cpp:(.text+0x2d8f): undefined reference to `omp_get_thread_num' ./hello.o: In function `demodulateMatrix': hello.cpp:(.text+0x315f): undefined reference to `GOMP_parallel_start' hello.cpp:(.text+0x316c): undefined reference to `GOMP_parallel_end' I've tried to add -fopenmp flag to the linker and I have this output with it
g++: error: unrecognized command line option ‘-fopenmp,’ make: *** [libhello.so] Error 1 GCC version is 4.8.2 right now.
gcc --version.g++). Clearly compilation does work for you, so GCC correctly recognises the-fopenmpflag. Provide a complete minimal example, along with all command line calls you issue.