Skip to content

Commit

Permalink
fix bernmm compilation
Browse files Browse the repository at this point in the history
/opt/conda/envs/sage-dev/x86_64-conda-linux-gnu/include/c++/12.3.0/bits/stl_tree.h:772:15: error: static assertion failed: comparison object must be invocable as const
  772 |               is_invocable_v<const _Compare&, const _Key&, const _Key&>,
  /opt/conda/envs/sage-dev/x86_64-conda-linux-gnu/include/c++/12.3.0/bits/stl_tree.h:772:15: note: 'std::is_invocable_v<const bernmm::Item_cmp&, bernmm::Item* const&, bernmm::Item* const&>' evaluates to false
  • Loading branch information
tobiasdiez authored Dec 7, 2023
1 parent 4698e07 commit 1adecdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sage/rings/bernmm/bern_rat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ struct Item
*/
struct Item_cmp
{
bool operator()(const Item* x, const Item* y)
bool operator()(const Item* x, const Item* y) const
{
return mpz_cmp(x->modulus, y->modulus) < 0;
}
Expand Down Expand Up @@ -331,9 +331,9 @@ void bern_rat(mpq_t res, long k, int num_threads)
#ifdef USE_THREADS
for (long i = 0; i < num_threads - 1; i++)
pthread_join(threads[i], NULL);
#endif

pthread_attr_destroy (&attr);
#endif

// reconstruct B_k as a rational number
Item* item = *(state.items.begin());
Expand Down
3 changes: 2 additions & 1 deletion src/sage/rings/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ foreach name, pyx : extension_data
endforeach

extension_data_cpp = {
'bernmm': files('bernmm.pyx', 'bernmm/bern_modp.cpp', 'bernmm/bern_modp_util.cpp'),#, 'bernmm/bern_rat.cpp'), - TODO: Compilation error
'bernmm': files('bernmm.pyx', 'bernmm/bern_modp.cpp', 'bernmm/bern_modp_util.cpp', 'bernmm/bern_rat.cpp'),
'bernoulli_mod_p': files('bernoulli_mod_p.pyx'),
'fraction_field_FpT': files('fraction_field_FpT.pyx'),
'rational': files('rational.pyx'),
Expand All @@ -147,6 +147,7 @@ foreach name, pyx : extension_data_cpp
sources: pyx,
subdir: 'sage/rings',
install: true,
cpp_args: ['-DUSE_THREADS=1','-DTHREAD_STACK_SIZE=4096'],
override_options : ['cython_language=cpp'],
include_directories: [inc_arb, inc_cpython, inc_ext, inc_flint, inc_gsl, inc_ntl, inc_rings, inc_rings_finite],
dependencies: [py_dep, cypari2, cysignals, flint, gmp, gmpy2, gsl, m, mpc, mpfi, mpfr, ntl, pari, pthread],
Expand Down

0 comments on commit 1adecdb

Please sign in to comment.