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

Update Honeywell and IonQ backend info #581

Open
wants to merge 115 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
ae9b69f
Allow extenal googletest
sethrj Oct 13, 2023
f2198c3
Allow external boost
sethrj Oct 13, 2023
03f5bc6
Fix missing dependency include
sethrj Oct 13, 2023
5d71200
Mark packages as required
sethrj Oct 13, 2023
4f86428
Fix gtest name
sethrj Oct 13, 2023
9e2be86
Fix scoping
sethrj Oct 13, 2023
d6c9f0d
Fix cpr link
sethrj Oct 13, 2023
e6ec960
Remove duplicate linking
sethrj Oct 13, 2023
96bc8dc
Delete bad C++ library forcing flag
sethrj Oct 13, 2023
28fa86d
Use C++14 to avoid warnings
sethrj Oct 13, 2023
c6acbcf
Require older nljson to avoid build errors
sethrj Oct 16, 2023
e6c1597
fixup! Fix cpr link
sethrj Oct 16, 2023
d020914
Add fixes from submodules
sethrj Oct 16, 2023
5f8a34f
Update Honeywell url
wongey Nov 10, 2023
824abed
Update IonQ backend info
wongey Nov 10, 2023
739819e
Add IonQ bell example
wongey Nov 10, 2023
e6fa805
Turned annealing deprecated
danclaudino May 24, 2024
bbca6f6
Updated Boost submodule
danclaudino May 30, 2024
15396fb
Merge pull request #1 from danclaudino/deprecate_annealing
danclaudino May 31, 2024
e47d47b
Moved optimizers into quantum/plugins
danclaudino May 31, 2024
90e8ecf
Merge pull request #3 from danclaudino/optimizers_plugins
danclaudino May 31, 2024
187a3e7
Build gtest only if we are building tests
ausbin Jun 2, 2024
5329e78
Allow saying find_package(XACC 1.0.0)
ausbin Jun 2, 2024
7738f70
Updated cppmicroservices
danclaudino Jun 3, 2024
b214ff1
Merge pull request #2 from ORNL-QCI/master
danclaudino Jun 3, 2024
81184f0
Merge pull request #4 from ausbin/feature/build-tweaks
danclaudino Jun 4, 2024
d6093ec
Merge pull request #3 from danclaudino/cppmicroservices
danclaudino Jun 4, 2024
d669437
Merge pull request #5 from danclaudino/master
danclaudino Jun 4, 2024
62d658e
Implemented method to get only the basis rotations for measurements
danclaudino Jun 20, 2024
57e3b12
Tidying up
danclaudino Jun 20, 2024
85ba1b5
Merge pull request #10 from danclaudino/get_basis_rotations
danclaudino Jun 20, 2024
582a4a5
Update IonQ plugin
wongey Jun 23, 2024
faa66d7
Updated Accelerator and VQE to work with measurement bases
danclaudino Jun 24, 2024
702cfce
Reverting C++ Micro Services
danclaudino Jun 24, 2024
89707cb
Merge pull request #13 from danclaudino/revert_cppmicroservices
danclaudino Jun 24, 2024
ac6ef6a
Merge pull request #12 from danclaudino/execute_basis_rotations
danclaudino Jun 24, 2024
b240b76
Update IonQ Tester
wongey Jun 24, 2024
9441a26
Update ci-linux-python.yml
danclaudino Jun 25, 2024
fef5458
Update ci-linux-python.yml
danclaudino Jun 25, 2024
7b1cac0
Merge pull request #14 from ORNL-QCI/cma_numpy_fix
danclaudino Jun 25, 2024
c746af6
Merge pull request #11 from wongey/bugfix/ionq
danclaudino Jun 25, 2024
1370625
Merge remote-tracking branch 'upstream/master' into external
sethrj Jun 25, 2024
cc69995
Implemented Scipy optimizer plugin
danclaudino Jun 26, 2024
8054735
Tidying up scipy optimizer
danclaudino Jun 27, 2024
84b5b06
Merge pull request #15 from danclaudino/scipy_optimizer
danclaudino Jul 2, 2024
84eab52
Updated tpls/cppmicroservices to include recent updates
danclaudino Jul 2, 2024
6a58ee2
Merge pull request #16 from danclaudino/cppmicroservices_update
danclaudino Jul 3, 2024
86c4d3c
Updated boost/regex
danclaudino Jul 3, 2024
5cf2996
Merge pull request #20 from danclaudino/boost_regex
danclaudino Jul 3, 2024
6627d5d
Minimal build for QIREE
danclaudino Jul 9, 2024
2d0e58f
WIP
sethrj Jul 9, 2024
8974572
Cleaned up includes in PauliOperator.cpp
danclaudino Jul 9, 2024
fb3563d
Implemented GSL optimizers
danclaudino Jul 9, 2024
e7ed77d
Removed python stuff from QIREE build
danclaudino Jul 16, 2024
94fcd56
Merge pull request #22 from danclaudino/qiree_build
danclaudino Jul 17, 2024
de84690
Pulled latest NLOpt to fix Mac CI
danclaudino Jul 17, 2024
27d8611
Merge remote-tracking branch 'upstream/master' into external
sethrj Jul 19, 2024
306db5f
Move external 'option' with other options
sethrj Jul 19, 2024
c702a6e
Fix nlopt submodule
sethrj Jul 19, 2024
01c11aa
Updated HPC virtualization
danclaudino Jul 24, 2024
ec7b050
HPC virtualization clean-up
danclaudino Jul 25, 2024
6bcd980
Merge pull request #25 from danclaudino/hpc_virt_update
danclaudino Jul 25, 2024
0575273
Use targets for spdlog to fix "external fmt" error
sethrj Jul 29, 2024
887a021
Add build/install to gitignore
sethrj Jul 29, 2024
0a6cda4
Added option to disable remote accelerators
danclaudino Jul 29, 2024
7d914d5
Fix IWYU error
sethrj Jul 29, 2024
9fca533
Merge remote-tracking branch 'upstream/master' into external
sethrj Jul 29, 2024
e4250dd
Fix target linking
sethrj Jul 29, 2024
cb8d86d
Removed armadillo from qubit tapering
danclaudino Jul 29, 2024
2872d3b
Merge pull request #23 from danclaudino/nlopt_update
danclaudino Jul 29, 2024
85fca92
Merge pull request #27 from danclaudino/tapering_with_eigen
danclaudino Jul 29, 2024
4eb4cbb
Merge pull request #26 from danclaudino/disable_remote
danclaudino Jul 30, 2024
ab0bc3c
Changed optimizer in QAOATester to pass Mac CI tests
danclaudino Jul 30, 2024
98d4ded
Merge pull request #28 from danclaudino/qaoa_test_fix
danclaudino Jul 30, 2024
48f9d02
Fixed tpls/CmakeLists.txt to bypass cpr if remote accelerators are di…
danclaudino Jul 30, 2024
4c3ec83
Merge pull request #29 from danclaudino/fix_disable_remote
danclaudino Jul 30, 2024
b1ae8af
Update nlohmann_json to 3.11
sethrj Jul 31, 2024
e2b662f
Merge remote-tracking branch 'upstream/master' into external
sethrj Jul 31, 2024
7b712ff
Revert accidental changes due to merge conflicts
sethrj Aug 2, 2024
2e09a57
Merge pull request #30 from sethrj/json-update
danclaudino Aug 2, 2024
fc26536
Optimizer plugins can ignore optimizer failure
danclaudino Aug 5, 2024
f24fa36
Merge pull request #31 from danclaudino/optimizers_error_handling
danclaudino Aug 5, 2024
0742195
Merge remote-tracking branch 'upstream/master' into external
sethrj Aug 6, 2024
2a95ca0
Fix missing include directory
sethrj Aug 6, 2024
71455cc
Fix one last cpr issue
sethrj Aug 6, 2024
6a953fe
Fix iwyu issues causing mac build error
sethrj Aug 6, 2024
566d63a
Merge pull request #24 from sethrj/external
danclaudino Aug 6, 2024
f90851b
Merge branch 'master' into gsl_optimizer
danclaudino Aug 6, 2024
dc6e767
Fix install issue from implicit json/external conflict
sethrj Aug 7, 2024
d252ce2
Merge pull request #21 from danclaudino/gsl_optimizer
danclaudino Aug 7, 2024
8303746
Echo faulty JSON when honeywell response parsing fails
sethrj Aug 7, 2024
ef919eb
Merge pull request #33 from sethrj/fix-json
sethrj Aug 8, 2024
5eadf39
Added alternate spins ordering to chemistry Observable plugins
danclaudino Aug 9, 2024
d6b9249
Merge pull request #34 from danclaudino/alternate_spins
danclaudino Aug 9, 2024
8df5b16
Updated qsim submodule
danclaudino Aug 9, 2024
2f8765f
Merge pull request #35 from danclaudino/qsim_update
danclaudino Aug 9, 2024
ed2246a
Updated CI pipeline badge location
danclaudino Aug 9, 2024
c7dc85d
Merge pull request #37 from danclaudino/update_pipeline_badges
danclaudino Aug 12, 2024
6c5733c
Enabled IonQ noisy simulation
danclaudino Aug 21, 2024
61dc583
Merge pull request #39 from danclaudino/ionq_noisy_sim
wongey Aug 21, 2024
e179862
Removed armadillo from QITE
danclaudino Aug 22, 2024
5e4e1fa
Fixed bugs related to retrieval of matrix/vector dimensions
danclaudino Aug 23, 2024
e693896
Merge pull request #40 from danclaudino/qite_with_eigen
danclaudino Aug 23, 2024
12960d3
Removed armadillo from PauliOperator
danclaudino Aug 23, 2024
e1707f8
Merge pull request #41 from danclaudino/pauli_without_arma
danclaudino Aug 23, 2024
83c671f
Removed armadillo from QNG
danclaudino Aug 23, 2024
add8f23
Merge pull request #42 from danclaudino/qng_without_arma
danclaudino Aug 24, 2024
a03ca8d
Disabled iontrap plugin
danclaudino Aug 26, 2024
1c38b4c
Merge pull request #43 from danclaudino/disable_iontrap
danclaudino Aug 27, 2024
1a8fe00
Updated topdir CMakeLists.txt to handle iPOPO versions
danclaudino Aug 27, 2024
e44d419
Merge pull request #44 from danclaudino/ipopo_python_version
danclaudino Aug 27, 2024
88b8035
Cleaned cmake output
danclaudino Aug 27, 2024
af0be78
Merge pull request #45 from danclaudino/build_output_cleanup
danclaudino Aug 27, 2024
756a8d0
Renamed honeywell plugin
danclaudino Aug 27, 2024
b7e6ad8
Merge pull request #46 from danclaudino/honeywell_renaming
danclaudino Aug 27, 2024
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: 2 additions & 2 deletions .github/workflows/ci-linux-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: sudo apt-get -y update && sudo apt-get install -y --no-install-recommends ninja-build libssl-dev libcurl4-openssl-dev python3 libpython3-dev python3-pip libblas-dev liblapack-dev

- name: Install optional Python Packages
run: python3 -m pip install numpy pyscf cma
run: python3 -m pip install "numpy<=1.26.4" pyscf cma

- name: Configure
working-directory: build/
Expand All @@ -40,4 +40,4 @@ jobs:

- name: Test
working-directory: python/tests
run: export PYTHONPATH=$PYTHONPATH:~/.xacc && python3 -m unittest discover -s . -p '*_testing.py'
run: export PYTHONPATH=$PYTHONPATH:~/.xacc && python3 -m unittest discover -s . -p '*_testing.py'
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
*.out
*.app
/build/
/build-*/
/install/
/install-*/
/plugins/
/.cproject
/.project
Expand All @@ -49,4 +52,4 @@ compile_commands.json
.vscode/*
.theia/*
# Python test cache
__pycache__/
__pycache__/
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
url = https://github.com/ornl-qci/boost-cmake
[submodule "tpls/cppmicroservices"]
path = tpls/cppmicroservices
url = https://github.com/ornl-qci/cppmicroservices
url = https://github.com/ORNL-QCI/CppMicroServices.git
[submodule "quantum/plugins/dwave/embedding/minorminer"]
path = quantum/plugins/dwave/embedding/minorminer
url = https://github.com/dwavesystems/minorminer
[submodule "xacc/optimizer/nlopt-optimizers/nlopt"]
path = xacc/optimizer/nlopt-optimizers/nlopt
[submodule "tpls/nlopt"]
path = tpls/nlopt
url = https://github.com/stevengj/nlopt
[submodule "quantum/plugins/dwave/tpls/legacy-sapi-clients"]
path = quantum/plugins/dwave/tpls/legacy-sapi-clients
Expand All @@ -21,7 +21,7 @@
url = https://github.com/ORNL-QCI/TriQ.git
[submodule "tpls/qsim"]
path = tpls/qsim
url = https://github.com/ORNL-QCI/qsim.git
url = https://github.com/quantumlib/qsim.git
[submodule "tpls/pybind11"]
path = tpls/pybind11
url = https://github.com/pybind/pybind11.git
Expand Down
197 changes: 128 additions & 69 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,58 @@ set(CMAKE_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
message(STATUS "C++ version ${CXX_STANDARD} configured.")

if(NOT WIN32)
string(ASCII 27 Esc)
set(ColorReset "${Esc}[m")
set(ColorBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()

option(XACC_BUILD_TESTS "Build test programs" OFF)
option(XACC_BUILD_EXAMPLES "Build example programs" OFF)
option(XACC_ENSMALLEN_INCLUDE_DIR "Path to ensmallen.hpp for mlpack optimizer" "")
option(XACC_ARMADILLO_INCLUDE_DIR "Path to armadillo header for mlpack optimizer" "")
option(XACC_BUILD_SCIPY "Build Scipy optimizer plugin" OFF)
option(XACC_BUILD_ANNEALING "Build annealing libraries" OFF)
option(XACC_BUILD_GSL "Build GNU Scientific Library optimizer plugin" OFF)
option(XACC_BUILD_IONTRAP "Build the iontrap plugin" OFF)
option(XACC_BUILD_SCIKIT_QUANT "Build the Scikit-quant plugin" OFF)
option(XACC_BUILD_ATOS "Build the Atos QLM plugin" OFF)
option(XACC_BUILD_QFACTOR "Build the QFactor plugin" OFF)
option(XACC_BUILD_QSEARCH "Build the QSearch plugin" OFF)
option(XACC_BUILD_QRACK "Build the Qrack plugin" OFF)

if(XACC_BUILD_ANNEALING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DANNEALING_ENABLED")
else()
message(STATUS "${BoldYellow}Skipping Annealing libraries by default. You can turn it on with -DXACC_BUILD_ANNEALING=ON${ColorReset}")
endif()

option(QIREE_MINIMAL_BUILD "Build only components for QIREE CI" OFF)
option(XACC_DEPS_EXTERNAL "Try find external dependencies (system installation) rather than tpls" OFF)

if(QIREE_MINIMAL_BUILD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQIREE_BUILD")
endif()

option(XACC_REMOTE_ACCELERATORS "Build remove (cloud) accelerators" ON)
if(NOT XACC_REMOTE_ACCELERATORS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREMOTE_DISABLED")
message(STATUS "${BoldYellow}Skipping remote accelerators. Only local simulators are now enabled.{ColorReset}")
endif()

if(FROM_SETUP_PY AND NOT APPLE)
message(STATUS "Running build from setup.py, linking to static libstdc++")
Expand Down Expand Up @@ -79,26 +127,6 @@ include(format)
include(cxxFlags)
include(ExternalProject)

if(NOT WIN32)
string(ASCII 27 Esc)
set(ColorReset "${Esc}[m")
set(ColorBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
endif()

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.xacc" CACHE PATH "default install path" FORCE)
endif()
Expand Down Expand Up @@ -138,7 +166,9 @@ add_compile_flags_if_supported(-Wno-maybe-uninitialized)
# Check MPI status
# if MPI_CXX_COMPILER is not empty and XACC_ENABLE_MPI is set
# turn MPI_ENABLED on
if(NOT MPI_CXX_COMPILER STREQUAL "" AND XACC_ENABLE_MPI)
# Update: we don't really need to give the path to the compiler
# because if MPI is found, MPI_CXX_COMPILER is populated
if(XACC_ENABLE_MPI)
find_package(MPI)

if(MPI_FOUND)
Expand All @@ -148,6 +178,15 @@ if(NOT MPI_CXX_COMPILER STREQUAL "" AND XACC_ENABLE_MPI)
endif()
endif()

if (XACC_DEPS_EXTERNAL)
find_package(Boost COMPONENTS graph)
find_package(cpr)
if(cpr_FOUND)
set(XACC_USE_EXTERNAL_CPR ON)
endif()
find_package(GTest)
endif()

include_directories(${CMAKE_BINARY_DIR}/tpls/cppmicroservices/include)
add_subdirectory(tpls)

Expand All @@ -160,28 +199,27 @@ ENDIF()
find_package(LAPACK)

# Dependencies:
option(XACC_DEPS_EXTERNAL "Try find external dependencies (system installation) rather than tpls" OFF)

set(SPDLOG_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/tpls/spdlog/include/)
if (XACC_DEPS_EXTERNAL)
find_package(spdlog)
if (spdlog_FOUND)
get_target_property(SPDLOG_TARGET_INC_DIR spdlog::spdlog_header_only INTERFACE_INCLUDE_DIRECTORIES)
if (EXISTS ${SPDLOG_TARGET_INC_DIR}/spdlog/spdlog.h)
# Found a seemingly valid spdlog installation, use it when XACC_DEPS_EXTERNAL is set
message(STATUS "${BoldGreen}spdlog: Found system installation at ${SPDLOG_TARGET_INC_DIR}/spdlog${ColorReset}")
set(SPDLOG_INCLUDE_DIR "${SPDLOG_TARGET_INC_DIR}")
endif()
endif()


if (XACC_DEPS_EXTERNAL)
find_package(spdlog)
endif()
if(NOT spdlog_FOUND)
# Create an interface target to the vendored spdlog
set(SPDLOG_INCLUDE_DIR "${SPDLOG_TARGET_INC_DIR}")
add_library(spdlog::spdlog INTERFACE IMPORTED)
target_include_directories(spdlog::spdlog INTERFACE
"${PROJECT_SOURCE_DIR}/tpls/spdlog/include"
)
endif()

set(NLOHMANN_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/tpls/nlohmann/single_include)
if (XACC_DEPS_EXTERNAL)
find_package(nlohmann_json)
if (nlohmann_json_FOUND)
get_target_property(NLOHMANN_TARGET_INC_DIR nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
if (XACC_DEPS_EXTERNAL)
find_package(nlohmann_json)
if (nlohmann_json_FOUND)
get_target_property(NLOHMANN_TARGET_INC_DIR nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
list(GET NLOHMANN_TARGET_INC_DIR 0 NLOHMANN_TARGET_INC_DIR)
if (EXISTS ${NLOHMANN_TARGET_INC_DIR}/nlohmann/json.hpp)
if (EXISTS ${NLOHMANN_TARGET_INC_DIR}/nlohmann/json.hpp)
# Found a seemingly valid nlohmann installation, use it when XACC_DEPS_EXTERNAL is set
message(STATUS "${BoldGreen}nlohmann: Found system installation at ${NLOHMANN_TARGET_INC_DIR}/nlohmann${ColorReset}")
set(NLOHMANN_INCLUDE_DIR "${NLOHMANN_TARGET_INC_DIR}")
Expand All @@ -190,9 +228,9 @@ if (XACC_DEPS_EXTERNAL)
endif()

set(EIGEN_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/tpls/eigen)
if (XACC_DEPS_EXTERNAL)
find_package(Eigen3)
if (Eigen3_FOUND)
if (XACC_DEPS_EXTERNAL)
find_package(Eigen3)
if (Eigen3_FOUND)
message(STATUS "${BoldGreen}Eigen3: Found system installation (version ${EIGEN3_VERSION_STRING}) config at ${Eigen3_DIR}; include directory: ${EIGEN3_INCLUDE_DIR}.${ColorReset}")
set(EIGEN_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR})
endif()
Expand All @@ -201,37 +239,47 @@ endif()
add_subdirectory(xacc)
add_subdirectory(quantum)

find_package(Python COMPONENTS Interpreter Development)

if(Python_FOUND)
if(${Python_VERSION} VERSION_GREATER_EQUAL 3.0.0)
message(STATUS "${BoldGreen}Found Python version ${Python_VERSION}. Building XACC Python API with ${Python_INCLUDE_DIRS}${ColorReset}")
add_subdirectory(python)
add_subdirectory(${CMAKE_SOURCE_DIR}/quantum/python)

# Double check we have module ipopo installed, contributes pelix
execute_process(COMMAND ${Python_EXECUTABLE} -c "import pelix" RESULT_VARIABLE PELIX_EXISTS)
# qiree doesn't need python, so we can ignore this and everything else that is python related
if(NOT QIREE_MINIMAL_BUILD)

if(PELIX_EXISTS EQUAL "1")
# if not, check we have pip
execute_process(COMMAND ${Python_EXECUTABLE} -c "import pip" RESULT_VARIABLE PIP_EXISTS)
find_package(Python COMPONENTS Interpreter Development)

if(PIP_EXISTS EQUAL "0")
# we have pip, son just install ipopo
message(STATUS "${BoldGreen}Installing Pelix OSGi framework.${ColorReset}")
execute_process(COMMAND ${Python_EXECUTABLE} -m pip install ipopo)
if(Python_FOUND)
if(${Python_VERSION} VERSION_GREATER_EQUAL 3.0.0)
message(STATUS "${BoldGreen}Found Python version ${Python_VERSION}. Building XACC Python API with ${Python_INCLUDE_DIRS}${ColorReset}")
add_subdirectory(python)
add_subdirectory(${CMAKE_SOURCE_DIR}/quantum/python)

# Double check we have module ipopo installed, contributes pelix
execute_process(COMMAND ${Python_EXECUTABLE} -c "import pelix" RESULT_VARIABLE PELIX_EXISTS)

if(PELIX_EXISTS EQUAL "1")
# if not, check we have pip
execute_process(COMMAND ${Python_EXECUTABLE} -c "import pip" RESULT_VARIABLE PIP_EXISTS)

if(PIP_EXISTS EQUAL "0")
# we have pip, son just install ipopo
message(STATUS "${BoldGreen}Installing Pelix OSGi framework.${ColorReset}")
# iPOPO 3.0 only works with python 3.10+
if(${Python_VERSION} VERSION_GREATER_EQUAL 3.10.0)
execute_process(COMMAND ${Python_EXECUTABLE} -m pip install ipopo)
else()
execute_process(COMMAND ${Python_EXECUTABLE} -m pip install ipopo==1.0.2)
endif()
else()
# we dont have pip, so warn the user
message(STATUS "${BoldYellow}Pelix Framework not found, but can't install via pip. Ensure you install ipopo module before using XACC Python API.${ColorReset}")
endif()
else()
# we dont have pip, so warn the user
message(STATUS "${BoldYellow}Pelix Framework not found, but can't install via pip. Ensure you install ipopo module before using XACC Python API.${ColorReset}")
message(STATUS "${BoldGreen}Found Pelix framework.${ColorReset}")
endif()
else()
message(STATUS "${BoldGreen}Found Pelix framework.${ColorReset}")
message(STATUS "${BoldYellow}Found Python version ${Python_VERSION}. Version must be greater than 3.0.0, skipping Python API build.${ColorReset}")
endif()
else()
message(STATUS "${BoldYellow}Found Python version ${Python_VERSION}. Version must be greater than 3.0.0, skipping Python API build.${ColorReset}")
message(STATUS "${BoldYellow}Python interpreter or development headers not found. Skipping Python API build.${ColorReset}")
endif()
else()
message(STATUS "${BoldYellow}Python interpreter or development headers not found. Skipping Python API build.${ColorReset}")

endif()

# Version info
Expand All @@ -244,17 +292,28 @@ set(PATCH_VERSION 0)
# their CMake builds, and pass -DXACC_DIR=/path/to/install/xacc
# and CMake loads include paths, libs, etc
configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc-config.cmake.in" "${CMAKE_BINARY_DIR}/xacc-config.cmake" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/cmake/xacc-config-version.cmake.in" "${CMAKE_BINARY_DIR}/xacc-config-version.cmake" @ONLY)
install(FILES "${CMAKE_BINARY_DIR}/xacc-config.cmake" DESTINATION .)
install(FILES "${CMAKE_BINARY_DIR}/xacc-config-version.cmake" DESTINATION .)
install(FILES "${CMAKE_SOURCE_DIR}/cmake/Modules/format.cmake" DESTINATION share/xacc/)
install(FILES "${CMAKE_SOURCE_DIR}/tpls/mpark-variant/variant.hpp" DESTINATION include/xacc/)
install(FILES "${CMAKE_SOURCE_DIR}/tpls/taocpp/operators.hpp" DESTINATION include/xacc/)
install(FILES "${NLOHMANN_INCLUDE_DIR}/nlohmann/json.hpp" DESTINATION include/xacc/)
if(NOT XACC_DEPS_EXTERNAL OR NOT nlohmann_json_FOUND)
install(FILES "${NLOHMANN_INCLUDE_DIR}/nlohmann/json.hpp" DESTINATION include/xacc/)
endif()

install(DIRECTORY "${SPDLOG_INCLUDE_DIR}" DESTINATION include/spdlog/)
if(NOT XACC_DEPS_EXTERNAL OR NOT spdlog_FOUND)
install(DIRECTORY "${SPDLOG_INCLUDE_DIR}" DESTINATION include/spdlog/)
endif()
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/exprtk" DESTINATION include)
install(DIRECTORY "${EIGEN_INCLUDE_DIR}" DESTINATION include)
if(NOT XACC_DEPS_EXTERNAL OR NOT Eigen3_FOUND)
install(DIRECTORY "${EIGEN_INCLUDE_DIR}" DESTINATION include)
endif()
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/rapidjson" DESTINATION include)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/pybind11" DESTINATION include)

if(NOT QIREE_MINIMAL_BUILD)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/tpls/pybind11" DESTINATION include)
endif()

if(XACC_CPACK_DEB_PLATFORM)
message(STATUS "CPack DEB Build Enabled.")
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

| Branch | Status |
|:-------|:-------|
|master | [![Linux CI](https://github.com/eclipse/xacc/actions/workflows/ci-linux.yml/badge.svg?branch=master)](https://github.com/eclipse/xacc/actions/workflows/ci-linux.yml) [![Mac CI](https://github.com/eclipse/xacc/actions/workflows/ci-mac.yml/badge.svg?branch=master)](https://github.com/eclipse/xacc/actions/workflows/ci-mac.yml) |
|devel | [![Linux CI](https://github.com/eclipse/xacc/actions/workflows/ci-linux.yml/badge.svg?branch=xacc-devel)](https://github.com/eclipse/xacc/actions/workflows/ci-linux.yml) [![Mac CI](https://github.com/eclipse/xacc/actions/workflows/ci-mac.yml/badge.svg?branch=xacc-devel)](https://github.com/eclipse/xacc/actions/workflows/ci-mac.yml)|
|master | [![Linux CI](https://github.com/ORNL-QCI/xacc/actions/workflows/ci-linux.yml/badge.svg?branch=master)](https://github.com/ORNL-QCI/xacc/actions/workflows/ci-linux.yml) [![Mac CI](https://github.com/ORNL-QCI/xacc/actions/workflows/ci-mac.yml/badge.svg?branch=master)](https://github.com/ORNL-QCI/xacc/actions/workflows/ci-mac.yml) |


## Language and Hardware Independent Quantum Programming Framework
Expand Down
8 changes: 8 additions & 0 deletions cmake/xacc-config-version.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(PACKAGE_VERSION "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@")
# The quotes for the right operand are intentional here: if CMake executes this
# file without ${PACKAGE_FIND_VERSION} set, then if() will still get three
# operands. Without the quotes, if() will only get two operands in that case,
# throwing an error.
if(${PACKAGE_VERSION} VERSION_GREATER_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE 1)
endif()
4 changes: 0 additions & 4 deletions cmake/xacc-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ if(NOT TARGET format)
endif()

# Set version info
set(XACC_VERSION_MAJOR @MAJOR_VERSION@)
set(XACC_VERSION_MINOR @MINOR_VERSION@)
set(XACC_VERSION_PATCH @PATCH_VERSION@)
set(XACC_VERSION_SUFFIX @XACC_BUILD_VERSION@)
set(XACC_VERSION "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@-@XACC_BUILD_VERSION@")

set(XACC_LIBRARY_DIR "${XACC_ROOT}/lib")

Expand Down
6 changes: 5 additions & 1 deletion python/compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}

target_include_directories(${LIBRARY_NAME} PRIVATE . generated
${CMAKE_SOURCE_DIR}/tpls/antlr/runtime/src)
target_link_libraries(${LIBRARY_NAME} PUBLIC xacc xacc-quantum-gate xacc-quantum-annealing ${ANTLR_LIB})
if(XACC_BUILD_ANNEALING)
target_link_libraries(${LIBRARY_NAME} PUBLIC xacc xacc-quantum-gate xacc-quantum-annealing ${ANTLR_LIB})
else()
target_link_libraries(${LIBRARY_NAME} PUBLIC xacc xacc-quantum-gate ${ANTLR_LIB})
endif()

if(APPLE)
set_target_properties(${LIBRARY_NAME} PROPERTIES INSTALL_RPATH "@loader_path/../lib")
Expand Down
Loading