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

Instructions in README.md for MPFR on MacOS #2

Open
vinc17fr opened this issue May 7, 2018 · 4 comments
Open

Instructions in README.md for MPFR on MacOS #2

vinc17fr opened this issue May 7, 2018 · 4 comments

Comments

@vinc17fr
Copy link

vinc17fr commented May 7, 2018

In README.md it is written: "On macOS, homebrew installs libmpfr.6.dylib, even though the latest version is 4. Renaming the library to libmpfr.4.dylib fixes this issue."

The "6" in the dylib file is correct and comes from the latest supported MPFR ABI. It is not related to the MPFR major version number. For MPFR 3.0.x and MPFR 3.1.x, the latest supported ABI is 4, hence libmpfr.4.dylib with these versions. And since MPFR 4.0.0 is not ABI compatible with the previous MPFR versions, its latest supported ABI is 6, hence libmpfr.6.dylib with MPFR 4.0.x. Renaming this file to libmpfr.4.dylib may yield failures (incorrect results or crashes) in software compiled against MPFR 3.x. Here, I think that the ABI incompatibilities are rather minor, affecting only particular applications, but I'm not sure. In any case, the rename is a bad idea.

@malyzajko
Copy link
Owner

Thanks for the comments!
The issue is that we are using the Java MPFR interface and that expects the library to be called libmpfr.4.dylib.
Perhaps a better solution to this renaming would be to have homebrew install the right version. Do you know if this works (reliably)?

@vinc17fr
Copy link
Author

vinc17fr commented May 7, 2018

I suppose that the Java MPFR interface expects libmpfr.4.dylib because it had been compiled against MPFR 3.x. So, the solution would be to reinstall the Java MPFR interface, and actually everything that depends on MPFR. See https://github.com/Homebrew/homebrew-science/issues/869 for a similar issue.

@malyzajko
Copy link
Owner

Thanks for the explanation, I will check this to see whether I can find a good solution which works both on Linux and Mac.

@vinc17fr
Copy link
Author

vinc17fr commented May 8, 2018

Under Linux, the problem is solved by having co-installable libraries with binary distributions. For instance, in Debian/unstable, I have both libmpfr4 3.1.6-1 (which provides libmpfr.so.4) and libmpfr6 4.0.1-1 (which provides libmpfr.so.6) installed.

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

No branches or pull requests

2 participants