From 27ccc513d5e4487e33873cc0e8342af87f46bbb5 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:06:56 +1000 Subject: [PATCH 1/4] Expand CI System to Build for Mac x86-64 and Windows x86-64 --- .github/workflows/build.yaml | 167 +++++++++++++++++++++++++++++++++++ .github/workflows/ci.yaml | 90 ------------------- 2 files changed, 167 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..d552cada1 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,167 @@ +name: Build + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +# If a Second Commit is Pushed After, and Build is Not Complete, Cancel +# Extremely Important with the High Computation Time and Power Required of Arm Linux Builds +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-linux-x86-64: + name: Linux x86-64 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + gcc-version: [10, 12] + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Install dependencies + run: | + sudo apt-get update -q -y + sudo apt-get install -q -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version}} cmake libeigen3-dev libboost-dev + + - name: Build + run: | + mkdir build + cd build + export CXXFLAGS="-std=c++14" # this is important to be able to build with g++ newer than v10 + cmake .. -DCMAKE_C_COMPILER=$(which gcc-${{ matrix.gcc-version }}) -DCMAKE_CXX_COMPILER=$(which g++-${{ matrix.gcc-version }}) + make -j + file iqtree2 | grep x86-64 + + build-linux-aarch64: + name: Linux aarch64 + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Build on Linux ARM64 + uses: uraimo/run-on-arch-action@v2 + with: + arch: aarch64 + distro: ubuntu20.04 + githubToken: ${{ github.token }} + dockerRunArgs: | + --volume "${PWD}:/iqtree2" + install: | + apt-get update -q -y + apt-get install -q -y cmake gcc g++ file libeigen3-dev libboost-dev + run: | + cd /iqtree2 + mkdir build + cd build + cmake .. + make -j + file iqtree2 | grep aarch64 + + build-macos-x86_64: + name: Mac OS x86-64 + runs-on: macos-13 # Mac OS 14 Does Not Support x86-64 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Install dependencies + run: brew install make eigen boost libomp + + - name: Build + run: | + set -x + mkdir build + cd build + export LDFLAGS="-L/usr/local/opt/libomp/lib" + export CPPFLAGS="-I/usr/local/opt/libomp/include" + export CXXFLAGS="-I/usr/local/opt/libomp/include" + cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + gmake -j + file iqtree2 | grep x86_64 + + build-macos-arm: + name: Mac OS ARM64 + runs-on: macos-14 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Install dependencies + run: brew install make eigen boost libomp + + - name: Build + run: | + set -x + mkdir build + cd build + export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" + export CPPFLAGS="-I/opt/homebrew/opt/libomp/include" + export CXXFLAGS="-I/opt/homebrew/opt/libomp/include" + cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ + gmake -j + file iqtree2 | grep arm64 + + build-windows-x86-64: + name: Windows x86-64 + runs-on: windows-2022 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: "recursive" + + - name: Install LLVM v14 + shell: cmd + run: choco install llvm --version=14.0.6 --allow-downgrade + + - name: Install Boost + uses: MarkusJx/install-boost@v2.4.5 + id: install-boost + with: + boost_version: 1.84.0 + platform_version: 2022 + toolset: mingw + + - name: Install Eigen3 + shell: cmd + run: choco install eigen + + - name: Compile + shell: cmd + run: | + if exist build rd /s /q build + mkdir build + cd build + -DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}/include\ + -DBoost_LIBRARY_DIRS=${{steps.install-boost.outputs.BOOST_ROOT}}/lib + cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS=--target=x86_64-pc-windows-gnu -DCMAKE_CXX_FLAGS=--target=x86_64-pc-windows-gnu -DCMAKE_MAKE_PROGRAM=mingw32-make .. + make -j + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} + + - name: Check File Arch + shell: bash + run: | + cd build + file iqtree2.exe | grep x86-64 + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 46c3f97f0..000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,90 +0,0 @@ -name: Linux x86_64 - -on: - push: - branches: ["master"] - pull_request: - branches: ["master"] - -jobs: - build: - name: Linux x86_64 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - gcc-version: [10, 12] - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Install dependencies - run: | - sudo apt-get update -q -y - sudo apt-get install -q -y gcc-${{ matrix.gcc-version }} g++-${{ matrix.gcc-version}} cmake libeigen3-dev libboost-dev - - - name: Build - run: | - mkdir build - cd build - export CXXFLAGS="-std=c++14" # this is important to be able to build with g++ newer than v10 - cmake .. -DCMAKE_C_COMPILER=$(which gcc-${{ matrix.gcc-version }}) -DCMAKE_CXX_COMPILER=$(which g++-${{ matrix.gcc-version }}) - make -j - file iqtree2 | grep x86-64 - - build-aarch64: - name: Linux aarch64 - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Build on Linux ARM64 - uses: uraimo/run-on-arch-action@v2 - with: - arch: aarch64 - distro: ubuntu20.04 - githubToken: ${{ github.token }} - dockerRunArgs: | - --volume "${PWD}:/iqtree2" - install: | - apt-get update -q -y - apt-get install -q -y cmake gcc g++ file libeigen3-dev libboost-dev - run: | - cd /iqtree2 - mkdir build - cd build - cmake .. - make -j - file iqtree2 | grep aarch64 - - build-macos-m: - name: Mac OS ARM64 - runs-on: macos-14 - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: "recursive" - - - name: Install dependencies - run: brew install make eigen boost libomp - - - name: Build - run: | - set -x - mkdir build - cd build - export LDFLAGS="-L/opt/homebrew/opt/libomp/lib" - export CPPFLAGS="-I/opt/homebrew/opt/libomp/include" - export CXXFLAGS="-I/opt/homebrew/opt/libomp/include" - cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - gmake -j - file iqtree2 | grep arm64 From d289dcb56a47c082f472bd0c2816969deae5fcd8 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Thu, 2 May 2024 21:32:12 +1000 Subject: [PATCH 2/4] Rename `build.yaml` Back To `ci.yaml` --- .github/workflows/{build.yaml => ci.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build.yaml => ci.yaml} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/build.yaml rename to .github/workflows/ci.yaml From df6ac7e2b59f468b0008cf0fd24eac2e69d54796 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Thu, 2 May 2024 21:56:56 +1000 Subject: [PATCH 3/4] Use Major Version Specification for Boost Install Step --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d552cada1..3a33f33dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -135,7 +135,7 @@ jobs: run: choco install llvm --version=14.0.6 --allow-downgrade - name: Install Boost - uses: MarkusJx/install-boost@v2.4.5 + uses: MarkusJx/install-boost@v2 id: install-boost with: boost_version: 1.84.0 From f359701aebb41886cb4efba3423b26dcbd8f4547 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Fri, 3 May 2024 12:43:02 +1000 Subject: [PATCH 4/4] Use Specific Version Specifier for Boost Install Step Action does not include proper tags to be able to use major version specification. --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a33f33dd..d552cada1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -135,7 +135,7 @@ jobs: run: choco install llvm --version=14.0.6 --allow-downgrade - name: Install Boost - uses: MarkusJx/install-boost@v2 + uses: MarkusJx/install-boost@v2.4.5 id: install-boost with: boost_version: 1.84.0