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

Compilation fails (conflicting types) if mpfr-devel 4.2.0 is provided #458

Closed
fpesari opened this issue Apr 1, 2023 · 3 comments · Fixed by #471
Closed

Compilation fails (conflicting types) if mpfr-devel 4.2.0 is provided #458

fpesari opened this issue Apr 1, 2023 · 3 comments · Fixed by #471

Comments

@fpesari
Copy link

fpesari commented Apr 1, 2023

Hello,

I tried compiling sleef 3.5.1 with mpfr 4.2.0 support on openSUSE but it failed with a bunch of conflicting type errors:

[   97s] /home/abuild/rpmbuild/BUILD/sleef-3.5.1/src/libm-tester/testerutil.h:93:6: error: conflicting types for 'mpfr_sinpi'; have 'void(__mpfr_struct *, __mpfr_struct *, mpfr_rnd_t)'
[   97s]    93 | void mpfr_sinpi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd);
[   97s]       |      ^~~~~~~~~~
[   97s] In file included from /home/abuild/rpmbuild/BUILD/sleef-3.5.1/src/libm-tester/tester2simddp.c:9:
[   97s] /usr/include/mpfr.h:752:21: note: previous declaration of 'mpfr_sinpi' with type 'int(__mpfr_struct *, const __mpfr_struct *, mpfr_rnd_t)'
[   97s]   752 | __MPFR_DECLSPEC int mpfr_sinpi (mpfr_ptr, mpfr_srcptr, mpfr_rnd_t);
[   97s]       |                     ^~~~~~~~~~
[   97s] /home/abuild/rpmbuild/BUILD/sleef-3.5.1/src/libm-tester/testerutil.h:94:6: error: conflicting types for 'mpfr_cospi'; have 'void(__mpfr_struct *, __mpfr_struct *, mpfr_rnd_t)'
[   97s]    94 | void mpfr_cospi(mpfr_t ret, mpfr_t arg, mpfr_rnd_t rnd);
[   97s]       |      ^~~~~~~~~~
[   97s] /usr/include/mpfr.h:753:21: note: previous declaration of 'mpfr_cospi' with type 'int(__mpfr_struct *, const __mpfr_struct *, mpfr_rnd_t)'
[   97s]   753 | __MPFR_DECLSPEC int mpfr_cospi (mpfr_ptr, mpfr_srcptr, mpfr_rnd_t);

If mpfr is not provided, however, sleef will be compiled successfully. Can I safely package sleef without mpfr support? Thank you.

@adamjstewart
Copy link

Using -DBUILD_TESTS=OFF allowed me to avoid CMake finding my system-installed MPFR 4.2.0 and compiling successfully.

musicinmybrain added a commit to musicinmybrain/sleef that referenced this issue Nov 10, 2023
These two functions were added to the MPFR API.

Fixes shibatch#458.
musicinmybrain added a commit to musicinmybrain/sleef that referenced this issue Nov 21, 2023
These two functions were added to the MPFR API.

Fixes shibatch#458.
@blapie blapie closed this as completed Nov 21, 2023
blapie pushed a commit that referenced this issue Nov 21, 2023
…471)

These two functions were added to the MPFR API.
Fixes #458.
@blapie
Copy link
Collaborator

blapie commented Feb 9, 2024

@adamjstewart Is this still an issue? Detection of mpfr often requires tweaking depending on the OS, we will try to improve it in the future.
@fpesari sorry we did not answer the question, sleef can be packaged without MPFR, as it is only required for testing as suggested by @adamjstewart.

@adamjstewart
Copy link

It looks like it was fixed by #471. Will backport this if I need to build older versions for PyTorch.

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 a pull request may close this issue.

3 participants