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
Brent Griffith edited this page Oct 18, 2016
·
5 revisions
Catching a NaN
The Microsoft Visual Studio C++ compiler has a way to stop on a NAN (usually shown as a -1.#IND) no matter where or when it is generated. I would expect other compilers do also. To cause it to stop on NAN the /fp:strict should be used as shown at:
I could not get it to work by just putting it into the Visual Studio GUI and instead put it on the
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
variables in CMake.
In addition, I had add the fp_control_state to main.cc:
int
main( int argc, const char * argv[] )
{
unsigned int fp_control_state = _controlfp( _EM_INEXACT, _MCW_EM );
ProcessArgs( argc, argv );
EnergyPlusPgm();
}
This was removed prior to checking in the branch.
Debugging Arrays
The library used as as part of converting EnergyPlus from Fortran to C++ is called Objexx and uses arrays that are difficult to understand during debugging in Microsoft Visual Studio. To overcome this issue copy the file from the repository at:
third_party/ObjexxFCL/visualizer/Array.natvis
Into the local directory on your computer:
My documents\Visual Studio 2013\Visualizers
My documents\Visual Studio 2015\Visualizers
This should show the values of these Objexx array the next time you debug EnergyPlus in Microsoft Visual Studio.