DP3 can't be build in release mode
Created by: aroffringa
The normal way of compiling release versions is by specifying -DCMAKE_BUILD_TYPE:STRING=Release
on the cmake command line. This enables switches like -O3
, -march=native
and -DNDEBUG
. However, when -DNDEBUG
is added to the compiler switches, DP3 no longer works and crashes with the following error:
std exception detected: Empty or wrong MeasureHolder for asMPosition
this is thrown by this line of code: (complete backtrace is below)
return copyMeasure(casacore::MeasureHolder(itsArrayPos)).asMPosition();
@tammojan do you have any idea why that line would trigger an exception when NDEBUG is not set? Is this a Casacore bug (e.g. some conditional code based on NDEBUG), or is there a DP3 bug that "accidentally" gets triggered when NDEBUG is defined?
I have no idea what causes this, but the NDEBUG flag is a pretty important optimization flag. In particular the boost library adds lots of extra timetaking checks when NDEBUG is not set.
Starting program: /home/users/offringa/Software/DP3/build/DPPP/DPPP dppp-calibrate.parset [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Catchpoint 1 (exception thrown), 0x00007fffeef2ab00 in __cxa_throw () from /usr/lib64/libstdc++.so.6 (gdb) bt #0 0x00007fffeef2ab00 in __cxa_throw () at /usr/lib64/libstdc++.so.6 #1 0x00007ffff6496bb0 in casa::MeasureHolder::asMPosition() const () at /home/users/offringa/Software/install/lib/libcasa_measures.so.2 #2 0x0000000000534a95 in DP3::DPPP::Predict::initializeThreadData() (this=0xa16030) at /home/users/offringa/Software/DP3/DPPP/DPInfo.h:170 #3 0x0000000000534a95 in DP3::DPPP::Predict::initializeThreadData() (this=this@entry=0xa16010) at /home/users/offringa/Software/DP3/DPPP/Predict.cc:211 #4 0x0000000000535136 in DP3::DPPP::Predict::updateInfo(DP3::DPPP::DPInfo const&) (this=0xa16010, infoIn=...) at /home/users/offringa/Software/DP3/DPPP/Predict.cc:240 #5 0x000000000051b743 in DP3::DPPP::GainCal::updateInfo(DP3::DPPP::DPInfo const&) (this=0xcca5f0, infoIn=...) at /home/users/offringa/Software/DP3/DPPP/GainCal.cc:220 #6 0x0000000000465bf0 in DP3::DPPP::DPStep::setInfo(DP3::DPPP::DPInfo const&) (this=<optimized out>, info=...) at /home/users/offringa/Software/DP3/DPPP/DPStep.cc:37 #7 0x000000000045fe58 in DP3::DPPP::DPRun::execute(std::string const&, int, char**) (parsetName="dppp-calibrate.parset", argc=argc@entry=2, argv=argv@entry=0x7fffffffcdd8) at /home/users/offringa/Software/DP3/DPPP/DPRun.cc:152 #8 0x0000000000451a82 in main(int, char**) (argc=2, argv=0x7fffffffcdd8) at /home/users/offringa/Software/DP3/DPPP/DPPP.cc:86