diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 8cb69732d3..085a5ae22d 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -74,5 +74,11 @@ jobs: if: github.event_name != 'schedule' run: | PKGPATH=`./rootpath tket.json tket` - cd ${PKGPATH}/bin && valgrind --error-exitcode=1 ./test-tket + echo "Package path: ${PKGPATH}" + echo "Contents" + find $PKGPATH + echo "Changing to bin directory" + cd ${PKGPATH}/bin + find + valgrind --error-exitcode=1 ./test-tket diff --git a/flake.lock b/flake.lock index dacae6f678..1ff706a830 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1721812269, - "narHash": "sha256-qcI00YJBrLMmyPktlTS0UUvX/qGA7tVp73K6lJpRdy4=", + "lastModified": 1721906734, + "narHash": "sha256-NU8lvif2nGmJnk5UwMwTtrPLTWTW2KtqRrC9c6zxvVQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5c31ee6b23a06da40bf2dfc9017a60308a4adc53", + "rev": "62a20c2a9c543c076df06c482efc37ff91b2aff2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 44dddc80e0..fdaae8c443 100644 --- a/flake.nix +++ b/flake.nix @@ -27,9 +27,10 @@ }; devShells = { default = pkgs.mkShell { buildInputs = [ pkgs.tket pkgs.pytket ]; }; + conan = pkgs.mkShell { buildInputs = with pkgs; [ conan cmake ninja gcc python3 ccache ]; }; }; checks = { - tket-tests = pkgs.run-tket-tests; + tket-tests = pkgs.tket; pytket-tests = pkgs.pytket; }; }); diff --git a/libs/tktokenswap/CMakeLists.txt b/libs/tktokenswap/CMakeLists.txt index bfb24d1fe7..1555cfa529 100644 --- a/libs/tktokenswap/CMakeLists.txt +++ b/libs/tktokenswap/CMakeLists.txt @@ -70,7 +70,7 @@ target_include_directories(tktokenswap PUBLIC $) target_link_libraries(tktokenswap PRIVATE tklog::tklog) target_link_libraries(tktokenswap PUBLIC tkassert::tkassert) -target_link_libraries(tktokenswap PRIVATE tkrng::tkrng) +target_link_libraries(tktokenswap PUBLIC tkrng::tkrng) target_link_libraries(tktokenswap PRIVATE Boost::headers) IF(APPLE) diff --git a/libs/tktokenswap/include/tktokenswap/BestFullTsa.hpp b/libs/tktokenswap/include/tktokenswap/BestFullTsa.hpp index 385f03ee20..dec47c591d 100644 --- a/libs/tktokenswap/include/tktokenswap/BestFullTsa.hpp +++ b/libs/tktokenswap/include/tktokenswap/BestFullTsa.hpp @@ -14,9 +14,9 @@ #pragma once -#include "HybridTsa.hpp" -#include "SwapListOptimiser.hpp" -#include "SwapListTableOptimiser.hpp" +#include "tktokenswap/HybridTsa.hpp" +#include "tktokenswap/SwapListOptimiser.hpp" +#include "tktokenswap/SwapListTableOptimiser.hpp" namespace tket { diff --git a/libs/tktokenswap/include/tktokenswap/CyclesCandidateManager.hpp b/libs/tktokenswap/include/tktokenswap/CyclesCandidateManager.hpp index 894cfe6905..66aba74095 100644 --- a/libs/tktokenswap/include/tktokenswap/CyclesCandidateManager.hpp +++ b/libs/tktokenswap/include/tktokenswap/CyclesCandidateManager.hpp @@ -16,8 +16,8 @@ #include -#include "CyclesGrowthManager.hpp" -#include "PartialTsaInterface.hpp" +#include "tktokenswap/CyclesGrowthManager.hpp" +#include "tktokenswap/PartialTsaInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/CyclesPartialTsa.hpp b/libs/tktokenswap/include/tktokenswap/CyclesPartialTsa.hpp index c35d3e8070..4cc5d7be6e 100644 --- a/libs/tktokenswap/include/tktokenswap/CyclesPartialTsa.hpp +++ b/libs/tktokenswap/include/tktokenswap/CyclesPartialTsa.hpp @@ -14,8 +14,8 @@ #pragma once -#include "CyclesCandidateManager.hpp" -#include "PartialTsaInterface.hpp" +#include "tktokenswap/CyclesCandidateManager.hpp" +#include "tktokenswap/PartialTsaInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/DistanceFunctions.hpp b/libs/tktokenswap/include/tktokenswap/DistanceFunctions.hpp index 5438b3afa1..9ca39f5727 100644 --- a/libs/tktokenswap/include/tktokenswap/DistanceFunctions.hpp +++ b/libs/tktokenswap/include/tktokenswap/DistanceFunctions.hpp @@ -18,8 +18,8 @@ #include #include -#include "VertexMappingFunctions.hpp" #include "tktokenswap/DistancesInterface.hpp" +#include "tktokenswap/VertexMappingFunctions.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/ExactMappingLookup.hpp b/libs/tktokenswap/include/tktokenswap/ExactMappingLookup.hpp index 700a8438ef..3c91d23d73 100644 --- a/libs/tktokenswap/include/tktokenswap/ExactMappingLookup.hpp +++ b/libs/tktokenswap/include/tktokenswap/ExactMappingLookup.hpp @@ -14,7 +14,7 @@ #pragma once -#include "CanonicalRelabelling.hpp" +#include "tktokenswap/CanonicalRelabelling.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/FilteredSwapSequences.hpp b/libs/tktokenswap/include/tktokenswap/FilteredSwapSequences.hpp index cb592c7db9..75e88b0967 100644 --- a/libs/tktokenswap/include/tktokenswap/FilteredSwapSequences.hpp +++ b/libs/tktokenswap/include/tktokenswap/FilteredSwapSequences.hpp @@ -17,7 +17,7 @@ #include #include -#include "SwapConversion.hpp" +#include "tktokenswap/SwapConversion.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/HybridTsa.hpp b/libs/tktokenswap/include/tktokenswap/HybridTsa.hpp index 5610f90719..bc10fceff5 100644 --- a/libs/tktokenswap/include/tktokenswap/HybridTsa.hpp +++ b/libs/tktokenswap/include/tktokenswap/HybridTsa.hpp @@ -14,8 +14,8 @@ #pragma once -#include "CyclesPartialTsa.hpp" -#include "TrivialTSA.hpp" +#include "tktokenswap/CyclesPartialTsa.hpp" +#include "tktokenswap/TrivialTSA.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/PartialMappingLookup.hpp b/libs/tktokenswap/include/tktokenswap/PartialMappingLookup.hpp index 6267b8cd7a..063dfc01bb 100644 --- a/libs/tktokenswap/include/tktokenswap/PartialMappingLookup.hpp +++ b/libs/tktokenswap/include/tktokenswap/PartialMappingLookup.hpp @@ -19,7 +19,7 @@ #include #include -#include "ExactMappingLookup.hpp" +#include "tktokenswap/ExactMappingLookup.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/PartialTsaInterface.hpp b/libs/tktokenswap/include/tktokenswap/PartialTsaInterface.hpp index 60db0b71d9..6a4766e4b0 100644 --- a/libs/tktokenswap/include/tktokenswap/PartialTsaInterface.hpp +++ b/libs/tktokenswap/include/tktokenswap/PartialTsaInterface.hpp @@ -14,10 +14,10 @@ #pragma once -#include "DistancesInterface.hpp" -#include "NeighboursInterface.hpp" -#include "RiverFlowPathFinder.hpp" -#include "VertexMappingFunctions.hpp" +#include "tktokenswap/DistancesInterface.hpp" +#include "tktokenswap/NeighboursInterface.hpp" +#include "tktokenswap/RiverFlowPathFinder.hpp" +#include "tktokenswap/VertexMappingFunctions.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/RiverFlowPathFinder.hpp b/libs/tktokenswap/include/tktokenswap/RiverFlowPathFinder.hpp index f83a397164..806c9df7d8 100644 --- a/libs/tktokenswap/include/tktokenswap/RiverFlowPathFinder.hpp +++ b/libs/tktokenswap/include/tktokenswap/RiverFlowPathFinder.hpp @@ -19,8 +19,8 @@ #include #include -#include "DistancesInterface.hpp" -#include "NeighboursInterface.hpp" +#include "tktokenswap/DistancesInterface.hpp" +#include "tktokenswap/NeighboursInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/SwapListOptimiser.hpp b/libs/tktokenswap/include/tktokenswap/SwapListOptimiser.hpp index 24a774fa3f..0756af35b9 100644 --- a/libs/tktokenswap/include/tktokenswap/SwapListOptimiser.hpp +++ b/libs/tktokenswap/include/tktokenswap/SwapListOptimiser.hpp @@ -14,7 +14,7 @@ #pragma once -#include "DynamicTokenTracker.hpp" +#include "tktokenswap/DynamicTokenTracker.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/SwapListSegmentOptimiser.hpp b/libs/tktokenswap/include/tktokenswap/SwapListSegmentOptimiser.hpp index 1379976b74..9dd61f72b5 100644 --- a/libs/tktokenswap/include/tktokenswap/SwapListSegmentOptimiser.hpp +++ b/libs/tktokenswap/include/tktokenswap/SwapListSegmentOptimiser.hpp @@ -19,9 +19,9 @@ #include #include -#include "PartialMappingLookup.hpp" -#include "VertexMapResizing.hpp" +#include "tktokenswap/PartialMappingLookup.hpp" #include "tktokenswap/SwapFunctions.hpp" +#include "tktokenswap/VertexMapResizing.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/SwapListTableOptimiser.hpp b/libs/tktokenswap/include/tktokenswap/SwapListTableOptimiser.hpp index 7b898d165f..3006387fdc 100644 --- a/libs/tktokenswap/include/tktokenswap/SwapListTableOptimiser.hpp +++ b/libs/tktokenswap/include/tktokenswap/SwapListTableOptimiser.hpp @@ -17,10 +17,10 @@ #include -#include "PartialMappingLookup.hpp" -#include "SwapListSegmentOptimiser.hpp" -#include "VertexMapResizing.hpp" +#include "tktokenswap/PartialMappingLookup.hpp" #include "tktokenswap/SwapListOptimiser.hpp" +#include "tktokenswap/SwapListSegmentOptimiser.hpp" +#include "tktokenswap/VertexMapResizing.hpp" /// TODO: The swap table optimiser currently tries to optimise many segments; /// solving ~2300 problems with Best TSA takes ~20 seconds, most of which diff --git a/libs/tktokenswap/include/tktokenswap/TrivialTSA.hpp b/libs/tktokenswap/include/tktokenswap/TrivialTSA.hpp index 143ba11921..e96517c21d 100644 --- a/libs/tktokenswap/include/tktokenswap/TrivialTSA.hpp +++ b/libs/tktokenswap/include/tktokenswap/TrivialTSA.hpp @@ -16,7 +16,7 @@ #include -#include "PartialTsaInterface.hpp" +#include "tktokenswap/PartialTsaInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/include/tktokenswap/VectorListHybrid.hpp b/libs/tktokenswap/include/tktokenswap/VectorListHybrid.hpp index 4d2a043751..37df57a11e 100644 --- a/libs/tktokenswap/include/tktokenswap/VectorListHybrid.hpp +++ b/libs/tktokenswap/include/tktokenswap/VectorListHybrid.hpp @@ -18,7 +18,7 @@ #include #include -#include "VectorListHybridSkeleton.hpp" +#include "tktokenswap/VectorListHybridSkeleton.hpp" namespace tket { diff --git a/libs/tktokenswap/include/tktokenswap/VertexMappingFunctions.hpp b/libs/tktokenswap/include/tktokenswap/VertexMappingFunctions.hpp index bfd6000259..2c4190588c 100644 --- a/libs/tktokenswap/include/tktokenswap/VertexMappingFunctions.hpp +++ b/libs/tktokenswap/include/tktokenswap/VertexMappingFunctions.hpp @@ -18,7 +18,7 @@ #include #include -#include "SwapFunctions.hpp" +#include "tktokenswap/SwapFunctions.hpp" namespace tket { diff --git a/libs/tktokenswap/include/tktokenswap/VertexSwapResult.hpp b/libs/tktokenswap/include/tktokenswap/VertexSwapResult.hpp index 8d0cfc90eb..d60c939d5b 100644 --- a/libs/tktokenswap/include/tktokenswap/VertexSwapResult.hpp +++ b/libs/tktokenswap/include/tktokenswap/VertexSwapResult.hpp @@ -18,7 +18,7 @@ #include #include -#include "VertexMappingFunctions.hpp" +#include "tktokenswap/VertexMappingFunctions.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/CyclesCandidateManager.cpp b/libs/tktokenswap/src/CyclesCandidateManager.cpp index 94bf783dba..b9cc8b4178 100644 --- a/libs/tktokenswap/src/CyclesCandidateManager.cpp +++ b/libs/tktokenswap/src/CyclesCandidateManager.cpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "CyclesCandidateManager.hpp" +#include "tktokenswap/CyclesCandidateManager.hpp" #include #include #include #include -#include "VertexSwapResult.hpp" +#include "tktokenswap/VertexSwapResult.hpp" using std::vector; diff --git a/libs/tktokenswap/src/CyclesGrowthManager.cpp b/libs/tktokenswap/src/CyclesGrowthManager.cpp index a0c2bb675e..53931fe38a 100644 --- a/libs/tktokenswap/src/CyclesGrowthManager.cpp +++ b/libs/tktokenswap/src/CyclesGrowthManager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "CyclesGrowthManager.hpp" +#include "tktokenswap/CyclesGrowthManager.hpp" #include #include diff --git a/libs/tktokenswap/src/CyclesPartialTsa.cpp b/libs/tktokenswap/src/CyclesPartialTsa.cpp index 045da1b9b7..b19f7b5775 100644 --- a/libs/tktokenswap/src/CyclesPartialTsa.cpp +++ b/libs/tktokenswap/src/CyclesPartialTsa.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "CyclesPartialTsa.hpp" +#include "tktokenswap/CyclesPartialTsa.hpp" #include diff --git a/libs/tktokenswap/src/CyclicShiftCostEstimate.hpp b/libs/tktokenswap/src/CyclicShiftCostEstimate.hpp index 74a5d61d7e..50153c9377 100644 --- a/libs/tktokenswap/src/CyclicShiftCostEstimate.hpp +++ b/libs/tktokenswap/src/CyclicShiftCostEstimate.hpp @@ -16,7 +16,7 @@ #include -#include "DistancesInterface.hpp" +#include "tktokenswap/DistancesInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/DistancesInterface.cpp b/libs/tktokenswap/src/DistancesInterface.cpp index bec882a733..7704d502d2 100644 --- a/libs/tktokenswap/src/DistancesInterface.cpp +++ b/libs/tktokenswap/src/DistancesInterface.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "DistancesInterface.hpp" +#include "tktokenswap/DistancesInterface.hpp" using std::vector; diff --git a/libs/tktokenswap/src/DynamicTokenTracker.cpp b/libs/tktokenswap/src/DynamicTokenTracker.cpp index fd16eed81b..fc6e91ce4e 100644 --- a/libs/tktokenswap/src/DynamicTokenTracker.cpp +++ b/libs/tktokenswap/src/DynamicTokenTracker.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "DynamicTokenTracker.hpp" +#include "tktokenswap/DynamicTokenTracker.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/HybridTsa.cpp b/libs/tktokenswap/src/HybridTsa.cpp index 58ac4bf9c2..72dabebed7 100644 --- a/libs/tktokenswap/src/HybridTsa.cpp +++ b/libs/tktokenswap/src/HybridTsa.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "HybridTsa.hpp" +#include "tktokenswap/HybridTsa.hpp" #include diff --git a/libs/tktokenswap/src/NeighboursInterface.cpp b/libs/tktokenswap/src/NeighboursInterface.cpp index f664356b74..b19fac95e0 100644 --- a/libs/tktokenswap/src/NeighboursInterface.cpp +++ b/libs/tktokenswap/src/NeighboursInterface.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "NeighboursInterface.hpp" +#include "tktokenswap/NeighboursInterface.hpp" #include diff --git a/libs/tktokenswap/src/PartialTsaInterface.cpp b/libs/tktokenswap/src/PartialTsaInterface.cpp index 749a0ee5a0..d132c5469e 100644 --- a/libs/tktokenswap/src/PartialTsaInterface.cpp +++ b/libs/tktokenswap/src/PartialTsaInterface.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "PartialTsaInterface.hpp" +#include "tktokenswap/PartialTsaInterface.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/RiverFlowPathFinder.cpp b/libs/tktokenswap/src/RiverFlowPathFinder.cpp index 95f9f05dfd..e4f22832c3 100644 --- a/libs/tktokenswap/src/RiverFlowPathFinder.cpp +++ b/libs/tktokenswap/src/RiverFlowPathFinder.cpp @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "RiverFlowPathFinder.hpp" +#include "tktokenswap/RiverFlowPathFinder.hpp" #include #include #include -#include "SwapFunctions.hpp" +#include "tktokenswap/SwapFunctions.hpp" using std::vector; diff --git a/libs/tktokenswap/src/SwapListOptimiser.cpp b/libs/tktokenswap/src/SwapListOptimiser.cpp index 5bc8013dbb..52c92f1ce8 100644 --- a/libs/tktokenswap/src/SwapListOptimiser.cpp +++ b/libs/tktokenswap/src/SwapListOptimiser.cpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "SwapListOptimiser.hpp" +#include "tktokenswap/SwapListOptimiser.hpp" #include -#include "VertexSwapResult.hpp" +#include "tktokenswap/VertexSwapResult.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/TableLookup/VertexMapResizing.hpp b/libs/tktokenswap/src/TableLookup/VertexMapResizing.hpp index 27edede9f4..2aa54fadc6 100644 --- a/libs/tktokenswap/src/TableLookup/VertexMapResizing.hpp +++ b/libs/tktokenswap/src/TableLookup/VertexMapResizing.hpp @@ -19,8 +19,8 @@ #include #include -#include "../VertexMappingFunctions.hpp" #include "tktokenswap/NeighboursInterface.hpp" +#include "tktokenswap/VertexMappingFunctions.hpp" namespace tket { namespace tsa_internal { diff --git a/libs/tktokenswap/src/TrivialTSA.cpp b/libs/tktokenswap/src/TrivialTSA.cpp index eb65a023ae..2e5e372456 100644 --- a/libs/tktokenswap/src/TrivialTSA.cpp +++ b/libs/tktokenswap/src/TrivialTSA.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "TrivialTSA.hpp" +#include "tktokenswap/TrivialTSA.hpp" #include #include diff --git a/libs/tktokenswap/src/VectorListHybridSkeleton.cpp b/libs/tktokenswap/src/VectorListHybridSkeleton.cpp index 283ca0caf8..ea43801824 100644 --- a/libs/tktokenswap/src/VectorListHybridSkeleton.cpp +++ b/libs/tktokenswap/src/VectorListHybridSkeleton.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "VectorListHybridSkeleton.hpp" +#include "tktokenswap/VectorListHybridSkeleton.hpp" #include #include diff --git a/libs/tkwsm/CMakeLists.txt b/libs/tkwsm/CMakeLists.txt index 41ee2605dc..028001cee9 100644 --- a/libs/tkwsm/CMakeLists.txt +++ b/libs/tkwsm/CMakeLists.txt @@ -68,9 +68,9 @@ ENDIF() target_include_directories(tkwsm PUBLIC $ $) -target_link_libraries(tkwsm PRIVATE tkassert::tkassert) -target_link_libraries(tkwsm PRIVATE tkrng::tkrng) -target_link_libraries(tkwsm PRIVATE Boost::headers) +target_link_libraries(tkwsm PUBLIC tkassert::tkassert) +target_link_libraries(tkwsm PUBLIC tkrng::tkrng) +target_link_libraries(tkwsm PUBLIC Boost::headers) IF(APPLE) target_link_libraries(tkwsm PRIVATE "-flat_namespace") ENDIF() diff --git a/libs/tkwsm/include/tkwsm/Common/GeneralUtils.hpp b/libs/tkwsm/include/tkwsm/Common/GeneralUtils.hpp index 33020fbbdf..10cfc065d9 100644 --- a/libs/tkwsm/include/tkwsm/Common/GeneralUtils.hpp +++ b/libs/tkwsm/include/tkwsm/Common/GeneralUtils.hpp @@ -23,7 +23,7 @@ #include #include -#include "SpecialExceptions.hpp" +#include "tkwsm/Common/SpecialExceptions.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Common/TemporaryRefactorCode.hpp b/libs/tkwsm/include/tkwsm/Common/TemporaryRefactorCode.hpp index d1945a0f7e..47bb135b69 100644 --- a/libs/tkwsm/include/tkwsm/Common/TemporaryRefactorCode.hpp +++ b/libs/tkwsm/include/tkwsm/Common/TemporaryRefactorCode.hpp @@ -16,7 +16,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolver.hpp b/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolver.hpp index 03aed7218f..0d68077a47 100644 --- a/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolver.hpp +++ b/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolver.hpp @@ -16,11 +16,11 @@ #include #include -#include "../GraphTheoretic/NeighboursData.hpp" -#include "../GraphTheoretic/VertexRelabelling.hpp" -#include "../Searching/SearchBranch.hpp" -#include "MainSolverParameters.hpp" -#include "SolutionData.hpp" +#include "tkwsm/EndToEndWrappers/MainSolverParameters.hpp" +#include "tkwsm/EndToEndWrappers/SolutionData.hpp" +#include "tkwsm/GraphTheoretic/NeighboursData.hpp" +#include "tkwsm/GraphTheoretic/VertexRelabelling.hpp" +#include "tkwsm/Searching/SearchBranch.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolverParameters.hpp b/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolverParameters.hpp index dca4bb39d4..4394943780 100644 --- a/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolverParameters.hpp +++ b/libs/tkwsm/include/tkwsm/EndToEndWrappers/MainSolverParameters.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/EndToEndWrappers/PreSearchComponents.hpp b/libs/tkwsm/include/tkwsm/EndToEndWrappers/PreSearchComponents.hpp index b3fb8b356f..827b470cf8 100644 --- a/libs/tkwsm/include/tkwsm/EndToEndWrappers/PreSearchComponents.hpp +++ b/libs/tkwsm/include/tkwsm/EndToEndWrappers/PreSearchComponents.hpp @@ -18,8 +18,8 @@ #include #include -#include "../GraphTheoretic/NearNeighboursData.hpp" -#include "../GraphTheoretic/NeighboursData.hpp" +#include "tkwsm/GraphTheoretic/NearNeighboursData.hpp" +#include "tkwsm/GraphTheoretic/NeighboursData.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionData.hpp b/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionData.hpp index c9027599b0..4991fe2e9f 100644 --- a/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionData.hpp +++ b/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionData.hpp @@ -15,8 +15,8 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" -#include "SolutionWSM.hpp" +#include "tkwsm/EndToEndWrappers/SolutionWSM.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionWSM.hpp b/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionWSM.hpp index 4a0e9150e4..09e4719de8 100644 --- a/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionWSM.hpp +++ b/libs/tkwsm/include/tkwsm/EndToEndWrappers/SolutionWSM.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphStructs.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphStructs.hpp index 1e9ab1ed2c..dbcec146e8 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphStructs.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphStructs.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphs.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphs.hpp index a1d2ce8391..00742b2488 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphs.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphs.hpp @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "DerivedGraphStructs.hpp" +#include "tkwsm/GraphTheoretic/DerivedGraphStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphsCalculator.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphsCalculator.hpp index a855ac6ffa..7361bd8d50 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphsCalculator.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/DerivedGraphsCalculator.hpp @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "DerivedGraphStructs.hpp" +#include "tkwsm/GraphTheoretic/DerivedGraphStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/DomainInitialiser.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/DomainInitialiser.hpp index d8285ef522..1184c1d54c 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/DomainInitialiser.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/DomainInitialiser.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/NearNeighboursData.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/NearNeighboursData.hpp index 0153b6983c..7fdef7e1b1 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/NearNeighboursData.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/NearNeighboursData.hpp @@ -17,8 +17,8 @@ #include #include -#include "FilterUtils.hpp" -#include "GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/FilterUtils.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/NeighboursData.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/NeighboursData.hpp index f00d904366..092bee5c20 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/NeighboursData.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/NeighboursData.hpp @@ -17,7 +17,7 @@ #include #include -#include "GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/GraphTheoretic/VertexRelabelling.hpp b/libs/tkwsm/include/tkwsm/GraphTheoretic/VertexRelabelling.hpp index 9a39fbeb8e..7ecdea690a 100644 --- a/libs/tkwsm/include/tkwsm/GraphTheoretic/VertexRelabelling.hpp +++ b/libs/tkwsm/include/tkwsm/GraphTheoretic/VertexRelabelling.hpp @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/InitPlacement/EndToEndIQP.hpp b/libs/tkwsm/include/tkwsm/InitPlacement/EndToEndIQP.hpp index f172e1bb2b..41c89ca40b 100644 --- a/libs/tkwsm/include/tkwsm/InitPlacement/EndToEndIQP.hpp +++ b/libs/tkwsm/include/tkwsm/InitPlacement/EndToEndIQP.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/InitPlacement/FastRandomBits.hpp b/libs/tkwsm/include/tkwsm/InitPlacement/FastRandomBits.hpp index 85241c7493..3c1a0ec703 100644 --- a/libs/tkwsm/include/tkwsm/InitPlacement/FastRandomBits.hpp +++ b/libs/tkwsm/include/tkwsm/InitPlacement/FastRandomBits.hpp @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { class RNG; diff --git a/libs/tkwsm/include/tkwsm/InitPlacement/InputStructs.hpp b/libs/tkwsm/include/tkwsm/InitPlacement/InputStructs.hpp index 6d9f3afb50..ca0ce46b3a 100644 --- a/libs/tkwsm/include/tkwsm/InitPlacement/InputStructs.hpp +++ b/libs/tkwsm/include/tkwsm/InitPlacement/InputStructs.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/InitPlacement/MonteCarloCompleteTargetSolution.hpp b/libs/tkwsm/include/tkwsm/InitPlacement/MonteCarloCompleteTargetSolution.hpp index 7a1a4ad058..58c7fe6b03 100644 --- a/libs/tkwsm/include/tkwsm/InitPlacement/MonteCarloCompleteTargetSolution.hpp +++ b/libs/tkwsm/include/tkwsm/InitPlacement/MonteCarloCompleteTargetSolution.hpp @@ -17,10 +17,10 @@ #include #include -#include "FastRandomBits.hpp" -#include "MonteCarloManager.hpp" -#include "SolutionJumper.hpp" #include "tkwsm/GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/InitPlacement/FastRandomBits.hpp" +#include "tkwsm/InitPlacement/MonteCarloManager.hpp" +#include "tkwsm/InitPlacement/SolutionJumper.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Reducing/DerivedGraphsReducer.hpp b/libs/tkwsm/include/tkwsm/Reducing/DerivedGraphsReducer.hpp index fe1cd11ede..d34d208b38 100644 --- a/libs/tkwsm/include/tkwsm/Reducing/DerivedGraphsReducer.hpp +++ b/libs/tkwsm/include/tkwsm/Reducing/DerivedGraphsReducer.hpp @@ -13,9 +13,9 @@ // limitations under the License. #pragma once -#include "../GraphTheoretic/DerivedGraphs.hpp" -#include "../GraphTheoretic/DerivedGraphsCalculator.hpp" -#include "ReducerWrapper.hpp" +#include "tkwsm/GraphTheoretic/DerivedGraphs.hpp" +#include "tkwsm/GraphTheoretic/DerivedGraphsCalculator.hpp" +#include "tkwsm/Reducing/ReducerWrapper.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Reducing/DistancesReducer.hpp b/libs/tkwsm/include/tkwsm/Reducing/DistancesReducer.hpp index 1ef46cc8a4..eb89eca52e 100644 --- a/libs/tkwsm/include/tkwsm/Reducing/DistancesReducer.hpp +++ b/libs/tkwsm/include/tkwsm/Reducing/DistancesReducer.hpp @@ -13,7 +13,7 @@ // limitations under the License. #pragma once -#include "ReducerWrapper.hpp" +#include "tkwsm/Reducing/ReducerWrapper.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Reducing/ReducerWrapper.hpp b/libs/tkwsm/include/tkwsm/Reducing/ReducerWrapper.hpp index 21c02b5b22..ca659e1b4e 100644 --- a/libs/tkwsm/include/tkwsm/Reducing/ReducerWrapper.hpp +++ b/libs/tkwsm/include/tkwsm/Reducing/ReducerWrapper.hpp @@ -16,7 +16,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Searching/DomainsAccessor.hpp b/libs/tkwsm/include/tkwsm/Searching/DomainsAccessor.hpp index 8dc4fb8e2d..5ea115af30 100644 --- a/libs/tkwsm/include/tkwsm/Searching/DomainsAccessor.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/DomainsAccessor.hpp @@ -17,7 +17,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Searching/NodeListTraversal.hpp b/libs/tkwsm/include/tkwsm/Searching/NodeListTraversal.hpp index 8dca86b808..ea1d3c073c 100644 --- a/libs/tkwsm/include/tkwsm/Searching/NodeListTraversal.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/NodeListTraversal.hpp @@ -16,7 +16,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Searching/NodesRawData.hpp b/libs/tkwsm/include/tkwsm/Searching/NodesRawData.hpp index a2eea4dd70..23f3051809 100644 --- a/libs/tkwsm/include/tkwsm/Searching/NodesRawData.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/NodesRawData.hpp @@ -16,8 +16,8 @@ #include #include -#include "../Common/LogicalStack.hpp" -#include "../GraphTheoretic/DomainInitialiser.hpp" +#include "tkwsm/Common/LogicalStack.hpp" +#include "tkwsm/GraphTheoretic/DomainInitialiser.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Searching/SearchBranch.hpp b/libs/tkwsm/include/tkwsm/Searching/SearchBranch.hpp index 2b012146e6..11cfd3ae71 100644 --- a/libs/tkwsm/include/tkwsm/Searching/SearchBranch.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/SearchBranch.hpp @@ -15,15 +15,15 @@ #pragma once #include -#include "../GraphTheoretic/DomainInitialiser.hpp" -#include "../Reducing/DerivedGraphsReducer.hpp" -#include "../Reducing/DistancesReducer.hpp" -#include "../Reducing/HallSetReduction.hpp" -#include "../Reducing/ReducerWrapper.hpp" -#include "DomainsAccessor.hpp" -#include "NodeListTraversal.hpp" -#include "NodesRawData.hpp" -#include "WeightCalculator.hpp" +#include "tkwsm/GraphTheoretic/DomainInitialiser.hpp" +#include "tkwsm/Reducing/DerivedGraphsReducer.hpp" +#include "tkwsm/Reducing/DistancesReducer.hpp" +#include "tkwsm/Reducing/HallSetReduction.hpp" +#include "tkwsm/Reducing/ReducerWrapper.hpp" +#include "tkwsm/Searching/DomainsAccessor.hpp" +#include "tkwsm/Searching/NodeListTraversal.hpp" +#include "tkwsm/Searching/NodesRawData.hpp" +#include "tkwsm/Searching/WeightCalculator.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/Searching/ValueOrdering.hpp b/libs/tkwsm/include/tkwsm/Searching/ValueOrdering.hpp index b98b6bc1c8..b4a207ec65 100644 --- a/libs/tkwsm/include/tkwsm/Searching/ValueOrdering.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/ValueOrdering.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { class RNG; diff --git a/libs/tkwsm/include/tkwsm/Searching/VariableOrdering.hpp b/libs/tkwsm/include/tkwsm/Searching/VariableOrdering.hpp index 855b6cc788..62751009c2 100644 --- a/libs/tkwsm/include/tkwsm/Searching/VariableOrdering.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/VariableOrdering.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { class RNG; diff --git a/libs/tkwsm/include/tkwsm/Searching/WeightCalculator.hpp b/libs/tkwsm/include/tkwsm/Searching/WeightCalculator.hpp index 2ce793b393..5a42e94256 100644 --- a/libs/tkwsm/include/tkwsm/Searching/WeightCalculator.hpp +++ b/libs/tkwsm/include/tkwsm/Searching/WeightCalculator.hpp @@ -16,7 +16,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/WeightPruning/WeightChecker.hpp b/libs/tkwsm/include/tkwsm/WeightPruning/WeightChecker.hpp index 68bb6aede3..6e57474810 100644 --- a/libs/tkwsm/include/tkwsm/WeightPruning/WeightChecker.hpp +++ b/libs/tkwsm/include/tkwsm/WeightPruning/WeightChecker.hpp @@ -16,8 +16,8 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" -#include "WeightNogoodDetectorManager.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/WeightPruning/WeightNogoodDetectorManager.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetector.hpp b/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetector.hpp index df9a05e75a..e7b8a5c7d8 100644 --- a/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetector.hpp +++ b/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetector.hpp @@ -15,7 +15,7 @@ #pragma once #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetectorManager.hpp b/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetectorManager.hpp index 86b98c7c93..467acdddeb 100644 --- a/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetectorManager.hpp +++ b/libs/tkwsm/include/tkwsm/WeightPruning/WeightNogoodDetectorManager.hpp @@ -16,7 +16,7 @@ #include #include -#include "../GraphTheoretic/GeneralStructs.hpp" +#include "tkwsm/GraphTheoretic/GeneralStructs.hpp" namespace tket { namespace WeightedSubgraphMonomorphism { diff --git a/nix-support/includes-fixup.nix b/nix-support/includes-fixup.nix deleted file mode 100644 index b9a1fa43d2..0000000000 --- a/nix-support/includes-fixup.nix +++ /dev/null @@ -1,7 +0,0 @@ -'' - # fix bogus include paths - # trick found here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/crc32c/default.nix - for f in $(find $out/lib/cmake -name '*.cmake'); do - substituteInPlace "$f" --replace "\''${_IMPORT_PREFIX}/$out/include" "\''${_IMPORT_PREFIX}/include" - done -'' diff --git a/nix-support/libs.nix b/nix-support/libs.nix index 59f1f65524..88e488b3d3 100644 --- a/nix-support/libs.nix +++ b/nix-support/libs.nix @@ -1,21 +1,18 @@ self: super: let default-flags = [ "-DBUILD_SHARED_LIBS=ON" "-DINSTALL_NAME_DIR=OFF" ]; - postFixup = import ./includes-fixup.nix; in { tklog = super.stdenv.mkDerivation { name = "tklog"; src = ../libs/tklog; nativeBuildInputs = [ super.cmake ]; cmakeFlags = default-flags; - inherit postFixup; }; tkrng = super.stdenv.mkDerivation { name = "tkrng"; src = ../libs/tkrng; nativeBuildInputs = [ super.cmake ]; cmakeFlags = default-flags; - inherit postFixup; }; tkassert = super.stdenv.mkDerivation { name = "tkassert"; @@ -23,7 +20,6 @@ in { nativeBuildInputs = [ super.cmake ]; buildInputs = [ self.tklog ]; cmakeFlags = default-flags; - inherit postFixup; }; tktokenswap = super.stdenv.mkDerivation { name = "tktokenswap"; @@ -31,7 +27,6 @@ in { nativeBuildInputs = [ super.cmake super.boost ]; buildInputs = [ self.tklog self.tkassert self.tkrng ]; cmakeFlags = default-flags; - inherit postFixup; }; tkwsm = super.stdenv.mkDerivation { name = "tkwsm"; @@ -39,7 +34,6 @@ in { nativeBuildInputs = [ super.cmake super.boost ]; buildInputs = [ self.tklog self.tkassert self.tkrng ]; cmakeFlags = default-flags; - inherit postFixup; }; tklibs = [ self.tklog self.tkrng self.tkassert self.tktokenswap self.tkwsm ]; } diff --git a/nix-support/pytket.nix b/nix-support/pytket.nix index 8dae5ff3dd..72fc997bcd 100644 --- a/nix-support/pytket.nix +++ b/nix-support/pytket.nix @@ -17,30 +17,23 @@ let }; }); in { - binders = super.stdenv.mkDerivation { - name = "binders"; - nativeBuildInputs = [ + pytket = super.python3.pkgs.buildPythonPackage { + pname = "pytket"; + inherit version; + src = ../pytket; + nativeBuildInputs = with super.python3.pkgs; [ + setuptools super.cmake super.pkg-config - super.python3Packages.pybind11 - super.pybind11_json ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; propagatedBuildInputs = [ super.tket + super.pybind11_json ]; - unpackPhase = '' - cp -r ${../pytket/binders} binders; - cp ${../pytket/CMakeLists.txt} CMakeLists.txt; - ''; - }; - pytket = super.python3.pkgs.buildPythonPackage { - pname = "pytket"; - inherit version; - propagatedBuildInputs = with super.python3.pkgs; [ - self.binders + dependencies = with super.python3.pkgs; [ super.lark super.qwasm + pybind11 graphviz networkx jinja2 @@ -49,35 +42,24 @@ in { numpy typing-extensions ]; + configurePhase = "true"; # skip configure + # (by default it runs cmake, which we + # want python to manage instead) + preBuild = '' + # explicitly provide the pytket version to setup.py + # and to _version.py, as we can't rely on git version + # information in nix. - unpackPhase = '' - cp -r ${../pytket/pytket} pytket; - cp ${../pytket/package.md} package.md; - cp -r ${../schemas} schemas; - cp -r ${../pytket/mypy.ini} mypy.ini; - - # The usual build depends on setuptools-scm to extract the version. - # We have already extracted the version within nix, so we can simply - # inject it into setup.py. - cat ${../pytket/setup.py} | sed 's/setup(/setup(version="${version}",/' > setup.py; - - mkdir test_root; - cp -r ${../pytket/tests} test_root/tests; - # hardcode the version extracted from docs/conf.py. - chmod 755 pytket + cat ${../pytket/setup.py} \ + | sed 's/setup(/setup(version="${version}",/' \ + > setup.py; echo '__version__ = "${version}"' > pytket/_version.py; - ''; - preBuild = '' - export USE_NIX=1; - ''; - postFixup = '' - # these directories aren't copied by setup.py, so we do it manually - cp -r ${ - ../pytket/pytket/circuit/display/js - } $out/lib/python${super.python3.pythonVersion}/site-packages/pytket/circuit/display/js; - cp -r ${ - ../pytket/pytket/circuit/display/static - } $out/lib/python${super.python3.pythonVersion}/site-packages/pytket/circuit/display/static; + + # instruct python to build with cmake instead of conan, + # and to build in a temporary directory. + export NO_CONAN=1; + export INSTALL_DIR=$(mktemp -d); + export BUILD_DIR=$(mktemp -d); ''; checkInputs = with super.python3.pkgs; [ mypy @@ -88,16 +70,18 @@ in { hypothesis docker opt-einsum - ] ++ [jsonschema-4180]; + jsonschema-4180 + ]; checkPhase = '' export HOME=$TMPDIR; + cp -r ${../schemas} $HOME/schemas; # run mypy - python -m mypy --config-file=mypy.ini --no-incremental -p pytket -p test_root.tests; + python -m mypy --config-file=mypy.ini --no-incremental -p pytket -p tests; # run tests - chmod 700 $TMPDIR/test_root/tests/qasm_test_files; - cd test_root/tests; + chmod 700 $HOME/pytket/tests/qasm_test_files; + cd tests; python -m pytest -s . ''; doCheck = true; diff --git a/nix-support/tket.nix b/nix-support/tket.nix index 5dc0fa43a2..ac39d3c6be 100644 --- a/nix-support/tket.nix +++ b/nix-support/tket.nix @@ -1,9 +1,8 @@ self: super: let - postFixup = import ./includes-fixup.nix; # only import necessary directories so that changes to unrelated # files inside of ../tket won't trigger a rebuild - tket-without-tests = super.stdenv.mkDerivation { + src = super.stdenv.mkDerivation { name = "tket-sources"; phases = [ "installPhase" ]; installPhase = '' @@ -11,34 +10,29 @@ let cp -r ${../tket/cmake} $out/cmake; cp -r ${../tket/include} $out/include; cp -r ${../tket/src} $out/src; - cp -r ${../tket/CMakeLists.txt} $out/CMakeLists.txt; + cp -r ${../tket/test} $out/test; + cp -r ${../tket/proptest} $out/proptest; + cp ${../tket/CMakeLists.txt} $out/CMakeLists.txt; ''; }; in { tket = super.stdenv.mkDerivation { name = "tket"; - src = tket-without-tests; - nativeBuildInputs = [ super.cmake ]; - propagatedBuildInputs = super.tklibs - ++ [ super.boost super.symengine super.eigen super.nlohmann_json ]; - cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DINSTALL_NAME_DIR=OFF" ]; - inherit postFixup; - }; - - tket-tests = super.stdenv.mkDerivation { - name = "tket-tests"; - src = ../tket/test; + inherit src; nativeBuildInputs = [ super.cmake super.pkg-config ]; - buildInputs = [ self.tket super.catch2_3 ]; - }; - run-tket-tests = super.stdenv.mkDerivation { - name = "run-tket-tests"; - stages = [ "build" ]; - buildCommand = '' - pushd ${self.tket-tests}/bin; - mkdir -p $out; - ./test-tket > $out/test_result.txt; - popd; - ''; + propagatedBuildInputs = super.tklibs + ++ (with super; [ boost symengine eigen nlohmann_json ]); + # TODO: add rapidcheck once nixpkgs packaging is correctly implemented. + # At current the package fails because the .pc files incorrectly reference + # the library dir rather than the dev dir. + # See https://github.com/NixOS/nixpkgs/issues/296348 + buildInputs = with super; [ catch2_3 ]; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=ON" + "-DINSTALL_NAME_DIR=OFF" + "-DBUILD_TKET_TEST=ON" + "-DBUILD_TKET_PROPTEST=OFF" + ]; + doCheck = true; }; } diff --git a/pytket/CMakeLists.txt b/pytket/CMakeLists.txt index 9b66d5c6c2..b1711d889d 100644 --- a/pytket/CMakeLists.txt +++ b/pytket/CMakeLists.txt @@ -16,21 +16,7 @@ cmake_minimum_required(VERSION 3.23) project(pytket CXX) add_definitions(-DPYBIND11_DETAILED_ERROR_MESSAGES) -find_package(Boost CONFIG REQUIRED) -find_package(Eigen3 CONFIG REQUIRED) find_package(tket CONFIG REQUIRED) -find_package(tklog CONFIG REQUIRED) -find_package(tkassert CONFIG REQUIRED) -find_package(tkrng CONFIG REQUIRED) -find_package(tktokenswap CONFIG REQUIRED) -find_package(tkwsm CONFIG REQUIRED) -find_package(tkassert CONFIG REQUIRED) -find_package(gmp CONFIG) -if (NOT gmp_FOUND) - find_package(PkgConfig REQUIRED) - pkg_search_module(gmp REQUIRED IMPORTED_TARGET gmp) -endif() -find_package(SymEngine CONFIG REQUIRED) find_package(pybind11 CONFIG REQUIRED) find_package(pybind11_json CONFIG REQUIRED) @@ -71,22 +57,11 @@ endif() if (NOT TARGET pybind11_json::pybind11_json) add_library(pybind11_json::pybind11_json ALIAS pybind11_json) endif() -if (NOT TARGET gmp::gmp) - add_library(gmp::gmp ALIAS PkgConfig::gmp) -endif() -if (NOT TARGET symengine::symengine) - add_library(symengine::symengine ALIAS symengine) -endif() list(APPEND lib_deps tket::tket - tklog::tklog - tkassert::tkassert pybind11::headers - pybind11_json::pybind11_json - Eigen3::Eigen - gmp::gmp - symengine::symengine) + pybind11_json::pybind11_json) if (WIN32) list(APPEND lib_deps bcrypt) # For boost::uuid endif() diff --git a/pytket/conanfile.py b/pytket/conanfile.py index 6bc2dc7af3..ac4c88c7ef 100644 --- a/pytket/conanfile.py +++ b/pytket/conanfile.py @@ -32,7 +32,7 @@ def package(self): cmake.install() def requirements(self): - self.requires("tket/1.3.17@tket/stable") + self.requires("tket/1.3.18@tket/stable") self.requires("tklog/0.3.3@tket/stable") self.requires("tkrng/0.3.3@tket/stable") self.requires("tkassert/0.3.4@tket/stable") diff --git a/pytket/setup.py b/pytket/setup.py index bf365ece59..301b46c310 100755 --- a/pytket/setup.py +++ b/pytket/setup.py @@ -57,12 +57,28 @@ def run(self): os.path.dirname(self.get_ext_fullpath(self.extensions[0].name)) ) extsource = self.extensions[0].sourcedir - build_dir = os.path.join(extsource, "build") - shutil.rmtree(build_dir, ignore_errors=True) - os.mkdir(build_dir) + build_dir = os.getenv("BUILD_DIR") or os.path.join(extsource, "build") + if os.path.exists(build_dir): + # Remove contents of build_dir, but not the directory itself. + # This avoids issues with a BUILD_DIR being provided but with + # permission settings that prevent it being removed. + for f in os.listdir(build_dir): + fpath = os.path.join(build_dir, f) + if os.path.isdir(fpath): + shutil.rmtree(fpath) + else: + os.remove(fpath) + else: + os.mkdir(build_dir) + install_dir = os.getenv("INSTALL_DIR") subprocess.run( - ["cmake", f"-DCMAKE_INSTALL_PREFIX={install_dir}", os.pardir], cwd=build_dir + [ + "cmake", + f"-DCMAKE_INSTALL_PREFIX={install_dir}", + os.path.abspath(os.curdir), + ], + cwd=build_dir, ) subprocess.run( [ @@ -75,9 +91,8 @@ def run(self): ) subprocess.run(["cmake", "--install", os.curdir], cwd=build_dir) lib_folder = os.path.join(install_dir, "lib") - lib_names = ["libtklog.so", "libtket.so"] ext_suffix = get_config_var("EXT_SUFFIX") - lib_names.extend(f"{binder}{ext_suffix}" for binder in binders) + lib_names = [f"{binder}{ext_suffix}" for binder in binders] # TODO make the above generic os.makedirs(extdir, exist_ok=True) for lib_name in lib_names: @@ -128,38 +143,11 @@ def run(self): shutil.copy(libpath, extdir) -class NixBuild(build_ext): - def run(self): - self.check_extensions_list(self.extensions) - extdir = os.path.abspath( - os.path.dirname(self.get_ext_fullpath(self.extensions[0].name)) - ) - if os.path.exists(extdir): - shutil.rmtree(extdir) - os.makedirs(extdir) - - nix_ldflags = os.environ["NIX_LDFLAGS"].split() - build_inputs = os.environ["propagatedBuildInputs"].split() - - binders = [f"{l}/lib" for l in build_inputs if "-binders" in l] - for binder in binders: - for lib in os.listdir(binder): - libpath = os.path.join(binder, lib) - if not os.path.isdir(libpath): - shutil.copy(libpath, extdir) - - for interface_file in os.listdir("pytket/_tket"): - if interface_file.endswith(".pyi") or interface_file.endswith(".py"): - shutil.copy(os.path.join("pytket/_tket", interface_file), extdir) - - plat_name = os.getenv("WHEEL_PLAT_NAME") def get_build_ext(): - if os.getenv("USE_NIX"): - return NixBuild - elif os.getenv("NO_CONAN"): + if os.getenv("NO_CONAN"): return CMakeBuild else: return ConanBuild @@ -228,6 +216,12 @@ def finalize_options(self): "Topic :: Scientific/Engineering", ], include_package_data=True, - package_data={"pytket": ["py.typed"]}, + package_data={ + "pytket": [ + "py.typed", + "circuit/display/js/*.js", + "circuit/display/static/*.html", + ] + }, zip_safe=False, ) diff --git a/tket/CMakeLists.txt b/tket/CMakeLists.txt index 2d5a40a0d3..6fc529e754 100644 --- a/tket/CMakeLists.txt +++ b/tket/CMakeLists.txt @@ -15,9 +15,17 @@ cmake_minimum_required(VERSION 3.23) project(tket CXX) +cmake_policy(SET CMP0022 NEW) + + list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake) find_package(Boost CONFIG REQUIRED) +find_package(gmp CONFIG) +if (NOT gmp_FOUND) + find_package(PkgConfig REQUIRED) + pkg_search_module(gmp REQUIRED IMPORTED_TARGET gmp) +endif() find_package(SymEngine CONFIG REQUIRED) find_package(Eigen3 CONFIG REQUIRED) find_package(nlohmann_json CONFIG REQUIRED) @@ -31,6 +39,8 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) option(INSTALL_NAME_DIR "Set the install name dir for the library to @loader_path for Apple targets" ON) +option(BUILD_TKET_TEST "Build the test suite" OFF) +option(BUILD_TKET_PROPTEST "Build the property test suite" OFF) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) @@ -104,19 +114,23 @@ ENDIF() if (NOT TARGET symengine::symengine) add_library(symengine::symengine ALIAS symengine) endif() +if (NOT TARGET gmp::gmp) + add_library(gmp::gmp ALIAS PkgConfig::gmp) +endif() target_include_directories(tket PUBLIC $ $) -target_link_libraries(tket PRIVATE Boost::headers) -target_link_libraries(tket PRIVATE symengine::symengine) -target_link_libraries(tket PRIVATE Eigen3::Eigen) -target_link_libraries(tket PRIVATE nlohmann_json::nlohmann_json) -target_link_libraries(tket PRIVATE tklog::tklog) -target_link_libraries(tket PRIVATE tkassert::tkassert) -target_link_libraries(tket PRIVATE tkrng::tkrng) -target_link_libraries(tket PRIVATE tktokenswap::tktokenswap) +target_link_libraries(tket PUBLIC Boost::headers) +target_link_libraries(tket PUBLIC symengine::symengine) +target_link_libraries(tket PUBLIC Eigen3::Eigen) +target_link_libraries(tket PUBLIC nlohmann_json::nlohmann_json) +target_link_libraries(tket PUBLIC tklog::tklog) +target_link_libraries(tket PUBLIC tkassert::tkassert) +target_link_libraries(tket PUBLIC tkrng::tkrng) +target_link_libraries(tket PUBLIC tktokenswap::tktokenswap) target_link_libraries(tket PRIVATE tkwsm::tkwsm) +target_link_libraries(tket PRIVATE gmp::gmp) IF(APPLE) target_link_libraries(tket PRIVATE "-flat_namespace") ENDIF() @@ -432,6 +446,9 @@ target_sources(tket include/tket/Predicates/Predicates.hpp ) +if (BUILD_TKET_TEST OR BUILD_TKET_PROPTEST) + enable_testing() +endif() if (BUILD_TKET_TEST) add_subdirectory(test) endif() @@ -443,16 +460,14 @@ include(GNUInstallDirs) set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/tket) install(TARGETS tket - EXPORT tket-targets - FILE_SET HEADERS) - -if(MSVC) - install(TARGETS tket + EXPORT tket-targets + FILE_SET HEADERS RUNTIME DESTINATION bin RUNTIME DESTINATION lib ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib) -endif() + LIBRARY DESTINATION lib + INCLUDES DESTINATION include +) install(EXPORT tket-targets FILE tketTargets.cmake @@ -462,7 +477,8 @@ install(EXPORT tket-targets include(CMakePackageConfigHelpers) -configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/tketConfig.cmake.in +configure_package_config_file( + ${CMAKE_CURRENT_LIST_DIR}/cmake/tketConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tketConfig.cmake INSTALL_DESTINATION ${INSTALL_CONFIGDIR} ) diff --git a/tket/cmake/tketConfig.cmake.in b/tket/cmake/tketConfig.cmake.in index 3fe7dd05e8..0997fe7f3c 100644 --- a/tket/cmake/tketConfig.cmake.in +++ b/tket/cmake/tketConfig.cmake.in @@ -1,8 +1,24 @@ +@PACKAGE_INIT@ + get_filename_component(TKET_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) include(CMakeFindDependencyMacro) +find_package(Boost CONFIG REQUIRED) +find_package(gmp CONFIG) +if (NOT gmp_FOUND) + find_package(PkgConfig REQUIRED) + pkg_search_module(gmp REQUIRED IMPORTED_TARGET gmp) +endif() +find_package(SymEngine CONFIG REQUIRED) +find_package(Eigen3 CONFIG REQUIRED) +find_package(nlohmann_json CONFIG REQUIRED) +find_package(tklog CONFIG REQUIRED) +find_package(tkassert CONFIG REQUIRED) +find_package(tkrng CONFIG REQUIRED) +find_package(tktokenswap CONFIG REQUIRED) + if(NOT TARGET tket::tket) include("${TKET_CMAKE_DIR}/tketTargets.cmake") endif() -set(TKET_lIBRARIES tket::tket) +set(TKET_LIBRARIES tket::tket) diff --git a/tket/conanfile.py b/tket/conanfile.py index 7c4ed09f49..9809cb70b5 100644 --- a/tket/conanfile.py +++ b/tket/conanfile.py @@ -23,7 +23,7 @@ class TketConan(ConanFile): name = "tket" - version = "1.3.17" + version = "1.3.18" package_type = "library" license = "Apache 2" homepage = "https://github.com/CQCL/tket" @@ -76,12 +76,6 @@ def generate(self): tc.variables["PROFILE_COVERAGE"] = self.options.profile_coverage if self.build_test(): tc.variables["BUILD_TKET_TEST"] = True - architectures_dir = os.path.join( - self.source_folder, "test/src/test_architectures" - ) - copy(self, "*.json", architectures_dir, self.build_folder) - circuits_dir = os.path.join(self.source_folder, "test/src/test_circuits") - copy(self, "*.json", circuits_dir, self.build_folder) if self.build_proptest(): tc.variables["BUILD_TKET_PROPTEST"] = True tc.generate() @@ -97,9 +91,9 @@ def build(self): cmake.configure() cmake.build() if self.build_test(): - self.run(os.path.join(self.test_folder(), "test-tket")) + self.run("./test-tket", cwd=self.test_folder()) if self.build_proptest(): - self.run(os.path.join(self.proptest_folder(), "proptest-tket")) + self.run(f"./proptest-tket", cwd=self.proptest_folder()) def package(self): cmake = CMake(self) diff --git a/tket/proptest/CMakeLists.txt b/tket/proptest/CMakeLists.txt index e13032aeed..3d118d809e 100644 --- a/tket/proptest/CMakeLists.txt +++ b/tket/proptest/CMakeLists.txt @@ -15,20 +15,6 @@ cmake_minimum_required(VERSION 3.23) project(proptest-tket CXX) -find_package(Boost CONFIG REQUIRED) -find_package(gmp CONFIG) -if (NOT gmp_FOUND) - find_package(PkgConfig REQUIRED) - pkg_search_module(gmp REQUIRED IMPORTED_TARGET gmp) -endif() -find_package(SymEngine CONFIG REQUIRED) -find_package(Eigen3 CONFIG REQUIRED) -find_package(nlohmann_json CONFIG REQUIRED) -find_package(tklog CONFIG REQUIRED) -find_package(tkassert CONFIG REQUIRED) -find_package(tkrng CONFIG REQUIRED) -find_package(tktokenswap CONFIG REQUIRED) -find_package(tkwsm CONFIG REQUIRED) find_package(rapidcheck CONFIG REQUIRED) set(CMAKE_CXX_STANDARD 20) @@ -61,26 +47,15 @@ add_executable(proptest-tket src/proptest.cpp ) -if (NOT TARGET gmp::gmp) - add_library(gmp::gmp ALIAS PkgConfig::gmp) -endif() -if (NOT TARGET symengine::symengine) - add_library(symengine::symengine ALIAS symengine) -endif() if (NOT TARGET rapidcheck::rapidcheck) add_library(rapidcheck::rapidcheck ALIAS rapidcheck) endif() target_link_libraries(proptest-tket PRIVATE tket) -target_link_libraries(proptest-tket PRIVATE Boost::headers) -target_link_libraries(proptest-tket PRIVATE gmp::gmp) -target_link_libraries(proptest-tket PRIVATE symengine::symengine) -target_link_libraries(proptest-tket PRIVATE Eigen3::Eigen) -target_link_libraries(proptest-tket PRIVATE tklog::tklog) -target_link_libraries(proptest-tket PRIVATE tkassert::tkassert) -target_link_libraries(proptest-tket PRIVATE nlohmann_json::nlohmann_json) target_link_libraries(proptest-tket PRIVATE rapidcheck::rapidcheck) + + install(TARGETS proptest-tket DESTINATION "." RUNTIME DESTINATION bin ARCHIVE DESTINATION lib diff --git a/tket/proptest/src/proptest.cpp b/tket/proptest/src/proptest.cpp index 02a2bbc7b7..99eea8753f 100644 --- a/tket/proptest/src/proptest.cpp +++ b/tket/proptest/src/proptest.cpp @@ -12,10 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include + #include #include "ComparisonFunctions.hpp" -#include "rapidcheck.h" #include "tket/Architecture/Architecture.hpp" #include "tket/Circuit/Circuit.hpp" #include "tket/Circuit/Simulation/CircuitSimulator.hpp" diff --git a/tket/test/CMakeLists.txt b/tket/test/CMakeLists.txt index ecfa0dd601..7c4fe67377 100644 --- a/tket/test/CMakeLists.txt +++ b/tket/test/CMakeLists.txt @@ -15,21 +15,9 @@ cmake_minimum_required(VERSION 3.23) project(test-tket CXX) -find_package(Boost CONFIG REQUIRED) -find_package(gmp CONFIG) -if (NOT gmp_FOUND) - find_package(PkgConfig REQUIRED) - pkg_search_module(gmp REQUIRED IMPORTED_TARGET gmp) -endif() -find_package(SymEngine CONFIG REQUIRED) -find_package(Eigen3 CONFIG REQUIRED) -find_package(nlohmann_json CONFIG REQUIRED) -find_package(tklog CONFIG REQUIRED) -find_package(tkassert CONFIG REQUIRED) -find_package(tkrng CONFIG REQUIRED) -find_package(tktokenswap CONFIG REQUIRED) -find_package(tkwsm CONFIG REQUIRED) find_package(Catch2 CONFIG REQUIRED) +include(CTest) +include(Catch) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_EXTENSIONS OFF) @@ -56,8 +44,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang") # remove -Wno-deprecated-declarations once https://github.com/boostorg/boost/issues/688 is resolved endif() -add_executable(test-tket - # test utils: +FILE(GLOB_RECURSE TEST_SOURCES src/test_*.cpp) +SET(TEST_UTILS src/tests_main.cpp src/testutil.cpp src/CircuitsForTesting.cpp @@ -78,125 +66,28 @@ add_executable(test-tket src/TokenSwapping/TestUtils/ProblemGeneration.cpp src/TokenSwapping/TestUtils/TestStatsStructs.cpp src/Gate/GatesData.cpp - src/Simulation/ComparisonFunctions.cpp - # test sources: - src/Utils/test_CosSinDecomposition.cpp - src/Utils/test_HelperFunctions.cpp - src/Utils/test_MatrixAnalysis.cpp - src/Graphs/test_GraphColouring.cpp - src/Graphs/test_GraphFindComponents.cpp - src/Graphs/test_GraphFindMaxClique.cpp - src/Graphs/test_GraphUtils.cpp - src/Graphs/test_DirectedGraph.cpp - src/Graphs/test_ArticulationPoints.cpp - src/Graphs/test_TreeSearch.cpp - src/TokenSwapping/test_ArchitectureMappingEndToEnd.cpp - src/TokenSwapping/test_BestTsaFixedSwapSequences.cpp - src/TokenSwapping/test_DistancesFromArchitecture.cpp - src/TokenSwapping/test_FullTsa.cpp - src/TokenSwapping/test_RiverFlowPathFinder.cpp - src/TokenSwapping/test_SwapsFromQubitMapping.cpp - src/TokenSwapping/test_VariousPartialTsa.cpp - src/Architecture/test_SubgraphMonomorphisms.cpp - src/test_PauliTensor.cpp - src/Ops/test_ClassicalOps.cpp - src/Ops/test_Expression.cpp - src/Ops/test_Ops.cpp - src/OpType/test_OpTypeFunctions.cpp - src/Passes/test_CliffordResynthesis.cpp - src/Passes/test_SynthesiseTK.cpp - src/Passes/test_SynthesiseTket.cpp - src/Gate/test_Rotation.cpp - src/Gate/test_GateUnitaryMatrix.cpp - src/Simulation/test_CircuitSimulator.cpp - src/Simulation/test_PauliExpBoxUnitaryCalculator.cpp - src/Circuit/test_Boxes.cpp - src/Circuit/test_PauliExpBoxes.cpp - src/Circuit/test_Circ.cpp - src/Circuit/test_CircPool.cpp - src/Circuit/test_Symbolic.cpp - src/Circuit/test_ThreeQubitConversion.cpp - src/Circuit/test_Multiplexor.cpp - src/Circuit/test_StatePreparation.cpp - src/Circuit/test_DiagonalBox.cpp - src/Circuit/test_ToffoliBox.cpp - src/Circuit/test_ConjugationBox.cpp - src/Circuit/test_DummyBox.cpp - src/test_UnitaryTableau.cpp - src/test_ChoiMixTableau.cpp - src/test_Diagonalisation.cpp - src/test_PhasePolynomials.cpp - src/test_PauliGraph.cpp - src/test_Architectures.cpp - src/test_ArchitectureAwareSynthesis.cpp - src/Placement/test_GraphPlacement.cpp - src/Placement/test_LinePlacement.cpp - src/Placement/test_NoiseAwarePlacement.cpp - src/Placement/test_Placement.cpp - src/Placement/test_NeighbourPlacements.cpp - src/Transformations/test_RedundancyRemoval.cpp - src/test_MappingVerification.cpp - src/test_MappingFrontier.cpp - src/test_RoutingMethod.cpp - src/test_MappingManager.cpp - src/test_LexicographicalComparison.cpp - src/test_LexiRoute.cpp - src/test_AASRoute.cpp - src/test_MultiGateReorder.cpp - src/test_BoxDecompRoutingMethod.cpp - src/test_RoutingPasses.cpp - src/test_DeviceCharacterisation.cpp - src/test_Clifford.cpp - src/test_MeasurementSetup.cpp - src/test_Partition.cpp - src/test_MeasurementReduction.cpp - src/test_PhaseGadget.cpp - src/test_Rebase.cpp - src/test_PhasedXFrontier.cpp - src/test_GlobalisePhasedX.cpp - src/test_Synthesis.cpp - src/test_TwoQubitCanonical.cpp - src/test_ControlDecomp.cpp - src/test_Combinators.cpp - src/test_Predicates.cpp - src/test_CompilerPass.cpp - src/test_ContextOpt.cpp - src/test_FrameRandomisation.cpp - src/test_Assertion.cpp - src/test_json.cpp - src/test_Path.cpp - src/test_SteinerTree.cpp - src/test_SteinerForest.cpp - src/test_wasm.cpp - src/test_RoundAngles.cpp - src/test_GreedyPauli.cpp - src/ZX/test_ZXDiagram.cpp - src/ZX/test_ZXAxioms.cpp - src/ZX/test_ZXSimp.cpp - src/ZX/test_ZXRebase.cpp - src/ZX/test_Flow.cpp - src/ZX/test_ZXConverters.cpp - src/ZX/test_ZXExtraction.cpp - ) - -if (NOT TARGET gmp::gmp) - add_library(gmp::gmp ALIAS PkgConfig::gmp) -endif() -if (NOT TARGET symengine::symengine) - add_library(symengine::symengine ALIAS symengine) -endif() + src/Simulation/ComparisonFunctions.cpp) + +add_executable(test-tket ${TEST_UTILS} ${TEST_SOURCES}) +target_link_libraries(test-tket PUBLIC tket Catch2::Catch2WithMain) -target_link_libraries(test-tket PRIVATE tket) -target_link_libraries(test-tket PRIVATE Boost::headers) -target_link_libraries(test-tket PRIVATE gmp::gmp) -target_link_libraries(test-tket PRIVATE symengine::symengine) -target_link_libraries(test-tket PRIVATE Eigen3::Eigen) -target_link_libraries(test-tket PRIVATE Catch2::Catch2WithMain) -target_link_libraries(test-tket PRIVATE tklog::tklog) -target_link_libraries(test-tket PRIVATE tkrng::tkrng) -target_link_libraries(test-tket PRIVATE tkassert::tkassert) -target_link_libraries(test-tket PRIVATE tktokenswap::tktokenswap) -target_link_libraries(test-tket PRIVATE nlohmann_json::nlohmann_json) +add_custom_target(copy-test-data-dirs ALL + COMMENT "Copying test data directories to build directory" + COMMAND ${CMAKE_COMMAND} -E make_directory + $/test_circuits + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/src/test_circuits + $/test_circuits + + COMMAND ${CMAKE_COMMAND} -E make_directory + $/test_architectures + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/src/test_architectures + $/test_architectures +) +add_dependencies(test-tket copy-test-data-dirs) + +catch_discover_tests(test-tket) set(WITH_COVERAGE no CACHE BOOL "Link library with profiling for test coverage") IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") @@ -205,11 +96,9 @@ IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") ENDIF() ENDIF() -install(FILES - src/test_circuits/lexiroute_circuit.json - src/test_circuits/lexiroute_circuit_relabel_to_ancilla.json - src/test_circuits/bug777_circuit.json - src/test_architectures/ibm_montreal.json +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/test_circuits + DESTINATION bin) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/test_architectures DESTINATION bin) install(TARGETS test-tket DESTINATION "." diff --git a/tket/test/src/test_LexiRoute.cpp b/tket/test/src/test_LexiRoute.cpp index b333996eb3..037dbaa264 100644 --- a/tket/test/src/test_LexiRoute.cpp +++ b/tket/test/src/test_LexiRoute.cpp @@ -1626,7 +1626,7 @@ SCENARIO("Lexi relabel with partially mapped circuit") { } SCENARIO("Test failing case") { - std::ifstream circuit_file("lexiroute_circuit.json"); + std::ifstream circuit_file("test_circuits/lexiroute_circuit.json"); nlohmann::json j = nlohmann::json::parse(circuit_file); auto c = j.get(); Architecture arc(std::vector>{ @@ -2173,7 +2173,8 @@ SCENARIO( {5, 6}, {5, 9}, {6, 8}, {7, 8}, {9, 8}, {9, 10}, {11, 3}, {11, 10}, {11, 12}, {12, 2}, {13, 1}, {13, 12}}; Architecture architecture(coupling_map); - std::ifstream circuit_file("lexiroute_circuit_relabel_to_ancilla.json"); + std::ifstream circuit_file( + "test_circuits/lexiroute_circuit_relabel_to_ancilla.json"); nlohmann::json j = nlohmann::json::parse(circuit_file); auto c = j.get(); std::map p_map = { @@ -2334,10 +2335,10 @@ SCENARIO( } SCENARIO("Lexi route produces incorrect bimaps") { // segfault Github #777 - std::ifstream arch_file("ibm_montreal.json"); + std::ifstream arch_file("test_architectures/ibm_montreal.json"); nlohmann::json j_arch = nlohmann::json::parse(arch_file); auto arch = j_arch.get(); - std::ifstream circ_file("bug777_circuit.json"); + std::ifstream circ_file("test_circuits/bug777_circuit.json"); nlohmann::json j_circ = nlohmann::json::parse(circ_file); auto circ = j_circ.get(); std::map p_map = {