Hello, I am attempting to compile Stream with multithreading support but I can't seem to get it running with OpenMP. Here is the console output:
**** Build of configuration Linux_Application for project stream ****
C:\Freescale\CW_PA_v10.3.3\gnu\bin\mingw32-make -j8 all
'Building file: ../Sources/stream_mc.c'
'Executing target #1 ../Sources/stream_mc.c'
'Invoking: PowerPC LINUX e500mc C Compiler'
"C:/Freescale/CW_PA_v10.3.3/Cross_Tools/gcc-4.7.2-XMe500mc-linux/bin/powerpc-unknown-linux-gnu-gcc" "../Sources/stream_mc.c" -O3 -fopenmp -g -Wall -c -fmessage-length=0 -mcpu=e500mc -MMD -MP -MF"Sources/stream_mc.d" -o"Sources/stream_mc.o"
'Finished building: ../Sources/stream_mc.c'
' '
'Building target: stream.elf'
'Executing target #2 stream.elf'
'Invoking: PowerPC LINUX e500mc C Linker'
"C:/Freescale/CW_PA_v10.3.3/Cross_Tools/gcc-4.7.2-XMe500mc-linux/bin/powerpc-unknown-linux-gnu-gcc" "./Sources/stream_mc.o" -o"stream.elf"
../Sources/stream_mc.c: In function 'mysecond':
../Sources/stream_mc.c:426:13: warning: variable 'i' set but not used [-Wunused-but-set-variable]
../Sources/stream_mc.c: In function 'checkSTREAMresults':
../Sources/stream_mc.c:481:3: warning: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Wformat]
./Sources/stream_mc.o: In function `main._omp_fn.0':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:252: undefined reference to `omp_get_thread_num'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:254: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.2':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:269: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.3':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:288: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.4':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:315: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.5':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:325: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.6':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:335: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.7':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:345: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.4.constprop.8':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:315: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main._omp_fn.6.constprop.9':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:335: undefined reference to `omp_get_num_threads'
./Sources/stream_mc.o: In function `main':
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:250: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:262: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:269: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:288: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:315: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:325: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:335: undefined reference to `GOMP_parallel_start'
C:\Users\john\workspace\stream\Linux_Application/../Sources/stream_mc.c:345: undefined reference to `GOMP_parallel_start'
mingw32-make: *** [stream.elf] Error 1
I have already specified the -fopenmp flag in the Optimization section of the C/C++ Build Settings.