*First I want to say OpenMP seems to work now !!!! :) * 2015-10-28 13:55 GMT+01:00 Antti Kantee <[email protected]>:
> 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? It seems that I can ignore it for now. I build OpenMP from sources for gcc and linked to it instead of the existing OpenMP lib. Seems to work fine but more extensive testing is necessary to be sure since this OpenMP Test program is hardly representative for a normal OpenMP application. > > > 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. Yes I'm on Xen and its working now. I have tested it with xen_pv / xen_pci both seem to work with the small test script. :) Couldn't test rumprun hw yet. > > > >>> 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. > > Works now as it should. I fiddled a bit with the order of the Includes and Libraries only this command order seems to work: x86_64-rumprun-netbsd-gcc -I/tmp/thesis_vs/gcc-build/ omp_hello.c -o omp_hello.bin /tmp/thesis_vs/gcc-build/.libs/libgomp.a -pthread Other orderings that should be valid according to the gcc manual doesn't e.g. show strange behavior ..... Next step would be to bring OpenMP into rumkernel release. After a quick glance over the rumpkernel repositories I should start in buildrump.sh is that right? Any hints appreciated as always. :) - Vincent
