From b5728ee712cb6169778265eb85a7f141c12d0e5d Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Wed, 3 Jan 2024 17:43:46 +0000 Subject: [PATCH 1/5] Use manylinux_2_28. --- .github/workflows/build_libs.yml | 2 +- .github/workflows/packages.yml | 4 ++-- .github/workflows/release.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_libs.yml b/.github/workflows/build_libs.yml index 0430bfd22c..080f617b7d 100644 --- a/.github/workflows/build_libs.yml +++ b/.github/workflows/build_libs.yml @@ -107,7 +107,7 @@ jobs: - uses: actions/checkout@v4 - name: set up container run: | - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_x86_64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_x86_64:latest /bin/bash docker cp ./libs/${{ matrix.lib }} linux_build:/ docker cp ./libver linux_build:/ docker cp ./.github/workflows/linuxbuildlib linux_build:/ diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 55f1c56cbe..0b039370cf 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -58,7 +58,7 @@ jobs: - name: Set up container run: | - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_x86_64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_x86_64:latest /bin/bash docker cp . linux_build:/tket/ - name: Install and upload packages @@ -77,7 +77,7 @@ jobs: run: | export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock docker rm --force -v linux_build - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_aarch64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash docker cp . linux_build:/tket/ - name: Install and upload packages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df3add5a54..6c6568fa04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - name: Set up container run: | - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_x86_64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_x86_64:latest /bin/bash docker cp . linux_build:/tket/ - name: Run build run: | @@ -49,7 +49,7 @@ jobs: - name: Set up container run: | export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_aarch64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash docker cp . linux_build:/tket/ - name: Run build run: | @@ -247,7 +247,7 @@ jobs: - name: Set up container run: | export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock - docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux2014_aarch64:latest /bin/bash + docker create --name linux_build -i -v /:/host quay.io/pypa/manylinux_2_28_aarch64:latest /bin/bash docker cp . linux_build:/tket/ - name: Run tests run: | From 79b2de4eaee7406498683f4ab5253f52120e23f5 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Thu, 4 Jan 2024 08:04:05 +0000 Subject: [PATCH 2/5] Update conan profiles on linux-armv8 and linux-x86_64. --- .github/workflows/build_libs.yml | 2 +- .github/workflows/packages.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- conan-profiles/linux-armv8-gcc12 | 8 ++++++++ conan-profiles/linux-x86_64-gcc12 | 8 ++++++++ 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 conan-profiles/linux-armv8-gcc12 create mode 100644 conan-profiles/linux-x86_64-gcc12 diff --git a/.github/workflows/build_libs.yml b/.github/workflows/build_libs.yml index 080f617b7d..39bb2f9f81 100644 --- a/.github/workflows/build_libs.yml +++ b/.github/workflows/build_libs.yml @@ -123,6 +123,6 @@ jobs: UPLOAD_PACKAGE=${UPLOAD_PACKAGE} JFROG_ARTIFACTORY_TOKEN_3=${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }} JFROG_ARTIFACTORY_USER_3=${{ secrets.JFROG_ARTIFACTORY_USER_3 }} - CONAN_PROFILE=linux-x86_64-gcc10-libstdc++ + CONAN_PROFILE=linux-x86_64-gcc12 EOF docker exec --env-file env-vars linux_build /bin/bash -c "/linuxbuildlib" diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 0b039370cf..70feff8c03 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -64,7 +64,7 @@ jobs: - name: Install and upload packages run: | docker start linux_build - docker exec -e JFROG_ARTIFACTORY_TOKEN_3="${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }}" -e JFROG_ARTIFACTORY_USER_3="${{ secrets.JFROG_ARTIFACTORY_USER_3 }}" -e CONAN_PROFILE=linux-x86_64-gcc10-libstdc++ linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildpackages" + docker exec -e JFROG_ARTIFACTORY_TOKEN_3="${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }}" -e JFROG_ARTIFACTORY_USER_3="${{ secrets.JFROG_ARTIFACTORY_USER_3 }}" -e CONAN_PROFILE=linux-x86_64-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildpackages" build_manylinux_aarch64: name: Build on manylinux (aarch64) @@ -84,7 +84,7 @@ jobs: run: | export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock docker start linux_build - docker exec -e JFROG_ARTIFACTORY_TOKEN_3="${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }}" -e JFROG_ARTIFACTORY_USER_3="${{ secrets.JFROG_ARTIFACTORY_USER_3 }}" -e CONAN_PROFILE=linux-armv8-gcc10-libstdc++ linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildpackages" + docker exec -e JFROG_ARTIFACTORY_TOKEN_3="${{ secrets.JFROG_ARTIFACTORY_TOKEN_3 }}" -e JFROG_ARTIFACTORY_USER_3="${{ secrets.JFROG_ARTIFACTORY_USER_3 }}" -e CONAN_PROFILE=linux-armv8-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildpackages" - name: Remove container if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c6568fa04..f0a10bf266 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Run build run: | docker start linux_build - docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" -e CONAN_PROFILE=linux-x86_64-gcc10-libstdc++ linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildwheel" + docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" -e CONAN_PROFILE=linux-x86_64-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildwheel" mkdir wheelhouse docker cp linux_build:/tket/pytket/audited/. wheelhouse/ - uses: actions/upload-artifact@v4 @@ -55,7 +55,7 @@ jobs: run: | export DOCKER_HOST=unix://${HOME}/.docker/run/docker.sock docker start linux_build - docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" -e CONAN_PROFILE=linux-armv8-gcc10-libstdc++ linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildwheel" + docker exec -e PY_TAG="cp3${{ matrix.python3-version }}-cp3${{ matrix.python3-version }}" -e CONAN_PROFILE=linux-armv8-gcc12 linux_build /bin/bash -c "/tket/.github/workflows/linuxbuildwheel" mkdir wheelhouse docker cp linux_build:/tket/pytket/audited/. wheelhouse/ - name: Remove container diff --git a/conan-profiles/linux-armv8-gcc12 b/conan-profiles/linux-armv8-gcc12 new file mode 100644 index 0000000000..3bb763ca7a --- /dev/null +++ b/conan-profiles/linux-armv8-gcc12 @@ -0,0 +1,8 @@ +[settings] +arch=armv8 +build_type=Release +compiler=gcc +compiler.cppstd=gnu17 +compiler.libcxx=libstdc++11 +compiler.version=12 +os=Linux diff --git a/conan-profiles/linux-x86_64-gcc12 b/conan-profiles/linux-x86_64-gcc12 new file mode 100644 index 0000000000..99c0c1f7ea --- /dev/null +++ b/conan-profiles/linux-x86_64-gcc12 @@ -0,0 +1,8 @@ +[settings] +arch=x86_64 +build_type=Release +compiler=gcc +compiler.cppstd=gnu17 +compiler.libcxx=libstdc++11 +compiler.version=12 +os=Linux From 6d519e8865f14ca67800c46904b3d1ae71069ed2 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Thu, 4 Jan 2024 08:21:13 +0000 Subject: [PATCH 3/5] Fix two compiler warnings from gcc-12 on armv8. --- tket/src/Circuit/Boxes.cpp | 10 +++++++--- tket/src/Predicates/CompilationUnit.cpp | 23 ++++++++++++----------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tket/src/Circuit/Boxes.cpp b/tket/src/Circuit/Boxes.cpp index e25d4ea83b..5aabc204e4 100644 --- a/tket/src/Circuit/Boxes.cpp +++ b/tket/src/Circuit/Boxes.cpp @@ -328,10 +328,14 @@ std::string CustomGate::get_name(bool) const { s << gate_->get_name(); if (!params_.empty()) { s << "("; - std::string sep = ""; + bool initial = true; for (const Expr &e : params_) { - s << sep << e; - sep = ","; + if (initial) { + s << e; + } else { + s << "," << e; + } + initial = false; } s << ")"; } diff --git a/tket/src/Predicates/CompilationUnit.cpp b/tket/src/Predicates/CompilationUnit.cpp index 54ef9b5f25..b1158bd835 100644 --- a/tket/src/Predicates/CompilationUnit.cpp +++ b/tket/src/Predicates/CompilationUnit.cpp @@ -56,27 +56,28 @@ bool CompilationUnit::check_all_predicates() const { } std::string CompilationUnit::to_string() const { - std::string str = "~~~CompilationUnit~~~\n\n"; + std::stringstream s; + s << "~~~CompilationUnit~~~" << std::endl + << "" << std::endl; if (!target_preds.empty()) { - str += "Target Predicates:\n"; + s << "Target Predicates:" << std::endl; for (const TypePredicatePair& pp : target_preds) { - str += (" " + pp.second->to_string() + "\n"); + s << " " << pp.second->to_string() << std::endl; } } else - str += "Target Predicates empty\n"; + s << "Target Predicates empty" << std::endl; if (!cache_.empty()) { - str += "Cache:\n"; + s << "Cache:" << std::endl; for (const std::pair>& tp : cache_) { - str += (" " + tp.second.first->to_string() + " :: "); - str += tp.second.second ? "True\n" : "False\n"; + s << " " << tp.second.first->to_string() + << " :: " << ((tp.second.second) ? "True" : "False") << std::endl; } } else - str += "Cache empty\n"; - return str; + s << "Cache empty" << std::endl; + return s.str(); } void CompilationUnit::empty_cache() const { cache_ = {}; } From 48818bc1f8ead5884e5888c8307eefb27e525ca0 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Thu, 4 Jan 2024 09:14:54 +0000 Subject: [PATCH 4/5] Remove unused profiles. --- conan-profiles/linux-armv8-gcc10-libstdc++ | 8 -------- conan-profiles/linux-x86_64-gcc10-libstdc++ | 8 -------- 2 files changed, 16 deletions(-) delete mode 100644 conan-profiles/linux-armv8-gcc10-libstdc++ delete mode 100644 conan-profiles/linux-x86_64-gcc10-libstdc++ diff --git a/conan-profiles/linux-armv8-gcc10-libstdc++ b/conan-profiles/linux-armv8-gcc10-libstdc++ deleted file mode 100644 index f94db73ef8..0000000000 --- a/conan-profiles/linux-armv8-gcc10-libstdc++ +++ /dev/null @@ -1,8 +0,0 @@ -[settings] -arch=armv8 -build_type=Release -compiler=gcc -compiler.cppstd=gnu14 -compiler.libcxx=libstdc++ -compiler.version=10 -os=Linux diff --git a/conan-profiles/linux-x86_64-gcc10-libstdc++ b/conan-profiles/linux-x86_64-gcc10-libstdc++ deleted file mode 100644 index fbfc138849..0000000000 --- a/conan-profiles/linux-x86_64-gcc10-libstdc++ +++ /dev/null @@ -1,8 +0,0 @@ -[settings] -arch=x86_64 -build_type=Release -compiler=gcc -compiler.cppstd=gnu14 -compiler.libcxx=libstdc++ -compiler.version=10 -os=Linux From 3461bfe976cd9bd572c11b8edf2ed2bc2a0baca5 Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Thu, 4 Jan 2024 09:22:21 +0000 Subject: [PATCH 5/5] Bump tket version. --- pytket/conanfile.py | 2 +- tket/conanfile.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pytket/conanfile.py b/pytket/conanfile.py index b8274039a6..bb97423efe 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.2.78@tket/stable") + self.requires("tket/1.2.79@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/tket/conanfile.py b/tket/conanfile.py index 4201e7f9f9..932c134cb1 100644 --- a/tket/conanfile.py +++ b/tket/conanfile.py @@ -23,7 +23,7 @@ class TketConan(ConanFile): name = "tket" - version = "1.2.78" + version = "1.2.79" package_type = "library" license = "Apache 2" homepage = "https://github.com/CQCL/tket"