-
Notifications
You must be signed in to change notification settings - Fork 407
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
Simplify makefiles by guarding compilation with appropriate KOKKOS_ENABLE_### macros #716
Comments
@dsunder I've already got updates to suppress the linker errors in my cmake branch. It does it from the makefile side by conditional includes. Why is it better to not have the conditional files but compile almost empty ones? You then obviously have a few extra files in the compile that aren't even needed. I would argue excluding them based on conditionals in the Makefile is better. |
Better to define a noop function than global variable. |
Which strategy has better maintainability? make and cmake file logic or macro logic? |
I think that adding the protection to the files is valuable regardless of what the build system does. The build system is free to exclude the files and it doesn't cost us anything, but if the build includes extra files it will still work without warnings. |
This strategy has lower maintenance burden. |
This is all the way in master by now, we missed it. |
Remove conditional logic in Makefiles by protecting files with appropriate KOKKOS_ENABLE_### macros. Also prevent linker from warning about empty archive. Only Kokkos_Macros.hpp should be included before the #if defined test.
eg. (Kokkos_Foo.cpp)
#include <Kokkos_Macros.hpp>
#if defined( KOKKOS_ENABLE_FOO )
...
#else
int g_KOKKOS_FOO_PREVENT_EMPTY_LINK_ERROR ;
#endif //if defined(KOKKOS_ENABLE_FOO)
The text was updated successfully, but these errors were encountered: