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

Adding MPFR library at the framework level #276

Merged
merged 16 commits into from
Aug 25, 2022
Merged

Adding MPFR library at the framework level #276

merged 16 commits into from
Aug 25, 2022

Conversation

jgalan
Copy link
Member

@jgalan jgalan commented Jul 29, 2022

jgalan Large: 3120

This PR simply brings the MPFR library to the framework level and not only for axionlib.

MPFR library allows calculations with any required number precision.

I will soon use it with a new class TRestComplex to do calculations with exact precision, but for the moment this change is required by the recent rest-for-physics/axionlib#12 PR.

@jgalan jgalan requested review from nkx111, lobis, ruzarmen and a team July 29, 2022 17:21
@jgalan jgalan marked this pull request as ready for review July 29, 2022 17:21
@jgalan jgalan changed the title Event processing Adding MPFR library at the framework level Jul 29, 2022
@jgalan
Copy link
Member Author

jgalan commented Jul 29, 2022

Plz @lobis could you check it is the appropriate way to introduce this inside CMakeLists?

@lobis
Copy link
Member

lobis commented Jul 29, 2022

Plz @lobis could you check it is the appropriate way to introduce this inside CMakeLists?

I made some modifications.

Instead of throwing an error when not found I set it to warning, I don't think we want to give an error when this library is not found right?

The previous implementation relied on the MPFR_PATH variable to exist, otherwise the call to link_directories would not work even if the library was in your system. Now it should work in more cases but I have not tested it.

In my machine using the pipeline docker image I don't need to specify this MPFR_PATH variable for it to work.

Maybe the link_directories step can be skipped, not sure.

@jgalan
Copy link
Member Author

jgalan commented Aug 3, 2022

Great addons @lobis, lets then approve and merge the changes?

set(external_libs "${external_libs};-lmpfr")
link_directories(${MPFR_LIB})
else ()
message(WARNING "MPFR library was not found. Adding the location to the installation path may solve this problem.\n Use -DMPFR_PATH=/path/to/mpfr/")
Copy link
Member

Choose a reason for hiding this comment

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

We should add some flags if this library is not linked, then one can type rest-config --flags to see if he can compile a MPFR-dependent REST library(like axionlib) based on this installation of REST

@jgalan jgalan merged commit 78fe647 into master Aug 25, 2022
@jgalan jgalan deleted the event_processing branch August 25, 2022 11:35
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.

4 participants