From 984b685cdbc65853a1808341caff813ce39e17d7 Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Thu, 29 Jan 2026 16:20:13 +0200 Subject: [PATCH 1/2] Fix windows compile --- example/find-unsupported-edges/findunsupportededges.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/example/find-unsupported-edges/findunsupportededges.cpp b/example/find-unsupported-edges/findunsupportededges.cpp index 2816858..46ace40 100644 --- a/example/find-unsupported-edges/findunsupportededges.cpp +++ b/example/find-unsupported-edges/findunsupportededges.cpp @@ -24,6 +24,7 @@ #include #include "ncl/nxsdefs.h" #include "ncl/nxstreesblock.h" +#include using namespace std; long gStrictLevel = 2; @@ -554,10 +555,10 @@ void recordSupportedNodes(const map > & refNdp2 assert(ancIt != refNdp2mrca.end()); const set & anm = ancIt->second; if (printDB) { //debugging - cerr << "DEBUGGING refTree node " << (long)nd << ": "; + cerr << "DEBUGGING refTree node " << (std::int64_t)nd << ": "; writeSet(cerr, "", nm, " "); cerr << "\n"; - cerr << "refTree par " << (long)firstBranchingAnc << ": "; + cerr << "refTree par " << (std::int64_t)firstBranchingAnc << ": "; writeSet(cerr, "", anm, " "); cerr << "\n"; } @@ -731,8 +732,8 @@ void markSuspectNode(const set & designators) { void parseAndProcessMRCADesignatorsFile(string filepath) { if (gRefTree == 0L || gTaxonTree != 0L) { - cerr << "gRefTree" << (long )gRefTree << "\n"; - cerr << "gTaxonTree" << (long )gTaxonTree << "\n"; + cerr << "gRefTree" << (std::int64_t )gRefTree << "\n"; + cerr << "gTaxonTree" << (std::int64_t )gTaxonTree << "\n"; cerr << "\nDesignators file must come after the full tree estimate, but before the taxonomy in the argument length\n"; throw exception(); } From 818a09e5a31e4827f3a1efc2a70d0c86420c4f7b Mon Sep 17 00:00:00 2001 From: Benjamin Redelings Date: Thu, 29 Jan 2026 16:54:57 +0200 Subject: [PATCH 2/2] Test windows build --- .github/workflows/build.yml | 31 ++++++++-- scripts/make_winroot.sh | 111 ++++++++++++++++++++++++++++++++++++ 2 files changed, 137 insertions(+), 5 deletions(-) create mode 100755 scripts/make_winroot.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a5a76f..d55358f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,9 @@ jobs: name: [ linux-gcc-c++17, linux-gcc-c++20, linux-clang-c++17, - linux-clang-c++20 ] + linux-clang-c++20, + windows + ] include: - name: linux-gcc-c++17 compiler: gcc @@ -38,15 +40,28 @@ jobs: std: c++20 os: ubuntu-latest + - name: windows + compiler: idk + std: c++20 + os: ubuntu-latest + arch: win64 + runs-on: ${{ matrix.os }} container: image: ${{ matrix.image || '' }} steps: - uses: actions/checkout@v4 - - name: Install + - name: Install (Linux) + run: | + sudo apt-get install -y ccache meson cmake + + - name: Install (Windows) + if: matrix.name == 'windows' run: | sudo apt-get install -y ccache meson cmake + sudo apt-get install -y git python3-setuptools python3-pip g++-mingw-w64 wine64 + ${GITHUB_WORKSPACE}/scripts/make_winroot.sh -ccache true - name: ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -65,12 +80,18 @@ jobs: - name: Build and test with meson run: | - meson setup mbuild + if [ "${{ matrix.name }}" = "windows" ] ; then + margs="--cross-file=win64-cross.txt" + fi + meson setup mbuild ${margs} cd mbuild ninja - ninja test + if [ "${{ matrix.name }}" != "windows" ] ; then + ninja test + fi - - name: Build and install and test with cmake + - name: Build and install and test with autoconf + if: matrix.name != 'windows' run: | ./bootstrap.sh cd ../ diff --git a/scripts/make_winroot.sh b/scripts/make_winroot.sh new file mode 100755 index 0000000..04a9b11 --- /dev/null +++ b/scripts/make_winroot.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# parse command line arguments +while echo $1 | grep ^- > /dev/null; do + # intercept help while parsing "-key value" pairs + if [ "$1" = "--help" ] || [ "$1" = "-h" ] + then + echo 'Command line options are: +-h : print this help and exit. +-download : download MINGW packages. + +Example: + ./make_winroot.sh -help true' + exit + fi + + # parse pairs + eval $( echo $1 | sed 's/-//g' | tr -d '\012')=$2 + shift + shift +done + +SYSROOT=$HOME/win_root + +# 1. Make sysroot +echo +echo "1. Writing sysroot dir ${SYSROOT}" +mkdir -p "${SYSROOT}" +mkdir -p "${SYSROOT}/bin" + +# 2. Generate cross file +CROSSNAME=win64-cross.txt +echo +echo "2. Writing cross file to '${CROSSNAME}'" + +cat > "${CROSSNAME}" <