Skip to content

Commit

Permalink
Merge pull request #2122 from albinahlback/ci_update
Browse files Browse the repository at this point in the history
Update CI runners
  • Loading branch information
albinahlback authored Dec 11, 2024
2 parents c2c8513 + 0cb476a commit cbdc611
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 165 deletions.
88 changes: 19 additions & 69 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ jobs:
macos-m1:
name: macOS-M1, Clang (x3)

runs-on: macos-14
runs-on: macos-15

env:
FLINT_TEST_MULTIPLIER: "3"
Expand All @@ -208,13 +208,16 @@ jobs:

- name: "Setup"
run: |
# GMP and MPFR are already installed, and it complains if we try to
# install it.
# brew install gmp
# brew install mpfr
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
brew install llvm
$(brew --prefix llvm)/bin/clang --version
gmake --version
autoconf --version
echo "MAKE=gmake -j$(expr $(nproc) + 1) -l 10 --output-sync=target" >> $GITHUB_ENV
Expand All @@ -223,7 +226,7 @@ jobs:
run: |
./bootstrap.sh
./configure \
CC=$(brew --prefix llvm@15)/bin/clang \
CC=$(brew --prefix llvm)/bin/clang \
--with-gmp=$(brew --prefix) \
--with-mpfr=$(brew --prefix) \
--disable-debug
Expand All @@ -242,71 +245,17 @@ jobs:
##############################################################################
# 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:
- name: "Rescale multiplier"
run: |
FLINT_TEST_MULTIPLIER=$(echo "${FLINT_TEST_MULTIPLIER} * ${GLOBAL_MULTIPLIER}" | bc)
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}"
echo "FLINT_TEST_MULTIPLIER=${FLINT_TEST_MULTIPLIER}" >> $GITHUB_ENV
- 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-debug
- name: "Compile library"
run: |
$MAKE
- name: "Compile tests"
run: |
$MAKE tests
- name: "Check"
run: |
$MAKE check
#############################################################################
# ubuntu with clang
# ubuntu with clang and BLAS
#############################################################################
ubuntu-clang:
name: Ubuntu Clang with examples (x5)
name: Ubuntu Clang, BLAS and examples (x5)

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

# NOTE: Clang is currently buggy on Ubuntu. Hence, we temporarily allow
# this job to fail.
continue-on-error: true

env:
LOCAL: ${{ github.workspace }}/local
Expand All @@ -325,7 +274,7 @@ jobs:

- name: "Setup"
run: |
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin perl
sudo apt-get install -y libgmp-dev libmpfr-dev autoconf libtool-bin perl libopenblas-dev
clang --version
make --version
autoconf --version
Expand All @@ -338,6 +287,7 @@ jobs:
./bootstrap.sh
./configure \
CC=${CC} \
--with-blas \
--disable-debug
- name: "Compile library"
Expand Down Expand Up @@ -496,7 +446,7 @@ jobs:
alpine-32bit:
name: Alpine Linux, musl, 32-bit (assert, x1.5)

runs-on: ubuntu-latest
runs-on: ubuntu-24.04

env:
CC: "gcc"
Expand Down Expand Up @@ -565,7 +515,7 @@ jobs:
# nemo
##############################################################################
nemo:
name: Nemo.jl (temporary branch)
name: Nemo.jl

runs-on: ubuntu-24.04

Expand Down
2 changes: 1 addition & 1 deletion CMake/FindPThreads.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ find_library(PThreads_LIBRARIES NAMES pthreads libpthreads )
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PThreads DEFAULT_MSG PThreads_INCLUDE_DIRS PThreads_LIBRARIES)

mark_as_advanced(PThreads_INCLUDE_DIRS PThreads_LIBRARIES)
mark_as_advanced(PThreads_INCLUDE_DIRS PThreads_LIBRARIES)
2 changes: 1 addition & 1 deletion CMake/FindSphinx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ function(Sphinx_add_target target_name builder conf source destination)
APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${destination}
)

endfunction()
endfunction()
60 changes: 30 additions & 30 deletions src/fmpz_mat/test/t-minpoly.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,50 @@
#include "fmpz_mat.h"
#include "fmpz_poly.h"

/* NOTE: Clang >= 18 cannot compile this on x86 systems for some reason.
* Therefore, push this to a separate function to avoid segfaults during
* compilation. */
FLINT_STATIC_NOINLINE void set_matrix(fmpz_mat_t am, slong n)
{
slong ix, jx;

for (ix = 0; ix < n/2; ix++)
for (jx = 0; jx < n/2; jx++)
{
fmpz_zero(fmpz_mat_entry(am, ix + n/2, jx));
fmpz_zero(fmpz_mat_entry(am, ix, jx + n/2));
fmpz_set(fmpz_mat_entry(am, ix + n/2, jx + n/2), fmpz_mat_entry(am, ix, jx));
}
}

TEST_FUNCTION_START(fmpz_mat_minpoly, state)
{
slong m, n, rep, i, j;
slong n, rep;

for (rep = 0; rep < 1000 * flint_test_multiplier(); rep++)
{
fmpz_t c;
fmpz_mat_t A;
fmpz_poly_t f, g, q, r;
slong ix;

m = n_randint(state, 4);
n = m;
n = n_randint(state, 4);

fmpz_init(c);
fmpz_mat_init(A, m, n);
fmpz_mat_init(A, n, n);
fmpz_poly_init(f);
fmpz_poly_init(g);
fmpz_poly_init(q);
fmpz_poly_init(r);

fmpz_mat_randtest(A, state, 10);

for (i = 0; i < n/2; i++)
{
for (j = 0; j < n/2; j++)
{
fmpz_zero(fmpz_mat_entry(A, i + n/2, j));
fmpz_zero(fmpz_mat_entry(A, i, j + n/2));
fmpz_set(fmpz_mat_entry(A, i + n/2, j + n/2), fmpz_mat_entry(A, i, j));
}
}
set_matrix(A, n);

for (i = 0; i < 10; i++)
for (ix = 0; ix < 10; ix++)
{
fmpz_randtest(c, state, 5);
fmpz_mat_similarity(A, n_randint(state, m), c);
fmpz_mat_similarity(A, n_randint(state, n), c);
}

fmpz_mat_minpoly(f, A);
Expand Down Expand Up @@ -81,34 +89,26 @@ TEST_FUNCTION_START(fmpz_mat_minpoly, state)
fmpz_t c;
fmpz_mat_t A, B;
fmpz_poly_t f, g;
slong ix;

m = n_randint(state, 4);
n = m;
n = n_randint(state, 4);

fmpz_init(c);
fmpz_mat_init(A, m, n);
fmpz_mat_init(B, m, n);
fmpz_mat_init(A, n, n);
fmpz_mat_init(B, n, n);
fmpz_poly_init(f);
fmpz_poly_init(g);

fmpz_mat_randtest(A, state, 10);

for (i = 0; i < n/2; i++)
{
for (j = 0; j < n/2; j++)
{
fmpz_zero(fmpz_mat_entry(A, i + n/2, j));
fmpz_zero(fmpz_mat_entry(A, i, j + n/2));
fmpz_set(fmpz_mat_entry(A, i + n/2, j + n/2), fmpz_mat_entry(A, i, j));
}
}
set_matrix(A, n);

fmpz_mat_set(B, A);

for (i = 0; i < 10; i++)
for (ix = 0; ix < 10; ix++)
{
fmpz_randtest(c, state, 5);
fmpz_mat_similarity(B, n_randint(state, m), c);
fmpz_mat_similarity(B, n_randint(state, n), c);
}

fmpz_mat_minpoly(f, A);
Expand Down
2 changes: 1 addition & 1 deletion src/fmpz_mod_mat/det.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ void fmpz_mod_mat_det(fmpz_t res, const fmpz_mod_mat_t mat, const fmpz_mod_ctx_t
GR_MUST_SUCCEED(gr_mat_det_berkowitz(res, (const gr_mat_struct *) mat, gr_ctx));
}
}
}
}
7 changes: 2 additions & 5 deletions src/generic_files/clz_tab.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ Inc.
*/

#include "flint.h"
#include "longlong.h"

#ifdef NEED_CLZ_TAB

#if NEED_CLZ_TAB
const unsigned char __flint_clz_tab[128] =
{
1,2,3,3,4,4,4,4,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
};

#else

typedef int this_file_is_empty;

#endif
2 changes: 1 addition & 1 deletion src/gr_mat/set_gr_mat_other.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ gr_mat_set_gr_mat_other(gr_mat_t res, const gr_mat_t mat, gr_ctx_t mat_ctx, gr_c
status |= gr_set_other(GR_MAT_ENTRY(res, i, j, sz), GR_MAT_ENTRY(mat, i, j, mat_sz), mat_ctx, ctx);

return status;
}
}
Loading

0 comments on commit cbdc611

Please sign in to comment.