Open mxmlnkn opened 8 years ago
I noticed strange behavior of CMake in combination with definitions and the correct/incorrect setting of "
's as well. But it is somehow indeterministic, especially between even minor version changes. So in my opinion this will be a very difficult but to track down.
For reference. Also I'm struggling with warning messages from alpaka and halt and possibly other libraries in the future flooding output, see here.
try checking out dev (de14cd9c0c1cb23c3ea9575b8e4ee3d7fc49a93d), add following code to
src/imresh/libs/cudacommon.hpp
:Now compile with:
The output is:
So for some reason only
IMRESH_DEBUG
andUSE_FFTW
are defined, but notUSE_PNG
. Note the difference:Changing this to
will make it work.
Note also this minimal-non-working example:
Use the following
main.cpp
Here is an excerpt from the output:
So especially there is no compile error, because
IMRESH_DEBUG
won't be defined, butIMRESH_DEBUG2
is. This means CMake has a bug where it misinterprets definitions containing spaces. Note that the space after-D
is completely fine!Comparing the above to this minimal-working
CMakeLists.txt
the output will be:
Meaning the bug seems to be inside
FindCUDA
.I'm only kinda surprised that the missing
-D USE_PNG
didn't lead to any notable errors Oo. Maybe I'm overlooking something again.