quantumlib/qsim

Installation from source using system pybind11 broken (and likely never worked)

basnijholt opened this issue · 1 comments

When using a locally installed pybind11 this is detected during pip install . in

/home/bn/qsim/pybind_interface/sse/../pybind_main.h:18:10: fatal error: pybind11/complex.h: No such file or directory
   18 | #include <pybind11/complex.h>

This is because in e.g., pybind_interface/basic/CMakeLists.txt:

pybind11_add_module(qsim_basic pybind_main_basic.cpp)

There is a call to pybind11_add_module, which is only exists when the pybind11 source code is downloaded. This happens when in pybind_interface/GetPybind11.cmake the if condition becomes true:

find_package(pybind11 "${MIN_PYBIND_VERSION}" CONFIG)
if((NOT pybind11_FOUND) AND (NOT pybind11_POPULATED)) # check first on system path, then attempt git fetch
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
endif()

If you want to support a system level pybind11 (I am trying to compile qsim for conda-forge here conda-forge/staged-recipes#24504) this problem needs to be resolved.

Should now be fixed in v0.20.0 🎉