Skip to content

Commit

Permalink
♻️ miscellaneous changes pulled from #622 (#669)
Browse files Browse the repository at this point in the history
## Description

This PR pulls out a couple of changes from #662 that can go into the
library immediately, while that PR is still in draft.
Mostly fixes a couple of linter/compiler warnings and improves the
handling of Boost / boost_multiprecision.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [x] I have made sure that all CI jobs on GitHub pass.
- [x] The pull request introduces no new warnings and follows the
project's style guidelines.
  • Loading branch information
burgholzer authored Aug 13, 2024
2 parents b16e6e9 + 666f2c0 commit 942dd6a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ else()
endif()
endif()

option(USE_SYSTEM_BOOST "Whether to try to use the system Boost installation" ON)
option(USE_SYSTEM_BOOST "Whether to try to use the system Boost installation" OFF)
set(BOOST_MIN_VERSION
1.80.0
CACHE STRING "Minimum required Boost version")
find_package(Boost ${BOOST_MIN_VERSION} CONFIG QUIET)
if(NOT Boost_FOUND OR NOT USE_SYSTEM_BOOST)
if(USE_SYSTEM_BOOST)
find_package(Boost ${BOOST_MIN_VERSION} CONFIG REQUIRED)
else()
set(BOOST_MP_STANDALONE
ON
CACHE INTERNAL "Use standalone boost multiprecision")
Expand All @@ -54,14 +55,14 @@ if(NOT Boost_FOUND OR NOT USE_SYSTEM_BOOST)
set(BOOST_URL
https://github.com/boostorg/multiprecision/archive/refs/tags/Boost_${BOOST_VERSION}.tar.gz)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
FetchContent_Declare(boost_multiprecision URL ${BOOST_URL} FIND_PACKAGE_ARGS
${BOOST_MIN_VERSION} CONFIG)
list(APPEND FETCH_PACKAGES boost_multiprecision)
FetchContent_Declare(boost_mp URL ${BOOST_URL} FIND_PACKAGE_ARGS ${BOOST_MIN_VERSION} CONFIG
NAMES boost_multiprecision)
list(APPEND FETCH_PACKAGES boost_mp)
else()
find_package(boost_multiprecision ${BOOST_MIN_VERSION} QUIET CONFIG)
if(NOT boost_multiprecision_FOUND)
FetchContent_Declare(boost_multiprecision URL ${BOOST_URL})
list(APPEND FETCH_PACKAGES boost_multiprecision)
find_package(boost_mp ${BOOST_MIN_VERSION} QUIET CONFIG NAMES boost_multiprecision)
if(NOT boost_mp_FOUND)
FetchContent_Declare(boost_mp URL ${BOOST_URL})
list(APPEND FETCH_PACKAGES boost_mp)
endif()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion include/mqt-core/ir/operations/CompoundOperation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CompoundOperation final : public Operation {

[[nodiscard]] bool isNonUnitaryOperation() const override;

[[nodiscard]] inline bool isSymbolicOperation() const override;
[[nodiscard]] bool isSymbolicOperation() const override;

[[nodiscard]] bool isCustomGate() const;

Expand Down
2 changes: 1 addition & 1 deletion src/ir/parsers/QASM3Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class OpenQasm3Parser final : public InstVisitor {
}

for (uint64_t i = 0; i < qubit.second; ++i) {
qubits.emplace_back(qubit.first + i);
qubits.emplace_back(static_cast<qc::Qubit>(qubit.first + i));
}
}

Expand Down

0 comments on commit 942dd6a

Please sign in to comment.