3 # Shell script with one argument (path of an OpenMP executable) that exits
4 # with status 0 if the OpenMP test program should be run and that exits with
5 # status 1 if the OpenMP test program should not be run.
7 test -e "$1" ||
exit $?
9 .
/supported_libpthread ||
exit $?
11 # Do not accept any statically linked executable.
12 if /usr
/bin
/file "$1" |
grep -q 'statically linked'; then
16 if [ "$(uname)" = Linux
]; then
18 # Let the dynamic linker/loader print the path of libgomp. See also man ld.so
19 libgomp_path
="$(LD_TRACE_LOADED_OBJECTS=1 "$1" \
20 | while read soname arrow path offset; \
21 do if [ "${soname#libgomp.so}" != "${soname}" ]; then echo $path; fi; done)"
23 # Inspect the output of nm. If nm does not find any symbol information,
24 # echo 1. If the symbol gomp_barrier_init is found, echo 0. Otherwise echo
25 # nothing. The second case occurs if gcc has been compiled with
26 # --disable-linux-futex, and the last case occurs if gcc has been compiled
27 # with --enable-linux-futex.
28 rc
="$(nm "${libgomp_path}" 2>&1 \
32 if [ "${line%: no symbols}" != "${line}" ]; then
35 elif [ "${line% gomp_barrier_init}" != "${line}" ]; then
44 if [ "$(uname)" = FreeBSD
]; then
46 ldd
"$1" |
grep libgomp
> /dev
/null