Skip to content

Configurable longlong.h #1591

Configurable longlong.h

Configurable longlong.h #1591

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- trunk
- 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 trunk branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/trunk' || 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
sudo apt-get install -y libmpfr-dev
sudo apt-get install -y autoconf
sudo apt-get install -y libtool-bin
gcc --version
gcov --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} \
--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: "Gather coverage data"
run: dev/gather_coverage.sh
- name: "Upload coverage data"
uses: codecov/[email protected]
##############################################################################
# ubuntu, gcc, 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-gmp=/usr \
--with-mpfr=/usr \
--with-ntl=/usr \
--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 with gcc and blas
##############################################################################
macos-gcc:
name: macOS GCC with BLAS (x3)
runs-on: macos-latest
env:
CC: "gcc"
FLINT_TEST_MULTIPLIER: "3"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
brew install gcc
brew install make
brew install gmp
brew install mpfr
brew install autoconf
brew install libtool
brew install automake
brew install openblas
gcc --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=${CC} \
--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
##############################################################################
# freebsd with clang
##############################################################################
freebsd-gcc:
name: FreeBSD Clang (x0.5)
runs-on: macos-latest
env:
FLINT_TEST_MULTIPLIER: "0.5"
steps:
- uses: actions/checkout@v4
- name: "Run tests on FreeBSD"
uses: cross-platform-actions/[email protected]
timeout-minutes: 30
continue-on-error: true
with:
operating_system: freebsd
version: '13.2'
shell: bash
run: |
sudo pkg install -y pkgconf gmake gmp mpfr autoconf libtool automake
gmake --version
clang --version
autoconf --version
libtool --version
touch _is_setup
./bootstrap.sh
touch _is_bootstrapped
./configure \
CC=clang \
--with-gmp-include=$(pkgconf --variable=includedir gmp) \
--with-gmp-lib=$(pkgconf --variable=libdir gmp) \
--with-mpfr-include=$(pkgconf --variable=includedir mpfr) \
--with-mpfr-lib=$(pkgconf --variable=libdir mpfr) \
--disable-static \
--disable-debug
touch _is_configured
gmake -j$(expr $(sysctl -n hw.ncpu) + 1)
touch _is_library_built
gmake -j$(expr $(sysctl -n hw.ncpu) + 1) tests
touch _is_tests_built
gmake -j$(expr $(sysctl -n hw.ncpu) + 1) check
touch _is_checked
# Sometimes the FreeBSD runner cannot exit properly. We created files
# for each step to show that it was able to run the tests.
- if: always()
name: "Check that everything was okay"
run: |
if test ! -f _is_setup;
then
echo "Setup failed!"
exit 1
elif test ! -f _is_bootstrapped;
then
echo "Bootstrap failed!"
exit 2
elif test ! -f _is_configured;
then
echo "Configuration failed!"
exit 3
elif test ! -f _is_library_built;
then
echo "Building library failed!"
exit 4
elif test ! -f _is_tests_built;
then
echo "Building tests failed!"
exit 5
elif test ! -f _is_checked;
then
echo "Check failed!"
exit 6
fi
echo "All good!"
##############################################################################
# cygwin with gcc
##############################################################################
cygwin-gcc:
name: Cygwin GCC (x0.5)
runs-on: windows-latest
defaults:
run:
shell: C:\cygwin64\bin\bash.exe --login -o igncr '{0}'
env:
REPO: /cygdrive/d/a/flint/flint # FIXME: De-hardcode this
CC: "gcc"
FLINT_TEST_MULTIPLIER: "0.5"
steps:
- uses: actions/checkout@v4
- name: "Set up Cygwin"
uses: gap-actions/setup-cygwin@v1
with:
PKGS_TO_INSTALL: "dos2unix,gcc-core,make,libgmp-devel,libmpfr-devel,libtool,autoconf,automake"
- 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: |
cd ${REPO}
dos2unix configure
dos2unix bootstrap.sh
./bootstrap.sh
./configure \
CC=${CC} \
--disable-static \
--disable-debug
- name: "Compile library"
run: |
cd ${REPO}
${MAKE}
- name: "Compile tests"
run: |
cd ${REPO}
$MAKE tests
- name: "Check"
run: |
cd ${REPO}
$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
#############################################################################
# ubuntu with gcc and cmake (no checks)
#############################################################################
ubuntu-cmake-gcc:
name: Ubuntu GCC, CMake (no checks)
runs-on: ubuntu-latest
env:
LOCAL: ${{ github.workspace }}/local
LDFLAGS: "-Wl,-rpath,$LOCAL/lib"
steps:
- uses: actions/checkout@v4
- name: "Setup"
run: |
sudo apt-get install -y cmake
sudo apt-get install -y libgmp-dev
sudo apt-get install -y libmpfr-dev
gcc --version
make --version
cmake --version
echo "MAKE=make -j$(expr $(nproc) + 1) --output-sync=target" >> $GITHUB_ENV
- name: "Configure"
run: |
mkdir build
cd build
cmake -G"Unix Makefiles" -DWITH_NTL=no -DBUILD_TESTING=yes \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${LOCAL} ..
- name: "Compile library"
run: |
cd build
$MAKE
ldd lib/libflint.so
#############################################################################
# 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@v6
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
toolset: 14.37.32822
vsversion: 17.6.0
- 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 /std:c11 /experimental:c11atomics" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release ..
- name: "Build"
run: |
cd build
cmake --build . -- -j3
- name: "Check"
run: |
cd build
set "FLINT_TEST_MULTIPLIER=1"
ctest -j3 --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\")"