-
Notifications
You must be signed in to change notification settings - Fork 667
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
CMake: Adding support for building multiple precisions at once #276
base: master
Are you sure you want to change the base?
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the comments are regarding the cmake project in general. Maybe these can be spun up in a different PR. Also what do you mean selecting the sources dynamically for the precision? Also, mark this as Depends on #275?
@@ -192,9 +194,20 @@ if (ENABLE_AVX2) | |||
endforeach () | |||
endif () | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rather archaic. We should move this into project(FFTW VERSION 3.3.10)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this specific to windows?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be exported as well
|
||
enable_testing () | ||
|
||
if (Threads_FOUND) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be in the loop
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?