Hey,

I have compiled OpenMP from source using following options:

./configure --target=x86_64-rumprun-netbsd --disable-multilib
--disable-shared

I want to test the library with a simple OMP program i.e.
https://computing.llnl.gov/tutorials/openMP/samples/C/omp_hello.c .
I compile and link the program in two separate steps:

x86_64-rumprun-netbsd-gcc -pedantic  -I <Path to omp.h> omp_hello.c -c

Depending on the Link command I run into two different erros:

x86_64-rumprun-netbsd-gcc -pedantic omp_hello.o -o omp_hello.bin <path to
OMP>/libgomp.a  -pthread

mp_hello.bin: In function `gomp_verror':

/tmp/gcc-build/../gcc/libgomp/error.c:41: undefined reference to `stderr'
omp_hello.bin: In function `vfprintf':
/usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to
`stderr'
/usr/include/x86_64-linux-gnu/bits/stdio2.h:127: undefined reference to
`__vfprintf_chk'
omp_hello.bin: In function `gomp_verror':
/tmp/gcc-build/../gcc/libgomp/error.c:43: undefined reference to `stderr'
omp_hello.bin: In function `parse_boolean':
/tmp/gcc-build/../gcc/libgomp/env.c:856: undefined reference to
`__ctype_b_loc'
omp_hello.bin: In function `parse_unsigned_long':
/tmp/gcc-build/../gcc/libgomp/env.c:170: undefined reference to
`__ctype_b_loc'
/tmp/gcc-build/../gcc/libgomp/env.c:178: undefined reference to
`__errno_location'
omp_hello.bin: In function `parse_one_place':
/tmp/gcc-build/../gcc/libgomp/env.c:430: undefined reference to
`__ctype_b_loc'
/tmp/gcc-build/../gcc/libgomp/env.c:448: undefined reference to
`__errno_location'
/tmp/gcc-build/../gcc/libgomp/env.c:523: undefined reference to
`__errno_location'
omp_hello.bin: In function `

[....]



x86_64-rumprun-netbsd-gcc -pedantic omp_hello.o -o omp_hello.bin *-L* <path
to OMP>/libgomp.a  -pthread

omp_hello.bin: In function `main':
(.text+0x10): undefined reference to `omp_get_thread_num'
omp_hello.bin: In function `main':
(.text+0x32): undefined reference to `omp_get_num_threads'
collect2: error: ld returned 1 exit status

My guess at the first error would be that I have to link the rumprun
libc.a. But which one is the correct one? I found 4 different libc.a in the
rumprun source folder.

Any hints / ideas are highly appreciated. :)

Kind Regards,

Vincent

Reply via email to