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

include single precision support in fftw #61

Open
lschneiderbauer opened this issue Dec 28, 2024 · 5 comments
Open

include single precision support in fftw #61

lschneiderbauer opened this issue Dec 28, 2024 · 5 comments

Comments

@lschneiderbauer
Copy link

lschneiderbauer commented Dec 28, 2024

I would like to bring this package to CRAN, which depends on fftw including single precision support.

This works for CRAN Windows as well as Linux builds, but not for MacOS, since the default MacOS build does not include single precision support.

My suggestion is to modify the fftw recipe file to include a simple "Configure: --enable-float", enabling single precision by default. My understanding is that this would enable the automatic build of the above mentioned package for the MacOS platform when submitting to CRAN.

Would you be okay with a PR performing this simple change?

@s-u
Copy link
Member

s-u commented Jan 2, 2025

@lschneiderbauer Unfortunately that won't work - it would remove double precision support breaking everyone's code - you can only use one type in the fftw library. So one option would be to fix your package to use double precision as is the standard in R. The other would be to use a second, prefixed build of fftw (see fftw docs). If you can adjust your package to use the prefixed version of fftw (for you that would be fftw3f and the corresponding entry points) then I can add that to the recipes.

@lschneiderbauer
Copy link
Author

Thank you for your help.

Unfortunately, the first option, although would probably be best, is practically out of my hands, since I am relying on upstream code that I do not control.

Regarding the second option: I think those pieces are already in place: The package's configure script should automatically pick up the library that contains the relevant single-precision functions (e.g. on Ubuntu, there is also a separate libfftw3f.so which gets picked up).

I see you already pushed a new recipe to master, thanks for that! <3
Can I already test those changes with the MacOS build service (https://mac.r-project.org/macbuilder/submit.html) or does it take a while until the changes land there?

@s-u
Copy link
Member

s-u commented Jan 5, 2025

@lschneiderbauer yes, please, test it, all binaries are up on all the CRAN machines

FWIW you check see if binaries are updated at https://mac.r-project.org/bin
e.g. for arm64: https://mac.r-project.org/bin/darwin20/arm64/

@jeroen
Copy link
Contributor

jeroen commented Jan 5, 2025

I have also updated the r-universe bundle, so users can test with the new libs there as well: https://github.com/r-universe-org/cranlibs/releases/tag/2025-01-05

@lschneiderbauer
Copy link
Author

Great news,
the package compiles now on the MacOS builder: https://mac.r-project.org/macbuilder/results/1736159623-58e1880408414635/

(even though without OpenMP support, but that's another topic, optional, and not so important anyways)

Thanks!

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

3 participants