tc-has-openmp is implemented as tc-has-openmp() { local base="${T}/test-tc-openmp" cat <<-EOF > "${base}.c" #include <omp.h> int main() { int nthreads, tid, ret = 0; #pragma omp parallel private(nthreads, tid) { tid = omp_get_thread_num(); nthreads = omp_get_num_threads(); ret += tid + nthreads; } return ret; } EOF $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" >&/dev/null local ret=$? rm -f "${base}"* return ${ret} } However, for llvm/clang openmp support is provided via libomp and the -fopenmp flag should be changed to -fopenmp=libomp. The following implementation is recommended instead. tc-has-openmp() { local base="${T}/test-tc-openmp" cat <<-EOF > "${base}.c" #include <omp.h> int main() { int nthreads, tid, ret = 0; #pragma omp parallel private(nthreads, tid) { tid = omp_get_thread_num(); nthreads = omp_get_num_threads(); ret += tid + nthreads; } return ret; } EOF if tc-is-gcc; then $(tc-getCC "$@") -fopenmp "${base}.c" -o "${base}" >&/dev/null elif tc-is-clang; then $(tc-getCC "$@") -fopenmp=libomp "${base}.c" -o "${base}" >&/dev/null fi local ret=$? rm -f "${base}"* return ${ret} }
Created attachment 457176 [details, diff] libomp-llvm-openmp.patch
Sorry.. just verified that -fopenmp is sufficient