Skip to content

Merge pull request #210 from cindykrafft/fix/issue-192-codon-fu #419

Merge pull request #210 from cindykrafft/fix/issue-192-codon-fu

Merge pull request #210 from cindykrafft/fix/issue-192-codon-fu #419

Workflow file for this run

name: Build
on:
push:
branches: ["*"]
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-22.04
env:
# Disable glibc tcache to make peak RSS deterministic across runs.
GLIBC_TUNABLES: glibc.malloc.tcache_count=0
strategy:
fail-fast: false
matrix:
include:
- clang-version: 22
cmake-version: latest
upload: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Add LLVM apt repository
if: matrix.clang-version >= 16
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.clang-version }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update -q -y
- name: Install dependencies
run: |
sudo apt-get update -q -y
sudo apt-get install -q -y clang-${{ matrix.clang-version }} lld-${{ matrix.clang-version }} libomp-${{ matrix.clang-version }}-dev libeigen3-dev libboost-dev
sudo ln -sf $(which ld.lld-${{ matrix.clang-version }}) /usr/local/bin/ld.lld
# Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake-version }}
- name: Build
run: |
mkdir build
cd build
cmake .. -DUSE_MUTSEL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DIQTREE_FLAGS=static -DCMAKE_C_COMPILER=$(which clang-${{ matrix.clang-version }}) -DCMAKE_CXX_COMPILER=$(which clang++-${{ matrix.clang-version }})
make -j
make package
file iqtree3 | grep x86-64
file iqtree*.tar.gz | grep gzip
- name: Upload Built Binary
# Only upload for one of the gcc & cmake tests
if: ${{ matrix.upload }}
uses: actions/upload-artifact@v4
with:
name: Linux x86-64
path: build/iqtree*.tar.gz
if-no-files-found: error
- name: Run benchmarks with IQ-TREE 2 (baseline)
run: |
chmod +x test_scripts/test_iqtree.sh
./test_scripts/test_iqtree.sh test_scripts/iqtree2/Linux-intel/iqtree2 time_log_iqtree2.tsv test_scripts/test_data/iqtree2_out
- name: Run benchmarks with IQ-TREE 3
run: |
./test_scripts/test_iqtree.sh build/iqtree3 time_log_iqtree3.tsv
- name: Run verify_results.sh
run: |
chmod +x test_scripts/verify_results.sh
./test_scripts/verify_results.sh
- name: Run verify_runtimes.sh
run: |
chmod +x test_scripts/verify_runtime.sh
./test_scripts/verify_runtime.sh time_log_iqtree2.tsv time_log_iqtree3.tsv Linux-x86-64
- name: Run verify_memory.sh
run: |
chmod +x test_scripts/verify_memory.sh
./test_scripts/verify_memory.sh time_log_iqtree2.tsv time_log_iqtree3.tsv Linux-x86-64
build-linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-22.04-arm
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 g++ libeigen3-dev libboost-dev
# Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Build
run: |
mkdir build
cd build
cmake .. -DIQTREE_FLAGS=static -DUSE_MUTSEL=ON
make -j
make package
file iqtree3 | grep aarch64
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Linux AArch64
path: build/iqtree*.tar.gz
if-no-files-found: error
- name: Run benchmarks with IQ-TREE 2 (baseline)
run: |
chmod +x test_scripts/test_iqtree.sh
./test_scripts/test_iqtree.sh test_scripts/iqtree2/Linux-arm/iqtree2 time_log_iqtree2.tsv test_scripts/test_data/iqtree2_out
- name: Run benchmarks with IQ-TREE 3
run: |
./test_scripts/test_iqtree.sh build/iqtree3 time_log_iqtree3.tsv
- name: Run verify_results.sh
run: |
chmod +x test_scripts/verify_results.sh
./test_scripts/verify_results.sh
- name: Run verify_runtimes.sh
run: |
chmod +x test_scripts/verify_runtime.sh
./test_scripts/verify_runtime.sh time_log_iqtree2.tsv time_log_iqtree3.tsv Linux-aarch64
- name: Run verify_memory.sh
run: |
chmod +x test_scripts/verify_memory.sh
./test_scripts/verify_memory.sh time_log_iqtree2.tsv time_log_iqtree3.tsv Linux-aarch64
compile-linux-universal:
name: Linux Universal
runs-on: ubuntu-latest
needs:
- build-linux-x86-64
- build-linux-aarch64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Linux x86-64 Artifact
uses: actions/download-artifact@v4
with:
name: Linux x86-64
path: x86
- name: Download Linux Arm Artifact
uses: actions/download-artifact@v4
with:
name: Linux AArch64
path: arm
- name: Combine Artifacts
run: |
chmod +x test_scripts/make_linux_universal.sh
file1=$(ls x86/iqtree*.tar.gz)
file2=$(ls arm/iqtree*.tar.gz)
test_scripts/make_linux_universal.sh "$file1" "$file2"
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Linux Universal
path: iqtree*.tar.gz
if-no-files-found: error
build-macos-x86_64:
name: Mac OS x86-64
runs-on: macos-15-intel # replaces deprecated macos-13
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install dependencies
run: brew install make eigen boost libomp
# Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Build
run: |
set -x
mkdir build
cd build
export CPPFLAGS="-I/usr/local/opt/libomp/include"
export CXXFLAGS="-I/usr/local/opt/libomp/include"
cmake .. -DUSE_MUTSEL=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DEIGEN3_INCLUDE_DIR=$(brew --prefix eigen)/include/eigen3
make -j
make package
file iqtree3 | grep x86_64
file iqtree*.zip | grep Zip
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Mac x86-64
path: build/iqtree*.zip
if-no-files-found: error
- name: Run benchmarks with IQ-TREE 2 (baseline)
run: |
chmod +x test_scripts/test_iqtree.sh test_scripts/iqtree2/macOS-intel/iqtree2
./test_scripts/test_iqtree.sh test_scripts/iqtree2/macOS-intel/iqtree2 time_log_iqtree2.tsv test_scripts/test_data/iqtree2_out
- name: Run benchmarks with IQ-TREE 3
run: |
./test_scripts/test_iqtree.sh build/iqtree3 time_log_iqtree3.tsv
- name: Run verify_results.sh
run: |
chmod +x test_scripts/verify_results.sh
./test_scripts/verify_results.sh
- name: Run verify_runtimes.sh
run: |
chmod +x test_scripts/verify_runtime.sh
./test_scripts/verify_runtime.sh time_log_iqtree2.tsv time_log_iqtree3.tsv mac-os-x86-64
- name: Run verify_memory.sh
run: |
chmod +x test_scripts/verify_memory.sh
./test_scripts/verify_memory.sh time_log_iqtree2.tsv time_log_iqtree3.tsv mac-os-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
# Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Build
run: |
set -x
mkdir build
cd build
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export CXXFLAGS="-I/opt/homebrew/opt/libomp/include"
cmake .. -DUSE_MUTSEL=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DEIGEN3_INCLUDE_DIR=$(brew --prefix eigen)/include/eigen3
make -j
make package
file iqtree3 | grep arm64
file iqtree*.zip | grep Zip
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Mac Arm
path: build/iqtree*.zip
if-no-files-found: error
- name: Run benchmarks with IQ-TREE 2 (baseline)
run: |
chmod +x test_scripts/test_iqtree.sh test_scripts/iqtree2/macOS-arm/iqtree2
./test_scripts/test_iqtree.sh test_scripts/iqtree2/macOS-arm/iqtree2 time_log_iqtree2.tsv test_scripts/test_data/iqtree2_out
- name: Run benchmarks with IQ-TREE 3
run: |
./test_scripts/test_iqtree.sh build/iqtree3 time_log_iqtree3.tsv
- name: Run verify_results.sh
run: |
chmod +x test_scripts/verify_results.sh
./test_scripts/verify_results.sh
- name: Run verify_runtimes.sh
run: |
chmod +x test_scripts/verify_runtime.sh
./test_scripts/verify_runtime.sh time_log_iqtree2.tsv time_log_iqtree3.tsv mac-os-arm64
- name: Run verify_memory.sh
run: |
chmod +x test_scripts/verify_memory.sh
./test_scripts/verify_memory.sh time_log_iqtree2.tsv time_log_iqtree3.tsv mac-os-arm64
compile-mac-universal:
name: Mac OS Universal
runs-on: macos-14
needs:
- build-macos-x86_64
- build-macos-arm
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Mac x86-64 Artifact
uses: actions/download-artifact@v4
with:
name: Mac x86-64
path: x86
- name: Download Mac Arm Artifact
uses: actions/download-artifact@v4
with:
name: Mac Arm
path: arm
- name: Combine Artifacts
run: |
chmod +x test_scripts/make_universal.sh
file1=$(ls x86/iqtree*.zip)
file2=$(ls arm/iqtree*.zip)
test_scripts/make_universal.sh "$file1" "$file2"
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Mac Universal
path: iqtree*.zip
if-no-files-found: error
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: |
setlocal EnableDelayedExpansion
set RETRIES=3
set WAIT_SECONDS=20
for /L %%i in (1,1,%RETRIES%) do (
echo Attempt %%i/%RETRIES%: installing LLVM 14.0.6 via Chocolatey
choco install llvm --version=14.0.6 --allow-downgrade
if !ERRORLEVEL! EQU 0 goto :success
if %%i LSS %RETRIES% (
echo Install failed. Waiting %WAIT_SECONDS%s before retry...
timeout /t %WAIT_SECONDS% /nobreak >nul
)
)
echo LLVM installation failed after %RETRIES% attempts.
exit /b 1
:success
echo LLVM installed successfully.
- name: Download and Extract Boost 1.84.0
shell: pwsh
run: |
curl -L -o boost.tar.gz https://github.com/MarkusJx/prebuilt-boost/releases/download/1.84.0/boost-1.84.0-windows-2022-mingw-static-x86.tar.gz
tar -xzf boost.tar.gz
mv boost C:/local/boost
- name: Install Eigen3
shell: cmd
run: choco install eigen
# Install Rust
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
target: x86_64-pc-windows-gnu
- name: Compile
shell: cmd
run: |
if exist build rd /s /q build
mkdir build
cd build
cmake -G "MinGW Makefiles" ^
-DUSE_MUTSEL=ON ^
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ^
-DCMAKE_C_FLAGS="--target=x86_64-pc-windows-gnu --sysroot=C:/mingw64 -B C:/mingw64/bin" ^
-DCMAKE_CXX_FLAGS="--target=x86_64-pc-windows-gnu --sysroot=C:/mingw64 -B C:/mingw64/bin" ^
-DCMAKE_MAKE_PROGRAM=mingw32-make ^
-DBoost_INCLUDE_DIR="C:/local/boost/include" ^
-DBoost_LIBRARY_DIRS="C:/local/boost/lib" ^
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 ^
-DIQTREE_FLAGS="static" ..
type CMakeFiles\iqtree3.dir\link.txt
type CMakeFiles\iqtree3.dir\linkLibs.rsp
make -j
make package
env:
BOOST_ROOT: "C:/local/boost"
- name: Check File Arch
shell: bash
run: |
cd build
file iqtree3.exe | grep x86-64
file iqtree*.zip
- name: Upload Built Binary
uses: actions/upload-artifact@v4
with:
name: Windows x86-64
path: build/iqtree*.zip
if-no-files-found: error
- name: Run benchmarks with IQ-TREE 2 (baseline)
shell: pwsh
run: |
./test_scripts/test_iqtree.ps1 -IQTreeBin test_scripts/iqtree2/Windows/iqtree2.exe -LogFile time_log_iqtree2.tsv -OutDir test_scripts/test_data/iqtree2_out
- name: Run benchmarks with IQ-TREE 3
shell: pwsh
run: |
./test_scripts/test_iqtree.ps1 -IQTreeBin "./build/iqtree3.exe" -LogFile time_log_iqtree3.tsv
- name: Run verify_results.ps1
shell: pwsh
run: |
./test_scripts/verify_results.ps1
- name: Run verify_runtimes.ps1
shell: pwsh
run: |
./test_scripts/verify_runtime.ps1 -IQTree2Log time_log_iqtree2.tsv -IQTree3Log time_log_iqtree3.tsv -FallbackColumn windows-x86
- name: Run verify_memory.ps1
shell: pwsh
run: |
./test_scripts/verify_memory.ps1 -IQTree2Log time_log_iqtree2.tsv -IQTree3Log time_log_iqtree3.tsv -FallbackColumn windows-x86