-fopenmp does not work on Ubuntu 13.10

648 views Asked by At

I am building the same application using the Intel MKL libraries and the GCC compiler, with all the flags advised by Intel. To use the GCC OMP implementation, -fopenmp is advised, which links the program with -lgomp. This works fine on Ubuntu 12.04 but on Ubuntu 13.10 GCC seems unable to find the right symbols. Anyone has a clue whether I am doing something wrong?

g++ -I$MKLROOT/include -I/home/jjgarcia/mps-bundle-gcc/include -g -O2 -fopenmp -o xy_stuck.exe xy_stuck.cc -O2 -L$MKLROOT/lib -L/home/jjgarcia/mps-bundle-gcc/lib -lmps -ltensor -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -ldl -lpthread -lf2c

Adding -lgomp explicitly does not help, btw.

These are the errors

/opt/intel/composer_xe_2013.3.163/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_critical_end'
/opt/intel/composer_xe_2013.3.163/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `omp_get_thread_num'
/opt/intel/composer_xe_2013.3.163/mkl/lib/intel64/libmkl_gnu_thread.so: undefined reference to `GOMP_sections_end_nowait'
...

Using -v -v to get verbose output shows the linker as it is invoked by GCC. I added -lgomp manually and it does not change. Note also that the linker does not complain about not finding gomp :-?

/usr/bin/ld --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o xy_stuck.exe /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o -L/opt/intel/composer_xe_2013.3.163/mkl/lib -L/home/jjgarcia/mps-bundle-gcc/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/opt/intel/composer_xe_2013.3.163/compiler/lib/intel64 -L/opt/intel/composer_xe_2013.3.163/mkl/lib/intel64 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -v /tmp/ccm64m9T.o -lmps -ltensor -lmkl_intel_lp64 -lmkl_core -lmkl_gnu_thread -ldl -lpthread -lf2c -lgomp -lstdc++ -lm -lgomp -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/4.8/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crtn.o
0

There are 0 answers