Skip to content

Logo attempt

Logo attempt #2114

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
- flint-*
concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the main branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
##############################################################################
# ubuntu, gcc, code coverage
##############################################################################
ubuntu-codecoverage:
name: Ubuntu GCC, Code Coverage (x10)
runs-on: ubuntu-latest
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "10"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin
# Install lcov 2.0
mkdir lcov
cd lcov
wget https://github.com/linux-test-project/lcov/releases/download/v2.0/lcov-2.0.tar.gz
tar -xf lcov-2.0.tar.gz
cd lcov-2.0/
sudo make install
# Install lcov dependencies
sudo cpan -T Capture::Tiny DateTime Digest::MD5 File::Spec JSON::XS Memory::Process Module::Load::Conditional Scalar::Util Time::HiRes
# Check versions
gcc --version
make --version
autoconf --version
libtool --version
lcov --version
python3 --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--enable-avx2 \
--disable-static \
--enable-coverage
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
- name: "Check Python"
run: |
$MAKE check PYTHON=1
- name: "Gather coverage data"
run: |
# NOTE: When Ubuntu LTS ships lcov v2.0.0+, change this section to
# `$MAKE coverage'.
mkdir build/coverage
lcov -j $(expr $(nproc) + 1) --capture --omit-lines "flint_throw" --omit-lines '^}$' --exclude "*test/t-*.c" --exclude "*test/main.c" --exclude "/usr/*" --directory build --output-file build/coverage/coverage.info
- name: "Upload coverage data"
uses: codecov/codecov-action@v4
if: github.repository == 'flintlib/flint'
with:
files: build/coverage/coverage.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
##############################################################################
# ubuntu gcc with assert
##############################################################################
ubuntu-gcc-assert:
name: Ubuntu GCC with NTL (assert, x2)
runs-on: ubuntu-latest
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "2"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev libntl-dev autoconf libtool-bin
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--with-ntl \
--enable-assert \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
##############################################################################
# macos (M1) with clang
##############################################################################
macos-m1:
name: macOS-M1, Clang (x3)
runs-on: macos-14
env:
FLINT_TEST_MULTIPLIER: "3"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
brew install make
brew install gmp
brew install mpfr
brew install autoconf
brew install libtool
brew install automake
$(brew --prefix llvm@15)/bin/clang --version
gmake --version
autoconf --version
echo "MAKE=gmake -j$(expr $(nproc) + 1) -l 10 --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=$(brew --prefix llvm@15)/bin/clang \
--with-gmp=$(brew --prefix) \
--with-mpfr=$(brew --prefix) \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
$MAKE
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
##############################################################################
# macos (x86) with clang and blas
##############################################################################
macos-x86:
name: macOS-x86 Clang with BLAS (x2)
runs-on: macos-12
env:
FLINT_TEST_MULTIPLIER: "2"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
brew install make
brew install gmp
brew install mpfr
brew install autoconf
brew install libtool
brew install automake
brew install openblas
$(brew --prefix llvm@15)/bin/clang --version
gmake --version
autoconf --version
echo "MAKE=gmake -j$(expr $(nproc) + 1) -l 10 --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=$(brew --prefix llvm@15)/bin/clang \
--with-gmp=$(brew --prefix) \
--with-mpfr=$(brew --prefix) \
--with-blas=$(brew --prefix)/opt/openblas \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
$MAKE
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
#############################################################################
# ubuntu with clang
#############################################################################
ubuntu-clang:
name: Ubuntu Clang with examples (x5)
runs-on: ubuntu-latest
env:
LOCAL: ${{ github.workspace }}/local
LDFLAGS: "-Wl,-rpath,$LOCAL/lib"
CC: "clang"
FLINT_TEST_MULTIPLIER: "5"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin perl
clang --version
make --version
autoconf --version
libtool --version
perl --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
$MAKE
ldd libflint.so
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
- name: "Compile examples"
run: |
$MAKE examples
- name: "Check examples"
run: |
$MAKE checkexamples
#############################################################################
# mingw with gcc
#############################################################################
mingw64-gcc:
name: MinGW GCC (x0.5)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "0.5"
steps:
- uses: actions/checkout@v4
- name: "Setup MinGW"
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-autotools
- name: "Setup"
run: |
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
${MAKE}
- name: "Compile tests"
run: |
${MAKE} tests
- name: "Check"
run: |
${MAKE} check
##############################################################################
# msvc
##############################################################################
msvc:
name: MSVC (x1)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: "Setup cache for dependencies"
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: "Install dependencies"
run: |
vcpkg install gmp mpfr pthreads --binarysource="clear;x-gha,readwrite"
- name: "Setup MSVC"
uses: ilammy/[email protected]
with:
arch: x86_64
- name: "Configure"
run: |
mkdir build
cd build
# For single build, we need atomics
cmake `
-G "Ninja" `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DCMAKE_C_FLAGS="/wd4018 /wd4146 /wd4244 /wd4267 /wd4305 /wd4996 /experimental:c11atomics" `
-DBUILD_TESTING=ON `
-DCMAKE_BUILD_TYPE=Release `
..
- name: "Build"
run: |
cd build
# NOTE: Number of threads for Github's CI runners are 4.
cmake --build . -j5
- name: "Check"
run: |
cd build
set "FLINT_TEST_MULTIPLIER=1"
ctest -j5 --output-on-failure --timeout 450
##############################################################################
# alpine linux, musl, 32-bit (assert)
##############################################################################
alpine-32bit:
name: Alpine Linux, musl, 32-bit (assert, x1.5)
runs-on: ubuntu-latest
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "1.5"
steps:
- uses: actions/checkout@v4
- name: "Setup latest Alpine Linux"
uses: jirutka/setup-alpine@v1
with:
arch: x86
branch: edge
packages: >
gmp-dev
mpfr-dev
gcc
musl-dev
make
autoconf
automake
libtool
- name: "Setup"
run: |
gcc --version
make --version
autoconf --version
libtool --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
shell: alpine.sh {0}
- name: "Configure"
run: |
./bootstrap.sh
./configure \
CC=${CC} \
--enable-assert \
--disable-static \
--disable-debug
shell: alpine.sh {0}
- name: "Compile library"
run: |
$MAKE
shell: alpine.sh {0}
- name: "Compile tests"
run: |
$MAKE tests
shell: alpine.sh {0}
- name: "Check"
run: |
$MAKE check
shell: alpine.sh {0}
##############################################################################
# nemo
##############################################################################
nemo:
name: Nemo.jl (temporary branch)
runs-on: ubuntu-latest
env:
LOCAL: ${{ github.workspace }}/local
CC: "gcc"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y sed
sudo apt-get install -y autoconf
sudo apt-get install -y libtool-bin
gcc --version
make --version
autoconf --version
libtool --version
julia --version
julia -e 'println(Base.BinaryPlatforms.HostPlatform())'
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
# Find path to GMP and MPFR
gmp_path=$(julia -e 'include("dev/find_gmp_mpfr.jl"); print(gmp_artifact_dir())')
echo "Path to GMP: ${gmp_path}"
mpfr_path=$(julia -e 'include("dev/find_gmp_mpfr.jl"); print(mpfr_artifact_dir())')
echo "Path to MPFR: ${mpfr_path}"
# Make sure that we output an soname which corresponds to FLINT_JLL's
# soname
wget https://raw.githubusercontent.com/JuliaPackaging/Yggdrasil/master/F/FLINT/build_tarballs.jl
FLINT_JLL_VERSION=$(grep "upstream_version =" build_tarballs.jl | sed "s/upstream_version = v\"\([0-9\.]*\)\"/\1/")
FLINT_JLL_SONAME=$(grep "$FLINT_JLL_VERSION => " configure.ac | sed "s/# $FLINT_JLL_VERSION => \([0-9\.]\+\)/\1/")
FLINT_JLL_MAJOR=$(echo $FLINT_JLL_SONAME | sed "s/\([0-9]\+\)\.[0-9]\+\.[0-9]\+/\1/")
FLINT_JLL_MINOR=$(echo $FLINT_JLL_SONAME | sed "s/[0-9]\+\.\([0-9]\+\)\.[0-9]\+/\1/")
FLINT_JLL_PATCH=$(echo $FLINT_JLL_SONAME | sed "s/[0-9]\+\.[0-9]\+\.\([0-9]\+\)/\1/")
sed -i "s/^\(FLINT_MAJOR_SO=\)[0-9]\+/\1$FLINT_JLL_MAJOR/" configure.ac
sed -i "s/^\(FLINT_MINOR_SO=\)[0-9]\+/\1$FLINT_JLL_MINOR/" configure.ac
sed -i "s/^\(FLINT_PATCH_SO=\)[0-9]\+/\1$FLINT_JLL_PATCH/" configure.ac
# Now we can configure FLINT. However, recent versions of MPFR_jll has
# memory sanitation which messes with finding mpfr_init in the
# configure-script. Hence, we also omit the check for finding MPFR.
# FIXME: Probably want to fix this.
./bootstrap.sh
./configure \
CC=${CC} \
--prefix=${LOCAL} \
--with-gmp=${gmp_path} \
--with-mpfr=${mpfr_path} \
--disable-mpfr-check \
--disable-static \
--disable-debug
- name: "Compile and install"
run: |
$MAKE
$MAKE install
- name: "Set up Nemo.jl"
run: |
# Override FLINT_jll's libflint with ours
# NOTE: Reverse me when Nemo uses FLINT v3.
# git clone https://github.com/Nemocas/Nemo.jl.git
git clone https://github.com/albinahlback/Nemo.jl.git && cd Nemo.jl && git checkout flint3 && cd ..
julia -e "import Pkg; Pkg.develop(path=\"./Nemo.jl\");"
echo -e "[e134572f-a0d5-539d-bddf-3cad8db41a82]\nFLINT = \"${LOCAL}\"" > ~/.julia/artifacts/Overrides.toml
touch Nemo.jl/src/Nemo.jl
julia -e "using Nemo; println(\"Path to Nemo's libflint:\", Nemo.libflint)"
- name: "Check Nemo.jl"
run: |
julia -e "import Pkg; Pkg.test(\"Nemo\")"