You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A student posted this on Piazza. Maintainers, please take a look :D
This might be done on purpose, but it did take me quite some time to figure out what is going on.
In the CmakeLists.txt that lives in ddg-exercises/projects/simplicial-complex-operators/CMakeLists.txt, line 41 (pasted below), the flag -DNDEBUG is passed. This disables the Eigen shape-checking for matrix multiplication. This allows wrongly shaped matrices to be multiplied silently. Once I took out this flag debugging became much easier :).
Usually one sets debugging modes via compilation flags, rather than hardcoding it directly. In these exercises, by default, just compiling using cmake (i.e., without explicitly setting the flag to Release or Debug) will compile in "release" mode. In "release" mode, the variable CMAKE_CXX_FLAGS_RELEASE is naturally set to encode the -DNDEBUG flag. If one compiles in "debug" mode, which can be done with command line arguments via cmake -DCMAKE_BUILD_TYPE=Debug (or cmake -DCMAKE_BUILD_TYPE=Debug .. if you are in the build subdirectory of a project), then the value of CMAKE_CXX_FLAGS_DEBUG is used. You can see that the value of CMAKE_CXX_FLAGS_DEBUG being set earlier in the CMakeLists.txt file, with the corresponding flags to enable debugging.
Does compiling with cmake -DCMAKE_BUILD_TYPE=Debug enable Eigen shape-checking?
By the way, thank you for sharing this. Now that I think about it, it makes more sense to make the default mode "debug" rather than "release" for these exercises. I'll probably change this :)
A student posted this on Piazza. Maintainers, please take a look :D
This might be done on purpose, but it did take me quite some time to figure out what is going on.
In the CmakeLists.txt that lives in ddg-exercises/projects/simplicial-complex-operators/CMakeLists.txt, line 41 (pasted below), the flag -DNDEBUG is passed. This disables the Eigen shape-checking for matrix multiplication. This allows wrongly shaped matrices to be multiplied silently. Once I took out this flag debugging became much easier :).
The text was updated successfully, but these errors were encountered: