Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

sampler_test.cpp build failed with "qrmi.h: No such file or directory" error

Đang mở Phù hợp với người mới
#140 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cpp
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với samples/sampler_test.cpp và so sánh service header được include trong đó với service/qiskit_runtime_service.hpp và service/qiskit_runtime_service_qrmi.hpp. Làm theo các bước build trong README cho qiskit và qiskit-ibm-runtime-c, sau đó build lại các samples; hoàn tất khi sampler_test.cpp build được mà không gặp lỗi thiếu qrmi.h.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Environment
  • Qiskit C++ Version: Git clone from the latest main branch (2026/03/09)

  • Qiskit Version: Git clone from the latest main branch (2026/03/09)

  • C++ Compiler: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-11)

  • Operating system: Rocky 9 Linux (x86_64)

  • Underlying API client: qiskit-ibm-runtime-c

What is happening?

Building sampler_test.cpp failed with "qrmi.h: No such file or directory".

[root@login build]# cmake -DQISKIT_ROOT=/shared/sandbox/qiskit-cpp/qiskit -DQISKIT_IBM_RUNTIME_C_ROOT=/shared/sandbox/qiskit-cpp/qiskit-ibm-runtime-c ..
-- The CXX compiler identification is GNU 11.5.0
-- The C compiler identification is GNU 11.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1282 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  CMakeLists.txt:21 (FetchContent_Declare)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Using the multi-header code from /shared/sandbox/qiskit-cpp/qiskit-cpp/samples/build/_deps/json-src/include/
   Qiskit Root = /shared/sandbox/qiskit-cpp/qiskit
   Qiskit Root = /shared/sandbox/qiskit-cpp/qiskit
   Qiskit Root = /shared/sandbox/qiskit-cpp/qiskit
   Qiskit Root = /shared/sandbox/qiskit-cpp/qiskit
-- Configuring done (1.3s)
-- Generating done (0.0s)
-- Build files have been written to: /shared/sandbox/qiskit-cpp/qiskit-cpp/samples/build
((pyenv) ) [root@login build]# make
[ 12%] Building CXX object CMakeFiles/circuit_test.dir/circuit_test.cpp.o
[ 25%] Linking CXX executable circuit_test
[ 25%] Built target circuit_test
[ 37%] Building CXX object CMakeFiles/observable_test.dir/observable_test.cpp.o
[ 50%] Linking CXX executable observable_test
[ 50%] Built target observable_test
[ 62%] Building CXX object CMakeFiles/sampler_test.dir/sampler_test.cpp.o
In file included from /shared/sandbox/qiskit-cpp/qiskit-cpp/samples/../src/providers/qrmi_backend.hpp:22,
                 from /shared/sandbox/qiskit-cpp/qiskit-cpp/samples/../src/service/qiskit_runtime_service_qrmi.hpp:25,
                 from /shared/sandbox/qiskit-cpp/qiskit-cpp/samples/sampler_test.cpp:25:
/shared/sandbox/qiskit-cpp/qiskit-cpp/samples/../src/providers/qrmi_job.hpp:27:10: fatal error: qrmi.h: No such file or directory
   27 | #include "qrmi.h"
      |          ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/sampler_test.dir/build.make:76: CMakeFiles/sampler_test.dir/sampler_test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:158: CMakeFiles/sampler_test.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
How can we reproduce the issue?

Follow the README

  • Clone qiskit repo and "make c"
  • Clone qiskit-ibm-runtime-c and build
  • Clone qiskit-cpp repo and build sample
What should happen?

Samples should be built with qiskit-ibm-runtime-c.

Any suggestions?

I think sampler_test.cpp should have

#include "service/qiskit_runtime_service.hpp"

instead of

#include "service/qiskit_runtime_service_qrmi.hpp"

No response

Ngôn ngữ chính
C++
Star
41
Fork
26
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Qiskit/qiskit-cpp

Tất cả issue của Qiskit/qiskit-cpp

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.