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

Support ARB with Flint 3 #1988

Merged
merged 5 commits into from
Nov 15, 2023
Merged

Support ARB with Flint 3 #1988

merged 5 commits into from
Nov 15, 2023

Conversation

isuruf
Copy link
Member

@isuruf isuruf commented Nov 12, 2023

Arb is now a part of flint

Fixes #1987

@antonio-rojas
Copy link
Contributor

Doesn't work here with Flint 3.0.1

CMake Error at cmake/FindFLINT.cmake:15 (string):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  CMakeLists.txt:287 (find_package)

set(FLINT_TARGETS flint)

file(READ "${FLINT_INCLUDE_DIR}/flint/flint.h" FLINT_H)
string(REGEX MATCH "#define FLINT_VERSION \"([0-9.]*)\"" _ ${FLINT_H})
set(FLINT_VERSION ${CMAKE_MATCH_1})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonio-rojas, can you print the value of ${FLINT_VERSION} here?

@isuruf
Copy link
Member Author

isuruf commented Nov 15, 2023

Looking at the Arch Linux build I see the following

/* flint version number */

#define __FLINT_VERSION 3
#define __FLINT_VERSION_MINOR 0
#define __FLINT_VERSION_PATCHLEVEL 1
#define FLINT_VERSION ""
#define __FLINT_RELEASE_NUM(a,b,c) ((a)*10000 + (b)*100 + (c))
#define __FLINT_RELEASE __FLINT_RELEASE_NUM(__FLINT_VERSION, __FLINT_VERSION_MINOR, __FLINT_VERSION_PATCHLEVEL)

I'm not sure how FLINT_VERSION became empty.

@isuruf
Copy link
Member Author

isuruf commented Nov 15, 2023

@antonio-rojas, you need flintlib/flint@88bcb2e backported.

@antonio-rojas
Copy link
Contributor

Thanks. Still doesn't build with flint 3 as it doesn't account for API changes, see https://gitlab.archlinux.org/archlinux/packaging/packages/symengine/-/blob/main/flint-3.patch?ref_type=heads#L29-61

@isuruf
Copy link
Member Author

isuruf commented Nov 15, 2023

I think you also need 1ef9855

@antonio-rojas
Copy link
Contributor

Missed that, sorry. Tried with master now to make sure there's no other commit missing, but it looks like there's still a missing fmpq.h include in ntheory.cpp

/build/symengine/src/symengine/symengine/ntheory.cpp: In function ‘SymEngine::RCP<const SymEngine::Number> SymEngine::bernoulli(long unsigned int)’:
/build/symengine/src/symengine/symengine/ntheory.cpp:499:5: error: ‘fmpq_init’ was not declared in this scope; did you mean ‘fmpz_init’?
  499 |     fmpq_init(res);
      |     ^~~~~~~~~
      |     fmpz_init
In file included from /build/symengine/src/symengine/symengine/visitor.h:15,
                 from /build/symengine/src/symengine/symengine/test_visitors.h:4,
                 from /build/symengine/src/symengine/symengine/pow.cpp:5:
/build/symengine/src/symengine/symengine/series_generic.h: In constructor ‘SymEngine::UnivariateSeries::UnivariateSeries(const SymEngine::UExprDict&, std::string, unsigned int)’:
/build/symengine/src/symengine/symengine/series_generic.h:27:31: warning: redundant move in initialization [-Wredundant-move]
   27 |         : SeriesBase(std::move(sp), varname, degree)
      |                      ~~~~~~~~~^~~~
/build/symengine/src/symengine/symengine/series_generic.h:27:31: note: remove ‘std::move’ call
/build/symengine/src/symengine/symengine/ntheory.cpp:503:5: error: ‘fmpq_get_mpq’ was not declared in this scope; did you mean ‘fmpz_get_mpz’?
  503 |     fmpq_get_mpq(a, res);
      |     ^~~~~~~~~~~~
      |     fmpz_get_mpz
In file included from /build/symengine/src/symengine/symengine/series_generic.h:11:
/build/symengine/src/symengine/symengine/series.h: At global scope:
/build/symengine/src/symengine/symengine/series.h:128:23: warning: ‘SymEngine::RCP<const SymEngine::Number> SymEngine::SeriesBase<Poly, Coeff, Series>::pow(const SymEngine::Number&) const [with Poly = SymEngine::fmpq_poly_wrapper; Coeff = SymEngine::fmpq_wrapper; Series = SymEngine::URatPSeriesFlint]’ was hidden [-Woverloaded-virtual=]
  128 |     RCP<const Number> pow(const Number &other) const override
      |                       ^~~
In file included from /build/symengine/src/symengine/symengine/visitor.h:17:
/build/symengine/src/symengine/symengine/series_flint.h:41:18: note:   by ‘static SymEngine::fqp_t SymEngine::URatPSeriesFlint::pow(const SymEngine::fqp_t&, int, unsigned int)’
   41 |     static fqp_t pow(const fqp_t &s, int n, unsigned prec);
      |                  ^~~
/build/symengine/src/symengine/symengine/ntheory.cpp:505:5: error: ‘fmpq_clear’ was not declared in this scope; did you mean ‘fmpz_clear’?
  505 |     fmpq_clear(res);
      |     ^~~~~~~~~~
      |     fmpz_clear

@isuruf
Copy link
Member Author

isuruf commented Nov 15, 2023

No worries. Thanks for checking.

@antonio-rojas
Copy link
Contributor

All good now.

@isuruf isuruf merged commit d6718a0 into symengine:master Nov 15, 2023
34 checks passed
@isuruf isuruf deleted the arb branch November 15, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update include directories for flint
3 participants