File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,13 @@ VERSION = 0.3.7.dev
56
56
# specify it.
57
57
# For force setting for single threaded, specify USE_THREAD = 0
58
58
# For force setting for multi threaded, specify USE_THREAD = 1
59
- # USE_THREAD = 0
59
+ USE_THREAD = 0
60
+
61
+ # If you want to build a single-threaded OpenBLAS, but expect to call this
62
+ # from several concurrent threads in some other program, comment this in for
63
+ # thread safety. (This is done automatically for USE_THREAD=1 , and should not
64
+ # be necessary when USE_OPENMP=1)
65
+ # USE_LOCKING = 1
60
66
61
67
# If you're going to use this library with OpenMP, please comment it in.
62
68
# This flag is always set for POWER8. Don't set USE_OPENMP = 0 if you're targeting POWER8.
@@ -220,7 +226,7 @@ NO_AFFINITY = 1
220
226
COMMON_PROF = -pg
221
227
222
228
# Build Debug version
223
- # DEBUG = 1
229
+ DEBUG = 1
224
230
225
231
# Set maximum stack allocation.
226
232
# The default value is 2048. 0 disable stack allocation a may reduce GER and GEMV
Original file line number Diff line number Diff line change @@ -237,6 +237,10 @@ SMP = 1
237
237
endif
238
238
endif
239
239
240
+ ifeq ($(SMP), 1)
241
+ USE_LOCKING =
242
+ endif
243
+
240
244
ifndef NEED_PIC
241
245
NEED_PIC = 1
242
246
endif
@@ -388,6 +392,12 @@ ifneq ($(MAX_STACK_ALLOC), 0)
388
392
CCOMMON_OPT += -DMAX_STACK_ALLOC=$(MAX_STACK_ALLOC)
389
393
endif
390
394
395
+ ifdef USE_LOCKING
396
+ ifneq ($(USE_LOCKING), 0)
397
+ CCOMMON_OPT += -DUSE_LOCKING
398
+ endif
399
+ endif
400
+
391
401
#
392
402
# Architecture dependent settings
393
403
#
@@ -744,6 +754,8 @@ CCOMMON_OPT += -DF_INTERFACE_GFORT
744
754
FCOMMON_OPT += -Wall
745
755
# make single-threaded LAPACK calls thread-safe #1847
746
756
FCOMMON_OPT += -frecursive
757
+ # work around ABI changes in gfortran 9 that break calls from C code
758
+ FCOMMON_OPT += -fno-optimize-sibling-calls
747
759
#Don't include -lgfortran, when NO_LAPACK=1 or lsbcc
748
760
ifneq ($(NO_LAPACK), 1)
749
761
EXTRALIB += -lgfortran
Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ extern "C" {
131
131
#include <time.h>
132
132
#include <unistd.h>
133
133
#include <math.h>
134
- #ifdef SMP
134
+ #if defined( SMP ) || defined( USE_LOCKING )
135
135
#include <pthread.h>
136
136
#endif
137
137
#endif
@@ -200,7 +200,7 @@ extern "C" {
200
200
#error "You can't specify both LOCK operation!"
201
201
#endif
202
202
203
- #ifdef SMP
203
+ #if defined( SMP ) || defined( USE_LOCKING )
204
204
#define USE_PTHREAD_LOCK
205
205
#undef USE_PTHREAD_SPINLOCK
206
206
#endif
You can’t perform that action at this time.
0 commit comments