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

Cmake improvements and Nix unification with existing pytket setup #1501

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
8 changes: 7 additions & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
});
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ target_include_directories(tktokenswap PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/tktokenswap>)
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)
Expand Down
6 changes: 3 additions & 3 deletions libs/tktokenswap/include/tktokenswap/BestFullTsa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include <set>

#include "CyclesGrowthManager.hpp"
#include "PartialTsaInterface.hpp"
#include "tktokenswap/CyclesGrowthManager.hpp"
#include "tktokenswap/PartialTsaInterface.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/include/tktokenswap/CyclesPartialTsa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/include/tktokenswap/DistanceFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <set>
#include <stdexcept>

#include "VertexMappingFunctions.hpp"
#include "tktokenswap/DistancesInterface.hpp"
#include "tktokenswap/VertexMappingFunctions.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include "CanonicalRelabelling.hpp"
#include "tktokenswap/CanonicalRelabelling.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <map>
#include <vector>

#include "SwapConversion.hpp"
#include "tktokenswap/SwapConversion.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/include/tktokenswap/HybridTsa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <set>
#include <vector>

#include "ExactMappingLookup.hpp"
#include "tktokenswap/ExactMappingLookup.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
8 changes: 4 additions & 4 deletions libs/tktokenswap/include/tktokenswap/PartialTsaInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/include/tktokenswap/RiverFlowPathFinder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <optional>
#include <tkrng/RNG.hpp>

#include "DistancesInterface.hpp"
#include "NeighboursInterface.hpp"
#include "tktokenswap/DistancesInterface.hpp"
#include "tktokenswap/NeighboursInterface.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/include/tktokenswap/SwapListOptimiser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#pragma once

#include "DynamicTokenTracker.hpp"
#include "tktokenswap/DynamicTokenTracker.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <set>
#include <vector>

#include "PartialMappingLookup.hpp"
#include "VertexMapResizing.hpp"
#include "tktokenswap/PartialMappingLookup.hpp"
#include "tktokenswap/SwapFunctions.hpp"
#include "tktokenswap/VertexMapResizing.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

#include <set>

#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
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/include/tktokenswap/TrivialTSA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <set>

#include "PartialTsaInterface.hpp"
#include "tktokenswap/PartialTsaInterface.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/include/tktokenswap/VectorListHybrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <sstream>
#include <tkassert/Assert.hpp>

#include "VectorListHybridSkeleton.hpp"
#include "tktokenswap/VectorListHybridSkeleton.hpp"

namespace tket {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <optional>
#include <utility>

#include "SwapFunctions.hpp"
#include "tktokenswap/SwapFunctions.hpp"

namespace tket {

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/include/tktokenswap/VertexSwapResult.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <optional>
#include <utility>

#include "VertexMappingFunctions.hpp"
#include "tktokenswap/VertexMappingFunctions.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/src/CyclesCandidateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
#include <boost/functional/hash.hpp>
#include <stdexcept>
#include <tkassert/Assert.hpp>

#include "VertexSwapResult.hpp"
#include "tktokenswap/VertexSwapResult.hpp"

using std::vector;

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/CyclesGrowthManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdexcept>
#include <tkassert/Assert.hpp>
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/CyclesPartialTsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tkassert/Assert.hpp>

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/CyclicShiftCostEstimate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include <limits>

#include "DistancesInterface.hpp"
#include "tktokenswap/DistancesInterface.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/DistancesInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/DynamicTokenTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/HybridTsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tkassert/Assert.hpp>

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/NeighboursInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdexcept>

Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/PartialTsaInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/src/RiverFlowPathFinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sstream>
#include <stdexcept>
#include <tkassert/Assert.hpp>

#include "SwapFunctions.hpp"
#include "tktokenswap/SwapFunctions.hpp"

using std::vector;

Expand Down
4 changes: 2 additions & 2 deletions libs/tktokenswap/src/SwapListOptimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tkassert/Assert.hpp>

#include "VertexSwapResult.hpp"
#include "tktokenswap/VertexSwapResult.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/TableLookup/VertexMapResizing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <set>
#include <vector>

#include "../VertexMappingFunctions.hpp"
#include "tktokenswap/NeighboursInterface.hpp"
#include "tktokenswap/VertexMappingFunctions.hpp"

namespace tket {
namespace tsa_internal {
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/TrivialTSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sstream>
#include <stdexcept>
Expand Down
2 changes: 1 addition & 1 deletion libs/tktokenswap/src/VectorListHybridSkeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <limits>
#include <sstream>
Expand Down
6 changes: 3 additions & 3 deletions libs/tkwsm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ ENDIF()
target_include_directories(tkwsm PUBLIC
$<INSTALL_INTERFACE:include/tkwsm>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/tkwsm>)
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()
Expand Down
2 changes: 1 addition & 1 deletion libs/tkwsm/include/tkwsm/Common/GeneralUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <utility>
#include <vector>

#include "SpecialExceptions.hpp"
#include "tkwsm/Common/SpecialExceptions.hpp"

namespace tket {
namespace WeightedSubgraphMonomorphism {
Expand Down
Loading
Loading