Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake option USE_BUNDLED_BLAS_WIN #1940

Merged
merged 4 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/windows-blas-42b3dbc170c5ae94.yaml
Original file line number Diff line number Diff line change
@@ -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.
Loading