Skip to content

Commit 06267fd

Browse files
committed
Support C11 threads from glibc (#2220)
1 parent 37eb338 commit 06267fd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

configure.self

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ function checks {
4343
# -lrt is needed on linux for clock_gettime: link it if it exists.
4444
mkl_lib_check "librt" "" cont CC "-lrt"
4545

46+
# pthreads required (even if C11 threads available) for rwlocks.
47+
mkl_lib_check "libpthread" "" fail CC "-lpthread" \
48+
"#include <pthread.h>"
4649

47-
# Use internal tinycthread if C11 threads not available
48-
mkl_lib_check "c11threads" WITH_C11THREADS disable CC "" \
50+
# Use internal tinycthread if C11 threads not available.
51+
# Requires -lpthread on glibc c11 threads, thus the use of $LIBS.
52+
mkl_lib_check "c11threads" WITH_C11THREADS disable CC "$LIBS" \
4953
"
5054
#include <threads.h>
5155
@@ -64,10 +68,6 @@ void foo (void) {
6468
}
6569
"
6670

67-
# pthreads required (even if C11 threads available) for rwlocks
68-
mkl_lib_check "libpthread" "" fail CC "-lpthread" \
69-
"#include <pthread.h>"
70-
7171
# Check if dlopen() is available
7272
mkl_lib_check "libdl" "WITH_LIBDL" disable CC "-ldl" \
7373
"

0 commit comments

Comments
 (0)