On 28/10/15 09:45, Vincent Schwarzer wrote:
You were right and I could compile the OpenMp example file but noticed a
Warning by adding -Wall to the compiler argument list.
x86_64-rumprun-netbsd-gcc *-Wall* -pedantic -I
/tmp/thesis_vs/gcc-build/omp_hello.c
-c
One line Version (Compile and Link):
x86_64-rumprun-netbsd-gcc omp_hello.c *-Wall* -I /tmp/thesis_vs/gcc-build/
-L /tmp/thesis_vs/gcc-build/.libs/libgomp.a -lpthread -o omp_hello.bin
I get following Warning:
omp_hello.c: In function ‘main’:
omp_hello.c:22:0: warning: ignoring #pragma omp parallel
[-Wunknown-pragmas]
#pragma omp parallel private(nthreads, tid)
^
That sounds serious. Did you test with just gcc to see if the same happens?
When I compile the file with
x86_64-rumprun-netbsd-gcc -pedantic -I /tmp/thesis_vs/gcc-build/
omp_hello.c -c
x86_64-rumprun-netbsd-gcc -pedantic omp_hello.o -lgomp -o omp_hello.bin
/tmp/thesis_vs/gcc-build/.libs/libgomp.a -pthread
and execute rumpbake xen_pci omp_hello omp_hello.bin
I get following message:
`.text.exit' referenced in section `.fini_array' of
/tmp/rumprun-bake.18Re0Y/tmp1.obj: defined in discarded section
`.text.exit' of /tmp/rumprun-bake.18Re0Y/tmp1.obj
collect2: error: ld returned 1 exit status
You're on Xen, right? The xen ldscripts were discarding .text.exit, but
seems like newer versions of gcc (since ~2010) put things there. So,
pull rumprun, and rebuild/install. If that doesn't help, I'll probably
have to be able to repeat the problem locally to fix it.
When I bake the file compiled with the one line version from above I get:
/tmp/rumprun-bake.GJSD6s/tmp1.obj: In function `rumpbake_main1':
(.text+0x10): undefined reference to `omp_get_thread_num'
/tmp/rumprun-bake.GJSD6s/tmp1.obj: In function `rumpbake_main1':
(.text+0x32): undefined reference to `omp_get_num_threads'
collect2: error: ld returned 1 exit status
Unfortunately I cant make sense of the error messages (especially the first
one), in the second one the linking didn't work for some strange reason.
That looks like you supplied -lgomp before omp_hello.o
As to why you're getting it from bake, there was a slight bug which
prevented that error from being flagged already by
x86_64-rumprun-netbsd-gcc. Errors like that should now be correctly
flagged by the compiler after your next pull.