Assertions should be enabled/disabled independently of DOLFIN
As it showed up in #34, preprocessor directive -D[N]DEBUG
may be inherited from DOLFIN independently of -DCMAKE_BUILD_TYPE
cmake command-line directive when building mshr. As a result assertions in mshr cannot be switched on or off.
This is best observed by investigating file <mshr>/build/CMakeFiles/mshr.dir/flags.make
. (As a workaround the file can be manually modified (before running make
) to achieve expected behaviour.)
Comments (5)
-
-
reporter I would argue that Dolfin, in the first place, shouldn't export these flags at all.
Possibly you're right. Any opinion here, @garth-wells, @johannes_ring?
-
I agree that DOLFIN shouldn't be exporting these flags.
-
reporter I'm not totally sure what would be the correct solution. The same
DOLFINConfig.cmake
is probably used when configuring DOLFIN extension modules (including compiledExpression
s), demo, bench and test programs. It is usually useful to build all of these with same debugging flags.Maybe
dolfin_assert
could be triggered by-D[N]DOLFINDEBUG
directive which could be exported while not exporting-D[N]DEBUG
which is general purpose. mshr could then define its ownmshr_assert
and-D[N]MSHRDEBUG
. -
We could add an extra field to
DOLFINConfig.cmake
to handle JIT options. The user should then be able to choose whether or not these are used. The test framework would grab the extra options from the CMake file. - Log in to comment
Isn't it very adhoc to "manually" filter out
-D[N]DEBUG
these values from DOLFIN_CXX_DEFINITIONS? I would argue that Dolfin, in the first place, shouldn't export these flags at all.