CMake: Adding support for building multiple precisions at once#276
CMake: Adding support for building multiple precisions at once#276emmenlau wants to merge 3 commits intoFFTW:masterfrom
Conversation
75b64eb to
a2a0a78
Compare
|
The PR does not fully work out of the box, because it will not select the sources dynamically for the precision. I can provide an improved version if this is relevant at all? |
|
|
||
| if (ENABLE_NEON) | ||
| if (ENABLE_LONG_DOUBLE) | ||
| message (FATAL_ERROR "NEON only works in single or double precision, please disable long double support") |
There was a problem hiding this comment.
This seems contradictory to this PR. Shouldn't it be fine that NEON is only built for single and double, and we just give a warning that it doesn't work for the others?
| set (BENCHFFT_LDOUBLE TRUE) | ||
| set (PREC_SUFFIX l) | ||
| endif () | ||
| set (FFTW_VERSION 3.3.10) |
There was a problem hiding this comment.
This is rather archaic. We should move this into project(FFTW VERSION 3.3.10)
There was a problem hiding this comment.
Also in the project, only C language should be enabled
| set (PREC_SUFFIX q) | ||
| endif () | ||
| set (fftw3_lib fftw3${PREC_SUFFIX}) | ||
| set (PRECISIONS SINGLE DOUBLE LDOUBLE QUAD) |
There was a problem hiding this comment.
How about passing this as a list via set(CACHE), then if any flags are added, simply add to the list.
| configure_file (cmake.config.h.in "${PRECISION}/config.h" @ONLY) | ||
| target_include_directories (${fftw3_lib} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${PRECISION}") | ||
|
|
||
| target_include_directories (${fftw3_lib} INTERFACE $<INSTALL_INTERFACE:include>) |
There was a problem hiding this comment.
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
There was a problem hiding this comment.
Oops, I understood this tutorial the other way around.
This is still recommended. Just don't use ${CMAKE_INSTALL_FULL_INCLUDEDIR}
| target_include_directories (${fftw3_lib} INTERFACE $<INSTALL_INTERFACE:include>) | ||
|
|
||
| if (BUILD_SHARED_LIBS) | ||
| target_compile_definitions (${fftw3_lib} PRIVATE -DFFTW_DLL) |
| else () | ||
| add_library (${fftw3_lib}_threads ${fftw_threads_SOURCE}) | ||
| target_include_directories (${fftw3_lib}_threads PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${PRECISION}") | ||
| target_include_directories (${fftw3_lib}_threads INTERFACE $<INSTALL_INTERFACE:include>) |
There was a problem hiding this comment.
Seems these can be generalized in an interface target as well. Can combine with depends to link to appropriate config.h as well.
| endif () | ||
|
|
||
| foreach(subtarget ${subtargets}) | ||
| set_target_properties (${subtarget} PROPERTIES SOVERSION 3.6.9 VERSION 3) |
There was a problem hiding this comment.
Why are SOVERSIONs not in sync with PROJECT_VERSION?
| foreach(subtarget ${subtargets}) | ||
| set_target_properties (${subtarget} PROPERTIES SOVERSION 3.6.9 VERSION 3) | ||
| install (TARGETS ${subtarget} | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} |
|
|
||
| enable_testing () | ||
|
|
||
| if (Threads_FOUND) |
There was a problem hiding this comment.
Either move this together with condition BUILD_TESTS, or enable the testing altogether. Also bench is not a good name for this purpose. Preferably move these to tests subfolder
| ${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX} | ||
| COMPONENT Development) | ||
| ${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}.pc |
|
Hi @LecrisUT , thanks for your interest to push the cmake support forward, it's appreciated. However I should note that currently the commit CMakeLists.txt: Support multi-precision builds |
|
The only part that I can see is the lack of Lines 63 to 78 in 9426cd5 |
Hey @LecrisUT , I've re-considered this PR and I'm not sure whether there is a problem with my changes or not. It may help if you could try the fftw built with these instructions here and see if it is any faster or slower than the "common" fftw. Is that something you can test? |
|
Honestly I have completely lost interest in contributing to modernizing this project after the comments in #307. I have no hope that any improvements we make will be considered. Cmake fully supports OCaml and the project can be made to be fully compiled with cmake, but until that is being considered I don't think I'll participate. |
|
________________________________
Von: Cristian Le ***@***.***>
Gesendet: Sonntag, 25. Juni 2023 23:03
An: FFTW/fftw3 ***@***.***>
Cc: Subscribed ***@***.***>
Betreff: Re: [FFTW/fftw3] CMake: Adding support for building multiple precisions at once (PR #276)
Honestly I have completely lost interest in contributing to modernizing this project after the comments in #307<#307>. I have no hope that any improvements we make will be considered. Cmake fully supports OCaml and the project can be made to be fully compiled with cmake, but until that is being considered I don't think I'll participate.
—
Reply to this email directly, view it on GitHub<#276 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGRKXG5PKUEJZGATTK3P2WTXNCRRZANCNFSM5QKYXOPA>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
@JiahanBro, did you meant to forward that message internally or make a comment? |
This PR allows to build multiple (or all) precisions in a single go in cmake. Please let me know what you think?