Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanity checking FLINT #2085

Open
wants to merge 173 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
b2a518d
Add configure option for sanity check
albinahlback Oct 4, 2024
ed16203
Do not push -Wmissing-prototypes on inlines.c
albinahlback Oct 4, 2024
3f85860
Remove FLINT_UNUSED from header files
albinahlback Oct 5, 2024
cb23003
Remove unused macros in flint.h
albinahlback Oct 5, 2024
b79f504
Introduce FLINT header start and end macro
albinahlback Oct 5, 2024
1840d9b
Move FLINT_TLS_PREFIX to start of declaration
albinahlback Oct 7, 2024
e3a2262
Set TESTCFLAGS for sanity check
albinahlback Oct 8, 2024
bb4f76c
Use --enable-sanity-check in CI
albinahlback Oct 7, 2024
7b213b3
Fix symbol for arb_mat_entrywise_is_zero
albinahlback Oct 8, 2024
8cee534
generic_files
albinahlback Oct 4, 2024
d868a78
thread_support
albinahlback Oct 4, 2024
850bc57
ulong_extras
albinahlback Oct 4, 2024
e4412c4
nfloat
albinahlback Oct 5, 2024
93c38ce
mpn_extras
albinahlback Oct 5, 2024
1bc100e
nmod_vec
albinahlback Oct 5, 2024
3df7efa
nmod_mat
albinahlback Oct 5, 2024
9ad0dfb
nmod_poly
albinahlback Oct 5, 2024
90e57a1
mpn_mod
albinahlback Oct 5, 2024
b4adc40
fmpz
albinahlback Oct 5, 2024
2a6aad4
fmpq_vec
albinahlback Oct 5, 2024
442a106
fmpz_mat
albinahlback Oct 5, 2024
36cf1e0
fmpz_poly
albinahlback Oct 5, 2024
2d4ad4f
fmpz_mod
albinahlback Oct 6, 2024
c0703c6
fmpz_mod_vec
albinahlback Oct 6, 2024
d46cc5c
fmpz_mod_mat
albinahlback Oct 6, 2024
c10ee22
fmpz_mod_poly
albinahlback Oct 5, 2024
95900ae
fmpq
albinahlback Oct 6, 2024
4bc69e3
fmpq_mat
albinahlback Oct 6, 2024
b9256d9
fmpq_poly
albinahlback Oct 6, 2024
27c9e7e
fq_mat_templates
albinahlback Oct 6, 2024
6d726dd
fq_poly_templates
albinahlback Oct 6, 2024
91d9124
fq_poly_factor_templates
albinahlback Oct 6, 2024
3617997
fq_nmod
albinahlback Oct 6, 2024
0508c4b
fq
albinahlback Oct 6, 2024
dc07303
fq_nmod_mat
albinahlback Oct 6, 2024
09408ee
fq_nmod_poly
albinahlback Oct 6, 2024
8b06100
fq_zech
albinahlback Oct 6, 2024
8d6901e
padic
albinahlback Oct 6, 2024
4ee27cb
qadic
albinahlback Oct 6, 2024
ff6c5ae
nmod_poly_factor
albinahlback Oct 6, 2024
ec124bb
fmpz_factor
albinahlback Oct 6, 2024
f9fb156
fmpz_poly_factor
albinahlback Oct 6, 2024
b648337
fmpz_mod_poly_factor
albinahlback Oct 6, 2024
1423e65
nmod_poly_mat
albinahlback Oct 6, 2024
b0c9f2d
fmpz_poly_mat
albinahlback Oct 6, 2024
7425f80
mpoly
albinahlback Oct 6, 2024
d5ad46e
nmod_mpoly
albinahlback Oct 6, 2024
5ec812e
fmpz_mpoly
albinahlback Oct 6, 2024
75dbb2e
fmpz_mod_mpoly
albinahlback Oct 6, 2024
57a1240
fq_nmod_mpoly
albinahlback Oct 6, 2024
b48774d
nmod_mpoly_factor
albinahlback Oct 6, 2024
6a70c65
fmpz_mpoly_factor
albinahlback Oct 6, 2024
3784cbf
fq_zech_mpoly
albinahlback Oct 6, 2024
43a604d
fq_zech_mpoly_factor
albinahlback Oct 6, 2024
e1043cd
fmpq_mpoly
albinahlback Oct 6, 2024
7483f30
fmpz_mod_mpoly_factor
albinahlback Oct 6, 2024
6c48701
fmpq_mpoly_factor
albinahlback Oct 6, 2024
ed9f778
fq_nmod_mpoly_factor
albinahlback Oct 6, 2024
db5f8c3
fft
albinahlback Oct 5, 2024
3e4c10b
fft_small
albinahlback Oct 6, 2024
e9cae31
fmpz_poly_q
albinahlback Oct 6, 2024
afae44c
fmpz_lll
albinahlback Oct 6, 2024
da3f9d0
n_poly
albinahlback Oct 6, 2024
3d17ec6
arith
albinahlback Oct 6, 2024
a2fbe4a
qsieve
albinahlback Oct 7, 2024
59527c4
aprcl
albinahlback Oct 7, 2024
1eade77
nf_elem
albinahlback Oct 7, 2024
1e9c656
qfb
albinahlback Oct 7, 2024
bf45f1c
double_interval
albinahlback Oct 7, 2024
83d1fa2
dlog
albinahlback Oct 7, 2024
89e641c
fmpzi
albinahlback Oct 7, 2024
56af5a9
bool_mat
albinahlback Oct 7, 2024
9cf3951
partitions
albinahlback Oct 7, 2024
750149a
mag
albinahlback Oct 7, 2024
73f6d6b
arf
albinahlback Oct 7, 2024
a3e08b1
acf
albinahlback Oct 7, 2024
f7be657
arb
albinahlback Oct 7, 2024
df27e38
acb
albinahlback Oct 7, 2024
4c51e01
arb_mat
albinahlback Oct 8, 2024
e4dbbc9
arb_poly
albinahlback Oct 8, 2024
df651f3
arb_hypgeom
albinahlback Oct 8, 2024
fd1ad12
acb_mat
albinahlback Oct 8, 2024
f78d869
acb_poly
albinahlback Oct 8, 2024
5eab58a
acb_calc
albinahlback Oct 8, 2024
74ac4d9
arb_fpwrap
albinahlback Oct 8, 2024
058e498
acb_dft
albinahlback Oct 8, 2024
71da249
acb_hypgeom
albinahlback Oct 8, 2024
d3764a5
acb_elliptic
albinahlback Oct 8, 2024
f7dd7b0
acb_modular
albinahlback Oct 8, 2024
1f67aaa
acb_dirichlet
albinahlback Oct 8, 2024
1a02da2
acb_theta
albinahlback Oct 8, 2024
838a5cf
dirichlet
albinahlback Oct 7, 2024
ada84b9
bernoulli
albinahlback Oct 8, 2024
8a6d57d
hypgeom
albinahlback Oct 8, 2024
86bcdc5
gr
albinahlback Oct 5, 2024
090df2b
ca
albinahlback Oct 8, 2024
81676fb
ca_mat
albinahlback Oct 8, 2024
dc317a0
ca_poly
albinahlback Oct 8, 2024
882e879
ca_vec
albinahlback Oct 8, 2024
5294c81
fexpr
albinahlback Oct 8, 2024
eed843e
gr_mpoly
albinahlback Oct 8, 2024
0efac5e
gr_generic
albinahlback Oct 5, 2024
fa6adb3
gr_vec
albinahlback Oct 8, 2024
dd7c9bf
gr_mat
albinahlback Oct 8, 2024
a30910c
gr_poly
albinahlback Oct 5, 2024
82a954d
gr_special
albinahlback Oct 8, 2024
01765b5
fmpz_mpoly_q
albinahlback Oct 8, 2024
77e1fd0
calcium
albinahlback Oct 8, 2024
8d49390
qqbar
albinahlback Oct 8, 2024
fd0a8d2
ca_ext
albinahlback Oct 8, 2024
d63713b
ca_field
albinahlback Oct 8, 2024
ab33d2c
padic_poly
albinahlback Oct 9, 2024
77dabaa
fmpz_vec
albinahlback Oct 9, 2024
46738f2
arb_calc
albinahlback Oct 9, 2024
979fe27
Add arb_mat-impl.h
albinahlback Nov 2, 2024
0b9e75c
Add nmod_poly-impl.h
albinahlback Nov 2, 2024
e0258a0
Add arb-impl.h
albinahlback Nov 2, 2024
a49c992
Add ca_poly-impl.h
albinahlback Nov 2, 2024
8afbdf8
Add acb_poly-impl.h
albinahlback Nov 2, 2024
4ab5b03
Add ca-impl.h
albinahlback Nov 2, 2024
60d3de7
Add ca_field-impl.h
albinahlback Nov 2, 2024
c450642
Add fmpzi-impl.h
albinahlback Nov 2, 2024
a88127c
Add arb_hypgeom-impl.h
albinahlback Nov 2, 2024
7adc4e0
Add acb-impl.h
albinahlback Nov 2, 2024
9153fb4
Add n_poly-impl.h
albinahlback Nov 2, 2024
35c0e91
Add acb_hypgeom-impl.h
albinahlback Nov 2, 2024
ec48560
Add qqbar-impl.h
albinahlback Nov 2, 2024
60a7d57
gr_generic
albinahlback Nov 2, 2024
a7d0cae
Add gr_vec-impl.h
albinahlback Nov 2, 2024
8199e89
Add arb_poly-impl.h
albinahlback Nov 2, 2024
cab8409
Add acb_dft-impl.h
albinahlback Nov 2, 2024
5c41060
Add fmpz-impl.h
albinahlback Nov 3, 2024
282bf4e
qadic
albinahlback Nov 3, 2024
bfcc853
Add arith-impl.h
albinahlback Nov 3, 2024
43cc9a9
Add partitions-impl.h
albinahlback Nov 3, 2024
91ff344
gr_mpoly
albinahlback Nov 3, 2024
4ea18a4
Add ca_mat-impl.h
albinahlback Nov 3, 2024
2b6e5ed
Add fmpq_poly-impl.h
albinahlback Nov 3, 2024
2aebb2f
Add acb_modular-impl.h
albinahlback Nov 3, 2024
0bde95d
Add fq_zech_mpoly-impl.h
albinahlback Nov 3, 2024
8340ac3
Add fmpq_mat-impl.h
albinahlback Nov 4, 2024
b0894c9
Add acb_dirichlet-impl.h
albinahlback Nov 4, 2024
4ebbf83
Add gr_poly-impl.h
albinahlback Nov 4, 2024
081550d
Add fmpz_poly-impl.h
albinahlback Nov 4, 2024
7342f8e
Add fq_nmod_mpoly-impl.h
albinahlback Nov 4, 2024
7f2977b
Add mag-impl.h
albinahlback Nov 4, 2024
d629c11
Add bernoulli-impl.h
albinahlback Nov 4, 2024
ecacbb3
Add mpn_mod-impl.h
albinahlback Nov 4, 2024
2fa422a
gr
albinahlback Nov 4, 2024
4721c6f
Make functions in gr static
albinahlback Nov 4, 2024
afc57c6
fixup
albinahlback Nov 4, 2024
0098821
fexpr
albinahlback Nov 5, 2024
ba62768
ca-impl.h
albinahlback Nov 5, 2024
3e633a5
ca_mat
albinahlback Nov 5, 2024
2592add
Add qadic-impl.h
albinahlback Nov 5, 2024
983945e
ca-impl.h
albinahlback Nov 5, 2024
7992cec
fmpz-impl.h
albinahlback Nov 5, 2024
8c6c080
ca-impl.h
albinahlback Nov 5, 2024
1b3ccd7
qqbar
albinahlback Nov 5, 2024
db6979a
bernoulli-impl.h
albinahlback Nov 5, 2024
2304c07
gr_mpoly
albinahlback Nov 5, 2024
c5f9e68
Remove unused fmpz_mpoly_factor_add
albinahlback Nov 5, 2024
b380f4e
acb_hypgeom-impl.h
albinahlback Nov 5, 2024
c6aabcf
acb_hypgeom-impl.h
albinahlback Nov 5, 2024
ed0fa86
acb_dirichlet-impl.h
albinahlback Nov 5, 2024
f513af3
acb_dirichlet-impl.h
albinahlback Nov 5, 2024
753451b
arb-impl.h
albinahlback Nov 5, 2024
67b7511
arb-impl.h
albinahlback Nov 5, 2024
16d98f1
Fix ARB_DEF_CACHED_CONSTANT
albinahlback Nov 5, 2024
e5e3f75
Add gr-impl.h
albinahlback Nov 5, 2024
124f61b
gr
albinahlback Nov 5, 2024
94d3ec8
gr-impl.h
albinahlback Nov 5, 2024
b2128a6
Push qqbar_get_str_nd to qqbar.h
albinahlback Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 10 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,15 @@ jobs:


##############################################################################
# gcc build check no regressions
# gcc sanity check
##############################################################################
gcc-build-regression-check:
name: GCC build regression check (no tests)
gcc-sanity-check:
name: GCC sanity check

runs-on: ubuntu-24.04

env:
CC: "gcc"
CFLAGS: "-march=native -std=c11 -Wall -Wextra -Werror"
MODULES: "build/thread_pool_merged.lo build/thread_support_merged.lo build/ulong_extras_merged.lo build/long_extras_merged.lo build/perm_merged.lo build/double_extras_merged.lo build/d_vec_merged.lo build/d_mat_merged.lo build/mpn_extras_merged.lo build/mpfr_vec_merged.lo build/mpfr_mat_merged.lo build/nmod_merged.lo build/nmod_vec_merged.lo build/nmod_mat_merged.lo build/nmod_poly_merged.lo build/mpn_mod_merged.lo build/fmpz_merged.lo build/fmpz_vec_merged.lo build/fmpz_mat_merged.lo build/fmpz_poly_merged.lo build/fmpz_mod_merged.lo build/fmpz_mod_vec_merged.lo build/fmpz_mod_mat_merged.lo build/fmpz_mod_poly_merged.lo build/fmpq_merged.lo build/fmpq_vec_merged.lo build/fmpq_mat_merged.lo build/fmpq_poly_merged.lo build/fq_merged.lo build/fq_vec_merged.lo build/fq_mat_merged.lo build/fq_poly_merged.lo build/fq_nmod_merged.lo build/fq_nmod_vec_merged.lo build/fq_nmod_mat_merged.lo build/fq_nmod_poly_merged.lo build/fq_zech_merged.lo build/fq_zech_mat_merged.lo build/fq_zech_poly_merged.lo build/fq_default_merged.lo build/fq_default_mat_merged.lo build/fq_default_poly_merged.lo build/fq_embed_merged.lo build/fq_nmod_embed_merged.lo build/fq_zech_embed_merged.lo build/padic_merged.lo build/padic_mat_merged.lo build/padic_poly_merged.lo build/qadic_merged.lo build/nmod_poly_factor_merged.lo build/fmpz_factor_merged.lo build/fmpz_poly_factor_merged.lo build/fmpz_mod_poly_factor_merged.lo build/fq_poly_factor_merged.lo build/fq_nmod_poly_factor_merged.lo build/fq_zech_poly_factor_merged.lo build/fq_default_poly_factor_merged.lo build/nmod_poly_mat_merged.lo build/fmpz_poly_mat_merged.lo build/mpoly_merged.lo build/nmod_mpoly_merged.lo build/fmpz_mpoly_merged.lo build/fmpz_mod_mpoly_merged.lo build/fmpq_mpoly_merged.lo build/fq_nmod_mpoly_merged.lo build/fq_zech_mpoly_merged.lo build/nmod_mpoly_factor_merged.lo build/fmpz_mpoly_factor_merged.lo build/fmpz_mod_mpoly_factor_merged.lo build/fmpq_mpoly_factor_merged.lo build/fq_nmod_mpoly_factor_merged.lo build/fq_zech_mpoly_factor_merged.lo build/fft_merged.lo build/fft_small_merged.lo"
# Everything until fmpz_poly_q

steps:
- uses: actions/checkout@v4
Expand All @@ -123,12 +120,15 @@ jobs:
./bootstrap.sh
./configure \
CC=${CC} \
CFLAGS="${CFLAGS}" \
--disable-debug
--enable-sanity-check

- name: "Check regression in a subset of modules"
- name: "Build with sanity"
run: |
$MAKE $MODULES
$MAKE

- name: "Build tests with sanity"
run: |
$MAKE



Expand Down
9 changes: 9 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ GC_LIB_PATH:=@GC_LIB_PATH@
NTL_LIB_PATH:=@NTL_LIB_PATH@

CFLAGS:=@CFLAGS@
CFLAGS_INLINE:=$(filter-out -Wmissing-declarations -Wmissing-prototypes,$(CFLAGS))
TESTCFLAGS:=@TESTCFLAGS@
CPPFLAGS:=-I$(ABS_SRC_DIR) -I$(SRC_DIR) @CPPFLAGS@ -DBUILDING_FLINT
CPPFLAGS2:=-L$(ABS_FLINT_DIR) $(CPPFLAGS)
Expand Down Expand Up @@ -592,6 +593,10 @@ define xxx_OBJS_rule
$(BUILD_DIR)/$(1)/%.o: $(ABS_SRC_DIR)/$(1)/%.c | $(BUILD_DIR)/$(1)
@echo " CC $$(<:$(ABS_SRC_DIR)/%=%)"
@$(CC) $(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)

$(BUILD_DIR)/$(1)/inlines.o: $(ABS_SRC_DIR)/$(1)/inlines.c | $(BUILD_DIR)/$(1)
@echo " CC $$(<:$(ABS_SRC_DIR)/%=%)"
@$(CC) $(CFLAGS_INLINE) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
endef

ifeq ($(IS_OUT_OF_TREE),1)
Expand All @@ -618,6 +623,10 @@ define xxx_LOBJS_rule
$(BUILD_DIR)/$(1)/%.lo: $(ABS_SRC_DIR)/$(1)/%.c | $(BUILD_DIR)/$(1)
@echo " CC $$(<:$(ABS_SRC_DIR)/%=%)"
@$(CC) $(PIC_FLAG) $(CFLAGS) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)

$(BUILD_DIR)/$(1)/inlines.lo: $(ABS_SRC_DIR)/$(1)/inlines.c | $(BUILD_DIR)/$(1)
@echo " CC $$(<:$(ABS_SRC_DIR)/%=%)"
@$(CC) $(PIC_FLAG) $(CFLAGS_INLINE) $($(1)_CFLAGS) $(CPPFLAGS) $(LIB_CPPFLAGS) -c $$< -o $$@ $$(DEPFLAGS)
endef

ifeq ($(IS_OUT_OF_TREE),1)
Expand Down
90 changes: 66 additions & 24 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,32 @@ yes|no)
esac],
enable_coverage="no")

# NOTE: Maintainer-level only. Does not optimize, and turns on a lot of
# warnings, all of which are turned to errors. Defaults debugging to no.
AC_ARG_ENABLE(sanity-check,[],
[case $enableval in
yes|no)
;;
*)
AC_MSG_ERROR([Bad value $enableval for --enable-sanity-check. Need yes or no.])
;;
esac
if test "$enableval" = "yes" && test "$cflags_set" = "yes";
then
AC_MSG_ERROR([Cannot enable sanity check and push other CFLAGS at the same time.])
elif test "$enableval" = "yes" && test "$testcflags_set" = "yes";
then
AC_MSG_ERROR([Cannot enable sanity check and push other TESTCFLAGS at the same time.])
fi],
enable_sanity_check="no")

# NOTE: -Wdeclaration-after-statement and -Wcast-qual is not in here. We also
# remove -Wcast-function-type for GR.
sanity_check_CFLAGS="-Werror -Wall -Wextra -Wno-cast-function-type -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -pedantic -std=c11 -O0"

# We take CFLAGS but ignore -Wsign-compare, -Wmissing-declarations and -Wmissing-prototypes.
sanity_check_TESTCFLAGS="-Werror -Wall -Wextra -Wno-cast-function-type -Wno-sign-compare -Wcast-align -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -pedantic -std=c11 -O0"

AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[Compile FLINT with debug information [default=yes]])],
[case $enableval in
Expand All @@ -244,7 +270,12 @@ yes|no)
AC_MSG_ERROR([Bad value $enableval for --enable-debug. Need yes or no.])
;;
esac],
enable_debug="yes")
if test "$enable_sanity_check" = "no";
then
enable_debug="yes"
else
enable_debug="no"
fi)

AC_ARG_ENABLE(dependency-tracking,
[AS_HELP_STRING([--enable-dependency-tracking],[Enable GCC automated dependency tracking [default=yes]])],
Expand Down Expand Up @@ -323,18 +354,6 @@ yes|no)
esac],
enable_mpfr_check="yes")

# NOTE: Maintainer level only. Avoids any sort of optimization to speed up
# builds.
AC_ARG_ENABLE(fast-build,[],
[case $enableval in
yes|no)
;;
*)
AC_MSG_ERROR([Bad value $enableval for --enable-fast-build. Need yes or no.])
;;
esac],
enable_fast_build="no")

################################################################################
# packages
################################################################################
Expand Down Expand Up @@ -534,11 +553,7 @@ fi
# architecture specifics
################################################################################

if test "$enable_fast_build" = "no";
then
gcc_cflags="-O3 "
fi
gcc_cflags="$gcc_cflags-pedantic -std=c11"
gcc_cflags="-O3 -pedantic -std=c11"
gcc_warnings="-Werror=implicit-function-declaration -Wall -Wno-stringop-overread -Wno-stringop-overflow -Wno-maybe-uninitialized"

dnl We only try to provide specifics for those systems that currently supports
Expand Down Expand Up @@ -1240,7 +1255,31 @@ then
[AC_MSG_ERROR([$CC does not support the flag -mavx512f needed for AVX512 instructions])])
fi

if test "$cflags_set" = "no";
if test "$enable_sanity_check" = "yes";
then
for flag in $sanity_check_CFLAGS;
do
AX_CHECK_COMPILE_FLAG([$flag],[save_CFLAGS="$flag $save_CFLAGS"],
[AC_MSG_ERROR([$CC does not support $flag needed for sanity check.])])
done
found_single="no"
for flag in $gcc_cflags_arch;
do
if test "$found_single" = "yes";
then
found_single="no"
break
else
AX_CHECK_COMPILE_FLAG([$flag],
[save_CFLAGS="$flag $save_CFLAGS"
sanity_check_TESTCFLAGS="$flag $sanity_check_TESTCFLAGS"
found_single="yes"],
[unset flint_cv_have_fft_small_x86_i
unset flint_cv_have_fft_small_arm_i])
fi
done
CFLAGS="$save_CFLAGS"
elif test "$cflags_set" = "no";
then
for flag in $gcc_cflags $gcc_warnings;
do
Expand Down Expand Up @@ -1272,10 +1311,8 @@ then
fi
done
done
if test "$enable_fast_build" = no;
then
AX_CHECK_COMPILE_FLAG([-funroll-loops],[unroll_loops="yes"])
fi

AX_CHECK_COMPILE_FLAG([-funroll-loops],[unroll_loops="yes"])
if test "$unroll_loops" = "yes";
then
AC_SUBST(UNROLL_LOOPS,1)
Expand All @@ -1292,7 +1329,12 @@ fi

if test "$testcflags_set" = "no";
then
TESTCFLAGS="$CFLAGS"
if test "$enable_sanity_check" = "no";
then
TESTCFLAGS="$CFLAGS"
else
TESTCFLAGS="$sanity_check_TESTCFLAGS"
fi
else
TESTCFLAGS="$TESTCFLAGS $save_CFLAGS"
fi
Expand Down
29 changes: 29 additions & 0 deletions src/acb-impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright (C) 2024 Albin Ahlbäck

This file is part of FLINT.

FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#ifndef ACB_IMPL_H
#define ACB_IMPL_H

#include "acb_types.h"

#ifdef __cplusplus
extern "C" {
#endif

void acb_zeta_si(acb_t z, slong s, slong prec);

void acb_gamma_stirling_eval(acb_t s, const acb_t z, slong nterms, int digamma, slong prec);

#ifdef __cplusplus
}
#endif

#endif /* ACB_IMPL_H */
3 changes: 1 addition & 2 deletions src/acb/agm.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "arb-impl.h"
#include "acb.h"

void mag_agm(mag_t res, const mag_t x, const mag_t y);

static void
agm_helper(acb_t res, const acb_t a, const acb_t b, slong prec)
{
Expand Down
13 changes: 6 additions & 7 deletions src/acb/agm1.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "arb-impl.h"
#include "acb.h"
#include "acb_poly.h"

void mag_agm(mag_t res, const mag_t x, const mag_t y);

/* Checks that |arg(z)| <= 3 pi / 4 */
static int
acb_check_arg(const acb_t z)
Expand Down Expand Up @@ -99,7 +98,7 @@ acb_agm_close_taylor(acb_t res, acb_t z, acb_t z2,
}

static void
acb_agm1_around_zero(acb_t res, const acb_t z, slong prec)
acb_agm1_around_zero(acb_t res, const acb_t z, slong FLINT_UNUSED(prec))
{
mag_t a, b;
mag_init(a);
Expand All @@ -113,7 +112,7 @@ acb_agm1_around_zero(acb_t res, const acb_t z, slong prec)
mag_clear(b);
}

void
static void
acb_agm1_basecase(acb_t res, const acb_t z, slong prec)
{
acb_t a, b, t, u;
Expand Down Expand Up @@ -207,7 +206,7 @@ acb_agm1_basecase(acb_t res, const acb_t z, slong prec)
Computes (M(z), M'(z)) using a finite difference.
Assumes z exact, |arg(z)| <= 3 pi / 4.
*/
void
static void
acb_agm1_deriv_diff(acb_t Mz, acb_t Mzp, const acb_t z, slong prec)
{
mag_t err, t, C;
Expand Down Expand Up @@ -341,7 +340,7 @@ This is assuming that the circle at z with radius |eps| + r
does not cross the negative half axis, which we check.
*/

void
static void
acb_agm1_deriv_right(acb_t Mz, acb_t Mzp, const acb_t z, slong prec)
{
if (acb_is_exact(z))
Expand Down Expand Up @@ -496,7 +495,7 @@ acb_agm1(acb_t res, const acb_t z, slong prec)
}
}

void
static void
acb_agm1_deriv(acb_t Mz, acb_t Mzp, const acb_t z, slong prec)
{
/*
Expand Down
22 changes: 6 additions & 16 deletions src/acb/approx_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,12 @@
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/

#include "acb.h"
#include "mpn_extras.h"

/* We need uint64_t instead of ulong on 32-bit systems for
safe summation of 30-bit error bounds. */
#include <stdint.h>

void
_arb_dot_addmul_generic(nn_ptr sum, nn_ptr serr, nn_ptr tmp, slong sn,
nn_srcptr xptr, slong xn, nn_srcptr yptr, slong yn,
int negative, flint_bitcnt_t shift);

void
_arb_dot_add_generic(nn_ptr sum, nn_ptr serr, nn_ptr tmp, slong sn,
nn_srcptr xptr, slong xn,
int negative, flint_bitcnt_t shift);
#include "mpn_extras.h"
#include "arb-impl.h"
#include "acb.h"

static void
_arb_dot_output(arb_t res, nn_ptr sum, slong sn, int negative,
Expand Down Expand Up @@ -84,7 +74,7 @@ _arb_dot_output(arb_t res, nn_ptr sum, slong sn, int negative,
xn = ARF_SIZE(xm); \
xnegative = ARF_SGNBIT(xm); \
shift = s_sum_exp - xexp; \
if (shift >= s_sn * FLINT_BITS) \
if (shift >= (ulong) s_sn * FLINT_BITS) \
{ \
} \
else \
Expand Down Expand Up @@ -173,7 +163,7 @@ _arf_complex_mul_gauss(arf_t e, arf_t f, const arf_t a, const arf_t b,
FLINT_DLL extern slong acb_dot_gauss_dot_cutoff;
#define GAUSS_CUTOFF acb_dot_gauss_dot_cutoff

void
static void
acb_approx_dot_simple(acb_t res, const acb_t initial, int subtract,
acb_srcptr x, slong xstep, acb_srcptr y, slong ystep, slong len, slong prec)
{
Expand Down Expand Up @@ -584,7 +574,7 @@ acb_approx_dot(acb_t res, const acb_t initial, int subtract, acb_srcptr x, slong
exp = xexp + yexp;
shift = sum_exp - exp;

if (shift >= sn * FLINT_BITS)
if (shift >= (ulong) sn * FLINT_BITS)
{
}
else if (xn <= 2 && yn <= 2 && sn <= 3)
Expand Down
2 changes: 1 addition & 1 deletion src/acb/atan.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "acb.h"

/* branch cuts are on (+/-i)*[1,inf] */
int
static int
acb_atan_on_branch_cut(const acb_t z)
{
arb_t unit;
Expand Down
Loading
Loading