string "OpenBLAS target CPU"
default BR2_PACKAGE_OPENBLAS_DEFAULT_TARGET
+config BR2_PACKAGE_OPENBLAS_USE_THREAD
+ bool "use multithreading"
+ default y
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on !BR2_STATIC_LIBS
+ help
+ Tell OpenBLAS to use multithreading, by passing USE_THREAD=1.
+
+config BR2_PACKAGE_OPENBLAS_USE_LOCKING
+ bool "use locking"
+ default y
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on !BR2_PACKAGE_OPENBLAS_USE_THREAD
+ help
+ Tell OpenBLAS to use locking, by passing USE_LOCKING=1.
+ Locking is implicitly enabled when USE_THREAD=1.
+ However, if USE_THREAD=0 (i.e. OpenBLAS itself will run in
+ single-threaded mode) but an application makes OpenBLAS
+ function calls from multiple threads, then locking is
+ mandatory for correct operation.
+
endif
endif
# Enable/Disable multi-threading (not for static-only since it uses dlfcn.h)
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS):$(BR2_STATIC_LIBS),y:)
+ifeq ($(BR2_PACKAGE_OPENBLAS_USE_THREAD),y)
OPENBLAS_MAKE_OPTS += USE_THREAD=1
else
OPENBLAS_MAKE_OPTS += USE_THREAD=0
endif
+ifeq ($(BR2_PACKAGE_OPENBLAS_USE_LOCKING),y)
+OPENBLAS_MAKE_OPTS += USE_LOCKING=1
+else
+# not passing USE_LOCKING=0 as this could be confusing: its effect is implicit
+# in case of USE_THREAD=1.
+endif
+
# We don't know if OpenMP is available or not, so disable
OPENBLAS_MAKE_OPTS += USE_OPENMP=0