Skip to content

Commit

Permalink
Add Windows Openblas+lapack (#875)
Browse files Browse the repository at this point in the history
* Use openblas+lapack in win
* Use openblas shared lib
  • Loading branch information
vvilpas authored Aug 12, 2020
1 parent d3865d4 commit c1ee3e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ else()
if(WIN32)
message(STATUS "Uncompressing OpenBLAS static library...")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar "xvfj" "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/openblas.7z" WORKING_DIRECTORY "${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/")
set(OPENBLAS_DLLs
"${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/openblas.dll"
"${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/flang.dll"
"${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/flangrti.dll"
"${AER_SIMULATOR_CPP_SRC_DIR}/third-party/win64/lib/libomp.dll")
endif()
find_package(BLAS QUIET)
if(NOT BLAS_FOUND)
Expand Down Expand Up @@ -319,6 +324,13 @@ else() # Standalone build
PRIVATE ${AER_SIMULATOR_CPP_EXTERNAL_LIBS})
target_compile_definitions(qasm_simulator
PRIVATE ${AER_COMPILER_DEFINITIONS})
if(WIN32 AND NOT BLAS_LIB_PATH)
add_custom_command(TARGET qasm_simulator POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPENBLAS_DLLs}
$<TARGET_FILE_DIR:qasm_simulator>)
install(FILES ${OPENBLAS_DLLs} DESTINATION bin)
endif()

install(TARGETS qasm_simulator DESTINATION bin)

# Linter
Expand Down
2 changes: 2 additions & 0 deletions qiskit/providers/aer/backends/wrappers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ install(TARGETS controller_wrappers LIBRARY DESTINATION qiskit/providers/aer/bac
# Install redistributable dependencies
if(APPLE)
install(FILES "${CONAN_LIB_DIRS_LLVM-OPENMP}/libomp.dylib" DESTINATION qiskit/providers/aer/backends)
elseif(WIN32 AND NOT BLAS_LIB_PATH)
install(FILES ${OPENBLAS_DLLs} DESTINATION qiskit/providers/aer/backends)
endif()
Binary file modified src/third-party/win64/lib/openblas.7z
Binary file not shown.

0 comments on commit c1ee3e2

Please sign in to comment.