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

Fix Windows (MSVC) builds for GPU simulators #787

Closed
atilag opened this issue Jun 9, 2020 · 4 comments · Fixed by #1065
Closed

Fix Windows (MSVC) builds for GPU simulators #787

atilag opened this issue Jun 9, 2020 · 4 comments · Fixed by #1065
Assignees
Labels
bug Something isn't working build system

Comments

@atilag
Copy link
Member

atilag commented Jun 9, 2020

Informations

  • Qiskit Aer version: All
  • Python version: All
  • Operating system: Windows

What is the current behavior?

There are build errors in GPU code while trying to build on Windows (MSVC).

Steps to reproduce the problem

> python setup.py bdist_wheel

What is the expected behavior?

We should be able to build without problems

Suggested solutions

We need to wait for pybind11 to release their new version and after testing that everything is still working and there are no regressions whatsoever, upgrade our dependencies.
There seems to be other errors related to the OpenMP version supported by MSVC and the presence of unsgined indices in parallelized loops.

@atilag atilag added the bug Something isn't working label Jun 9, 2020
@atilag atilag self-assigned this Jun 9, 2020
@MarcusGDaniels
Copy link
Contributor

What fixes are you looking for in pybind11? I have a Windows machine I could use to get it working. Yeah, I see the travis tests are failing. That's a drag.

@MarcusGDaniels
Copy link
Contributor

Here is one issue:

C:\Users\MarcusDaniels.conda\envs\QiskitDevEnv\Include\pybind11\cast.h(1495): error: expression must be a pointer to a complete object type

That's an operator defined like this:

explicit operator type&() { return *(this->value); }

@MarcusGDaniels
Copy link
Contributor

Ah, I see it has been fixed on their master branch:

pybind/pybind11@c776e9e

@MarcusGDaniels
Copy link
Contributor

MarcusGDaniels commented Aug 5, 2020

With pull request #859 and this change, and copying pybind11 headers to a toplevel include/ directory, and applying the patch above to cast.h, this build problem can be fixed. I'll make another pull request if you are willing to temporarily copy the latest pybind11 headers as a workaround until Conda updates its pybind11 package.

diff --git a/qiskit/providers/aer/backends/wrappers/CMakeLists.txt b/qiskit/providers/aer/backends/wrappers/CMakeLists.txt
index bef44c9..fa150c4 100644
--- a/qiskit/providers/aer/backends/wrappers/CMakeLists.txt
+++ b/qiskit/providers/aer/backends/wrappers/CMakeLists.txt
@@ -16,6 +16,9 @@ basic_pybind11_add_module(controller_wrappers "${AER_SIMULATOR_SOURCES}")
 if(AER_THRUST_BACKEND STREQUAL "CUDA")
     set_source_files_properties(bindings.cc PROPERTIES LANGUAGE CUDA)
     set_source_files_properties(${SIMD_SOURCE_FILE} PROPERTIES LANGUAGE CUDA)
+    if(MSVC)
+	    include_directories(BEFORE ../../../../../include)
+    endif()
     set_source_files_properties(bindings.cc PROPERTIES COMPILE_FLAGS "${CUDA_NVCC_FLAGS}")
 
     set(L ${SIMD_FLAGS_LIST})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants