diff --git a/CMakeLists.txt b/CMakeLists.txt index 517ce982e7..3d158eb7b7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,8 @@ endif() option(STATIC_LINKING "Specify if we want statically link the executable (for redistribution mainly)" FALSE) option(BUILD_TESTS "Specify whether we want to build tests or not" FALSE) +option(USE_BUNDLED_BLAS_WIN "Use the bundled openblas library on Windows when + not using AER_BLAS_LIB_PATH" TRUE) # Allow disabling conan for downstream package managers. Requires all libraries to be present in path # Default is value of environment variable if defined or ON @@ -237,7 +239,7 @@ else() set(BLA_VENDOR "OpenBLAS") endif() endif() - if(WIN32) + if(WIN32 AND USE_BUNDLED_BLAS_WIN) message(STATUS "Uncompressing OpenBLAS static library...") set(WIN_ARCH "win64" ) if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # Checking if win32 build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5c4958886..4f39f0b9b7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -966,6 +966,16 @@ These are the flags: Default: No value. Example: ``python ./setup.py bdist_wheel -- -DAER_BLAS_LIB_PATH=/path/to/look/for/blas/`` +* USE_BUNDLED_BLAS_WIN + + Tells CMake to use the bundled OpenBLAS library vendored into the source code when building on Windows. + When this option is set to `False`, CMake will use its standard method to search for the BLAS library aginst which to link instead of using the vendored version. + The `AER_BLAS_LIB_PATH` option takes precedence over this option. + + Values: True|False + Default: True + Example: ``python ./setup.py bdist_wheel -- -DUSE_BUNDLED_BLAS_WIN=FALSE`` + * BUILD_TESTS It will tell the build system to build C++ tests along with the simulator. diff --git a/releasenotes/notes/windows-blas-42b3dbc170c5ae94.yaml b/releasenotes/notes/windows-blas-42b3dbc170c5ae94.yaml new file mode 100644 index 0000000000..2a17a5544f --- /dev/null +++ b/releasenotes/notes/windows-blas-42b3dbc170c5ae94.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Added CMake option ``USE_BUNDLED_BLAS_WIN`` which allows CMake to search + for a BLAS library against which to link instead of using the OpenBLAS + library bundled into the repo.