Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 58 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,9 @@ jobs:
export FLINT_TEST_MULTIPLIER=2
$MAKE check

# FIXME: Enable when this won't fail
# - if: failure()
# name: "If failure, stop all other jobs"
# uses: andymckay/[email protected]
- if: failure()
name: "If failure, stop all other jobs"
uses: andymckay/[email protected]



Expand Down Expand Up @@ -410,6 +409,61 @@ jobs:



##############################################################################
# msvc
##############################################################################
msvc:
name: MSVC

runs-on: windows-latest

steps:
- uses: actions/checkout@v3

- name: "Setup Conda"
uses: conda-incubator/[email protected]
with:
miniconda-version: "latest"
channels: conda-forge

- name: "Install dependencies"
run: |
conda install --yes -c conda-forge mpfr
conda install --yes -c conda-forge pthreads-win32
conda info
conda list

- name: "Setup MSVC"
uses: ilammy/[email protected]
with:
arch: x86_64

- name: "Configure"
run: |
mkdir build
cd build
set "LIB=C:\Miniconda3\Library\lib;%LIB%"
set "CPATH=C:\Miniconda3\Library\include;%CPATH%"
cmake -G "Ninja" -DCMAKE_C_FLAGS="/wd4018 /wd4146 /wd4244 /wd4267 /wd4305 /wd4996" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release ..

- name: "Build"
run: |
cd build
cmake --build . -- -j4

- name: "Test"
run: |
cd build
set "FLINT_TEST_MULTIPLIER=1"
ctest -j4 --output-on-failure --timeout 180

# FIXME: Enable me when possible
# - if: failure()
# name: "If failure, stop all other jobs"
# uses: andymckay/[email protected]



##############################################################################
# nemo
##############################################################################
Expand Down
28 changes: 24 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#
# Copyright (C) 2023 Isuru Fernando
#
# 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 2.1 of the License, or
# (at your option) any later version. See <http://www.gnu.org/licenses/>.
#

cmake_minimum_required(VERSION 3.10)

include(CheckIPOSupported)
Expand Down Expand Up @@ -63,6 +74,7 @@ else()
set(FLINT_USES_PTHREAD ON CACHE BOOL "Use POSIX Threads.")
endif()


# Find sources

set(_BUILD_DIRS
Expand Down Expand Up @@ -270,8 +282,10 @@ if(FLINT_USES_BLAS)
target_include_directories(flint PUBLIC ${CBLAS_INCLUDE_DIRS})
endif()

if(BUILD_SHARED_LIBS AND WIN32)
# Export flint's functions
if(BUILD_SHARED_LIBS AND MSVC)
# Export all functions automatically (except global data)
set_target_properties(flint PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
# Export flint's global data that are marked manually
target_compile_definitions(flint PRIVATE "FLINT_BUILD_DLL")
# Use MPIR's dll import functions
target_compile_definitions(flint PUBLIC "MSC_USE_DLL")
Expand Down Expand Up @@ -310,14 +324,20 @@ if(NOT DEFINED IPO_SUPPORTED)
message(STATUS "Checking for IPO")
check_ipo_supported(RESULT ipo_supported LANGUAGES C)
if(ipo_supported)
message(STATUS "Checking for IPO - found")
if (MSVC)
message(STATUS "Checking for IPO - found, but disabled for MSVC")
set(ipo_supported FALSE)
else()
message(STATUS "Checking for IPO - found")
endif()
else()
message(STATUS "Checking for IPO - not found")
endif()
set(IPO_SUPPORTED ${ipo_supported} CACHE INTERNAL "Introprocedural Optimization" FORCE)
endif()

if(IPO_SUPPORTED)
# allow overriding IPO by setting -DCMAKE_INTERPROCEDURAL_OPTIMIZATION
if (IPO_SUPPORTED AND "${CMAKE_INTERPROCEDURAL_OPTIMIZATION}" STREQUAL "")
set_target_properties(flint PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

Expand Down
11 changes: 8 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ environment:
CONDA_INSTALL_LOCN_64: "C:\\Miniconda38-x64"
VCVARSALL: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat"
matrix:
- COMPILER: cl
ARCH: 32
- COMPILER: cl
ARCH: 64

Expand All @@ -47,7 +45,14 @@ before_build:
- cmake -G "Ninja" -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release ..

build_script:
- cmake --build . -- -j2
- cmake --build . -- -j2 -k 0

test_script:
- ctest -j3 --output-on-failure --timeout 600

# Enable this to be able to login to the build worker. You can use the
# `remmina` program in Ubuntu, use the login information that the line below
# prints into the log.
#
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
2 changes: 1 addition & 1 deletion src/acb/approx_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ _arf_complex_mul_gauss(arf_t e, arf_t f, const arf_t a, const arf_t b,
fmpz_clear(v);
}

extern slong acb_dot_gauss_dot_cutoff;
FLINT_DLL extern slong acb_dot_gauss_dot_cutoff;
#define GAUSS_CUTOFF acb_dot_gauss_dot_cutoff

void
Expand Down
2 changes: 1 addition & 1 deletion src/acb/dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ _arf_complex_mul_gauss(arf_t e, arf_t f, const arf_t a, const arf_t b,

/* TODO: this could be much lower, but it's currently competing
against mulhigh in the Karatsuba range. */
slong acb_dot_gauss_dot_cutoff = 128;
FLINT_DLL slong acb_dot_gauss_dot_cutoff = 128;
#define GAUSS_CUTOFF acb_dot_gauss_dot_cutoff

void
Expand Down
2 changes: 1 addition & 1 deletion src/acb/test/t-approx_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "acb.h"

extern slong acb_dot_gauss_dot_cutoff;
FLINT_DLL extern slong acb_dot_gauss_dot_cutoff;

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion src/acb/test/t-dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "acb.h"

extern slong acb_dot_gauss_dot_cutoff;
FLINT_DLL extern slong acb_dot_gauss_dot_cutoff;

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion src/acb_poly/exp_series.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#endif

/* allow changing this from the test code */
slong acb_poly_newton_exp_cutoff = 0;
FLINT_DLL slong acb_poly_newton_exp_cutoff = 0;

/* with inverse=1 simultaneously computes g = exp(-x) to length n
with inverse=0 uses g as scratch space, computing
Expand Down
2 changes: 1 addition & 1 deletion src/acb_poly/test/t-exp_series.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "acb_poly.h"

extern slong acb_poly_newton_exp_cutoff;
FLINT_DLL extern slong acb_poly_newton_exp_cutoff;

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion src/acf/approx_dot.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ _arf_complex_mul_gauss(arf_t e, arf_t f, const arf_t a, const arf_t b,
fmpz_clear(v);
}

extern slong acb_dot_gauss_dot_cutoff;
FLINT_DLL extern slong acb_dot_gauss_dot_cutoff;
#define GAUSS_CUTOFF acb_dot_gauss_dot_cutoff

void
Expand Down
38 changes: 19 additions & 19 deletions src/arb.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" {
__ARB_VERSION_MINOR * 100 + \
__ARB_VERSION_PATCHLEVEL)

extern const char * arb_version;
FLINT_DLL extern const char * arb_version;

#define arb_midref(x) (&(x)->mid)
#define arb_radref(x) (&(x)->rad)
Expand Down Expand Up @@ -857,10 +857,10 @@ _arb_vec_get_unique_fmpz_vec(fmpz * res, arb_srcptr vec, slong len)
#define ARB_ATAN_TAB2_PREC 4608
#define ARB_ATAN_TAB2_LIMBS (ARB_ATAN_TAB2_PREC / FLINT_BITS)

extern const mp_limb_t arb_atan_tab1[1 << ARB_ATAN_TAB1_BITS][ARB_ATAN_TAB1_LIMBS];
extern const mp_limb_t arb_atan_tab21[1 << ARB_ATAN_TAB21_BITS][ARB_ATAN_TAB2_LIMBS];
extern const mp_limb_t arb_atan_tab22[1 << ARB_ATAN_TAB22_BITS][ARB_ATAN_TAB2_LIMBS];
extern const mp_limb_t arb_atan_pi2_minus_one[ARB_ATAN_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_atan_tab1[1 << ARB_ATAN_TAB1_BITS][ARB_ATAN_TAB1_LIMBS];
FLINT_DLL extern const mp_limb_t arb_atan_tab21[1 << ARB_ATAN_TAB21_BITS][ARB_ATAN_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_atan_tab22[1 << ARB_ATAN_TAB22_BITS][ARB_ATAN_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_atan_pi2_minus_one[ARB_ATAN_TAB2_LIMBS];

void
_arb_atan_taylor_naive(mp_ptr y, mp_limb_t * error,
Expand All @@ -886,11 +886,11 @@ void arb_atan_arf_newton(arb_t res, const arf_t x, slong prec);
#define ARB_LOG_TAB2_PREC 4608
#define ARB_LOG_TAB2_LIMBS (ARB_LOG_TAB2_PREC / FLINT_BITS)

extern const mp_limb_t arb_log_tab11[1 << ARB_LOG_TAB11_BITS][ARB_LOG_TAB1_LIMBS];
extern const mp_limb_t arb_log_tab12[1 << ARB_LOG_TAB12_BITS][ARB_LOG_TAB1_LIMBS];
extern const mp_limb_t arb_log_tab21[1 << ARB_LOG_TAB21_BITS][ARB_LOG_TAB2_LIMBS];
extern const mp_limb_t arb_log_tab22[1 << ARB_LOG_TAB22_BITS][ARB_LOG_TAB2_LIMBS];
extern const mp_srcptr arb_log_log2_tab;
FLINT_DLL extern const mp_limb_t arb_log_tab11[1 << ARB_LOG_TAB11_BITS][ARB_LOG_TAB1_LIMBS];
FLINT_DLL extern const mp_limb_t arb_log_tab12[1 << ARB_LOG_TAB12_BITS][ARB_LOG_TAB1_LIMBS];
FLINT_DLL extern const mp_limb_t arb_log_tab21[1 << ARB_LOG_TAB21_BITS][ARB_LOG_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_log_tab22[1 << ARB_LOG_TAB22_BITS][ARB_LOG_TAB2_LIMBS];
FLINT_DLL extern const mp_srcptr arb_log_log2_tab;

void arb_log_newton(arb_t res, const arb_t x, slong prec);
void arb_log_arf_newton(arb_t res, const arf_t x, slong prec);
Expand All @@ -899,7 +899,7 @@ void arb_log_arf_newton(arb_t res, const arf_t x, slong prec);

#define ARB_LOG_PRIME_CACHE_NUM 13

extern const mp_limb_t arb_log_p_tab[ARB_LOG_PRIME_CACHE_NUM][ARB_LOG_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_log_p_tab[ARB_LOG_PRIME_CACHE_NUM][ARB_LOG_TAB2_LIMBS];
void arb_log_primes_vec_bsplit(arb_ptr res, slong n, slong prec);

void _arb_log_p_ensure_cached(slong prec);
Expand All @@ -921,9 +921,9 @@ arb_srcptr _arb_log_p_cache_vec(void);
#define ARB_EXP_TAB2_PREC 4608
#define ARB_EXP_TAB2_LIMBS (ARB_EXP_TAB2_PREC / FLINT_BITS)

extern const mp_limb_t arb_exp_tab1[ARB_EXP_TAB1_NUM][ARB_EXP_TAB1_LIMBS];
extern const mp_limb_t arb_exp_tab21[ARB_EXP_TAB21_NUM][ARB_EXP_TAB2_LIMBS];
extern const mp_limb_t arb_exp_tab22[ARB_EXP_TAB22_NUM][ARB_EXP_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_exp_tab1[ARB_EXP_TAB1_NUM][ARB_EXP_TAB1_LIMBS];
FLINT_DLL extern const mp_limb_t arb_exp_tab21[ARB_EXP_TAB21_NUM][ARB_EXP_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_exp_tab22[ARB_EXP_TAB22_NUM][ARB_EXP_TAB2_LIMBS];

void _arb_exp_taylor_naive(mp_ptr y, mp_limb_t * error,
mp_srcptr x, mp_size_t xn, ulong N);
Expand Down Expand Up @@ -969,12 +969,12 @@ void arb_exp_arf(arb_t z, const arf_t x, slong prec, int minus_one, slong maglim
#define ARB_SIN_COS_TAB2_PREC 4608
#define ARB_SIN_COS_TAB2_LIMBS (ARB_SIN_COS_TAB2_PREC / FLINT_BITS)

extern const mp_limb_t arb_sin_cos_tab1[2 * ARB_SIN_COS_TAB1_NUM][ARB_SIN_COS_TAB1_LIMBS];
extern const mp_limb_t arb_sin_cos_tab21[2 * ARB_SIN_COS_TAB21_NUM][ARB_SIN_COS_TAB2_LIMBS];
extern const mp_limb_t arb_sin_cos_tab22[2 * ARB_SIN_COS_TAB22_NUM][ARB_SIN_COS_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_sin_cos_tab1[2 * ARB_SIN_COS_TAB1_NUM][ARB_SIN_COS_TAB1_LIMBS];
FLINT_DLL extern const mp_limb_t arb_sin_cos_tab21[2 * ARB_SIN_COS_TAB21_NUM][ARB_SIN_COS_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_sin_cos_tab22[2 * ARB_SIN_COS_TAB22_NUM][ARB_SIN_COS_TAB2_LIMBS];

#define ARB_PI4_TAB_LIMBS (4608 / FLINT_BITS)
extern const mp_limb_t arb_pi4_tab[ARB_PI4_TAB_LIMBS];
FLINT_DLL extern const mp_limb_t arb_pi4_tab[ARB_PI4_TAB_LIMBS];

void _arb_sin_cos_taylor_naive(mp_ptr ysin, mp_ptr ycos, mp_limb_t * error,
mp_srcptr x, mp_size_t xn, ulong N);
Expand Down Expand Up @@ -1003,7 +1003,7 @@ void arb_atan_gauss_primes_vec_bsplit(arb_ptr res, slong n, slong prec);
#define ARB_SIN_COS_ATAN_REDUCTION_DEFAULT_MAX_PREC 4000000
#define ARB_SIN_COS_ATAN_REDUCTION_PREC 2600

extern const mp_limb_t arb_atan_gauss_tab[ARB_ATAN_GAUSS_PRIME_CACHE_NUM][ARB_ATAN_TAB2_LIMBS];
FLINT_DLL extern const mp_limb_t arb_atan_gauss_tab[ARB_ATAN_GAUSS_PRIME_CACHE_NUM][ARB_ATAN_TAB2_LIMBS];

void _arb_atan_gauss_p_ensure_cached(slong prec);
arb_srcptr _arb_atan_gauss_p_cache_vec(void);
Expand Down
2 changes: 1 addition & 1 deletion src/arb/const_euler.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ arb_const_euler_eval(arb_t res, slong prec)

ARB_DEF_CACHED_CONSTANT(arb_const_euler_brent_mcmillan, arb_const_euler_eval)

extern const mp_limb_t arb_hypgeom_gamma_tab_limbs[];
FLINT_DLL extern const mp_limb_t arb_hypgeom_gamma_tab_limbs[];

void
arb_const_euler(arb_t res, slong prec)
Expand Down
2 changes: 1 addition & 1 deletion src/arb/partitions_fmpz.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "partitions.h"

/* defined in flint*/
extern const unsigned int partitions_lookup[128];
FLINT_DLL extern const unsigned int partitions_lookup[128];

/* we get log2(p(n))/2 bits with the leading term */
static int
Expand Down
4 changes: 2 additions & 2 deletions src/arb/sin_cos_taylor_rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

#define FACTORIAL_TAB_SIZE 288

extern const mp_limb_t factorial_tab_numer[FACTORIAL_TAB_SIZE];
extern const mp_limb_t factorial_tab_denom[FACTORIAL_TAB_SIZE];
FLINT_DLL extern const mp_limb_t factorial_tab_numer[FACTORIAL_TAB_SIZE];
FLINT_DLL extern const mp_limb_t factorial_tab_denom[FACTORIAL_TAB_SIZE];

void _arb_sin_cos_taylor_rs(mp_ptr ysin, mp_ptr ycos,
mp_limb_t * error, mp_srcptr x, mp_size_t xn, ulong N,
Expand Down
2 changes: 1 addition & 1 deletion src/arb_hypgeom.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef struct
char negative;
} arb_hypgeom_gamma_coeff_t;

extern arb_hypgeom_gamma_coeff_t arb_hypgeom_gamma_coeffs[ARB_HYPGEOM_GAMMA_TAB_NUM];
FLINT_DLL extern arb_hypgeom_gamma_coeff_t arb_hypgeom_gamma_coeffs[ARB_HYPGEOM_GAMMA_TAB_NUM];
int _arb_hypgeom_gamma_coeff_shallow(arf_t c, mag_t err, slong i, slong prec);

void arb_hypgeom_gamma_stirling(arb_t res, const arb_t x, int reciprocal, slong prec);
Expand Down
2 changes: 0 additions & 2 deletions src/arb_hypgeom/test/t-gamma_taylor_tab.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include "arb_poly.h"
#include "arb_hypgeom.h"

extern arb_hypgeom_gamma_coeff_t arb_hypgeom_gamma_coeffs[ARB_HYPGEOM_GAMMA_TAB_NUM];

int main()
{
flint_rand_t state;
Expand Down
2 changes: 1 addition & 1 deletion src/arb_mat/mul_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int arb_mat_is_lagom(const arb_mat_t A)
}

/* allow changing this from the test code */
slong arb_mat_mul_block_min_block_size = 0;
FLINT_DLL slong arb_mat_mul_block_min_block_size = 0;

void
arb_mat_mid_addmul_block_fallback(arb_mat_t C,
Expand Down
2 changes: 1 addition & 1 deletion src/arb_mat/test/t-mul_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "fmpq_mat.h"
#include "arb_mat.h"

extern slong arb_mat_mul_block_min_block_size;
FLINT_DLL extern slong arb_mat_mul_block_min_block_size;

int main()
{
Expand Down
2 changes: 1 addition & 1 deletion src/arb_poly/exp_series.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#endif

/* allow changing this from the test code */
slong arb_poly_newton_exp_cutoff = 0;
FLINT_DLL slong arb_poly_newton_exp_cutoff = 0;

/* with inverse=1 simultaneously computes g = exp(-x) to length n
with inverse=0 uses g as scratch space, computing
Expand Down
2 changes: 1 addition & 1 deletion src/arb_poly/test/t-exp_series.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "fmpq_poly.h"
#include "arb_poly.h"

extern slong arb_poly_newton_exp_cutoff;
FLINT_DLL extern slong arb_poly_newton_exp_cutoff;

int main()
{
Expand Down
Loading