From 0b6c7b6b61e03dad2b61c10898a6686d6ca56905 Mon Sep 17 00:00:00 2001 From: Max Voronkov Date: Mon, 2 Jun 2025 16:26:58 +1000 Subject: [PATCH 1/4] removing debug calls dependent on casacore::Memory which no longer has the required methods in casacore-3.7.1 (AXA-3392) --- msvis/MSVis/SubMS.cc | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/msvis/MSVis/SubMS.cc b/msvis/MSVis/SubMS.cc index 434e5ce..83746f2 100644 --- a/msvis/MSVis/SubMS.cc +++ b/msvis/MSVis/SubMS.cc @@ -51,8 +51,6 @@ #include #include #include -#include // Can be commented out along with -// // Memory:: calls. //#ifdef COPYTIMER #include @@ -6813,11 +6811,6 @@ Bool SubMS::fillAverMainTable(const Vector& colNames) { LogIO os(LogOrigin("SubMS", "fillAverMainTable()")); - os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630) - << "Before fillAntIndexer(): " - << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - // fill time and timecentroid and antennas if(fillAntIndexer(mscIn_p, antIndexer_p) < 1) return False; @@ -7817,10 +7810,6 @@ Bool SubMS::doChannelMods(const Vector& datacols) //ROTiledStManAccessor tacc(mssel_p, cdesc.dataManagerGroup()); //tacc.showCacheStatistics(cerr); // A 99.x% hit rate is good. 0% is bad. - os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630) - << "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - return True; } @@ -8029,11 +8018,6 @@ Bool SubMS::doTimeAver(const Vector& dataColNames) if(stateRemapper_p.size() < 1) make_map(mscIn_p->stateId(), stateRemapper_p); - os << LogIO::DEBUG1 // helpdesk ticket from Oleg Smirnov (ODU-232630) - << "Before msOut_p.addRow(): " - << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - Vector cmplxColLabels; const Bool doFloat = sepFloat(dataColNames, cmplxColLabels); const uInt nCmplx = cmplxColLabels.nelements(); @@ -8237,10 +8221,6 @@ Bool SubMS::doTimeAver(const Vector& dataColNames) //ROTiledStManAccessor tacc(mssel_p, cdesc.dataManagerGroup()); //tacc.showCacheStatistics(cerr); // A 99.x% hit rate is good. 0% is bad. - os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630) - << "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - if(rowsdone < 1){ os << LogIO::WARN << "No rows were written. Is all the selected input flagged?" @@ -8265,11 +8245,6 @@ Bool SubMS::doTimeAverVisIterator(const Vector& dataColNa if(stateRemapper_p.size() < 1) make_map(mscIn_p->stateId(), stateRemapper_p); - os << LogIO::DEBUG1 // helpdesk ticket from Oleg Smirnov (ODU-232630) - << "Before msOut_p.addRow(): " - << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - Vector cmplxColLabels; const Bool doFloat = sepFloat(dataColNames, cmplxColLabels); const uInt nCmplx = cmplxColLabels.nelements(); @@ -8463,10 +8438,6 @@ Bool SubMS::doTimeAverVisIterator(const Vector& dataColNa } // End of for(vi.originChunks(); vi.moreChunks(); vi.nextChunk()) os << LogIO::NORMAL << "Data binned." << LogIO::POST; - os << LogIO::DEBUG1 // helpdesk ticket in from Oleg Smirnov (ODU-232630) - << "Post binning memory: " << Memory::allocatedMemoryInBytes() / (1024.0 * 1024.0) << " MB" - << LogIO::POST; - if(rowsdone < 1){ os << LogIO::WARN << "No rows were written. Is all the selected input flagged?" From 93f021da5c2558bdb0a5efb7eaeabaf48ee487f3 Mon Sep 17 00:00:00 2001 From: Max Voronkov Date: Mon, 2 Jun 2025 17:52:32 +1000 Subject: [PATCH 2/4] removed dependence on std::unary_function to comply with C++17 (AXA-3392) --- msvis/MSVis/UtilJ.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/msvis/MSVis/UtilJ.h b/msvis/MSVis/UtilJ.h index 4b4fdf3..585abcc 100644 --- a/msvis/MSVis/UtilJ.h +++ b/msvis/MSVis/UtilJ.h @@ -92,7 +92,7 @@ template const F & first (const std::pair & pair) { return pair.first;} template -class FirstFunctor : public std::unary_function, F>{ +class FirstFunctor : public std::function)>{ public: F & operator() (std::pair & p) { return p.first; } const F & operator() (const std::pair & p) { return p.first; } @@ -196,7 +196,7 @@ template const F & second (const std::pair & pair) { return pair.second;} template -class SecondFunctor : public std::unary_function, F>{ +class SecondFunctor : public std::function)>{ public: S & operator() (std::pair & p) { return p.second; } }; @@ -428,7 +428,7 @@ class DeltaThreadTimes : private ThreadTimes { /* -Example of using composer and unary. The composed functors have to be derived from std::unary_function +Example of using composer and unary. int f(int x) { return x*x;} int g(int x) { return 2 * x;} @@ -457,7 +457,7 @@ Example of using composer and unary. The composed functors have to be derived f */ template -class ComposedFunctor : public std::unary_function { +class ComposedFunctor : public std::function { public: @@ -479,7 +479,7 @@ compose (F f, G g) } template -class UnaryFunctor : public std::unary_function { +class UnaryFunctor : public std::function { public: typedef R (* F) (D); From df8146aad8386166f5b9e0ef4f4ccb726753d280 Mon Sep 17 00:00:00 2001 From: Max Voronkov Date: Tue, 3 Jun 2025 12:14:58 +1000 Subject: [PATCH 3/4] bumped up cmake version to avoid issues with new cmake, removed usage of std::auto_ptr (AXA-3392) --- CMakeLists.txt | 7 ++++++- flagging/Flagging/Flagger.cc | 18 +++++++++--------- flagging/Flagging/RFFlagCube.cc | 6 ++++-- msvis/MSVis/test/tVisibilityIteratorAsync.cc | 7 +++---- synthesis/MeasurementEquations/SkyEquation.cc | 1 - 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac05ef3..3f9a70a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,15 @@ project(casarest) enable_language(CXX Fortran) -cmake_minimum_required(VERSION 3.3.0) +cmake_minimum_required(VERSION 3.14.0) include(CheckCXXCompilerFlag) #list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake) set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +# Require a C++17 compatible compiler +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + + # rpath setup for libraries SET(CMAKE_SKIP_BUILD_RPATH FALSE) diff --git a/flagging/Flagging/Flagger.cc b/flagging/Flagging/Flagger.cc index 15b707b..f980517 100644 --- a/flagging/Flagging/Flagger.cc +++ b/flagging/Flagging/Flagger.cc @@ -1654,9 +1654,9 @@ namespace casacore { sprintf(subtitle,"pass %d (data)",npass+1); - std::auto_ptr progmeter(NULL); + std::unique_ptr progmeter; if (chunk.num(TIME) > progmeter_limit) { - progmeter = std::auto_ptr(new ProgressMeter(1.0,static_cast(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq)); + progmeter.reset(new ProgressMeter(1.0,static_cast(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq)); } // start pass for all active agents @@ -1670,7 +1670,7 @@ namespace casacore { // iterate over visbuffers for( vi.origin(); vi.more() && nactive; vi++,itime++ ) { - if (progmeter.get() != NULL) { + if (progmeter) { progmeter->update(itime); } chunk.newTime(); @@ -1755,9 +1755,9 @@ namespace casacore { sprintf(subtitle,"pass %d (dry)",npass+1); //cout << "-----------subtitle=" << subtitle << endl; - std::auto_ptr progmeter(NULL); + std::unique_ptr progmeter; if (chunk.num(TIME) > progmeter_limit) { - progmeter = std::auto_ptr(new ProgressMeter (1.0,static_cast(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq)); + progmeter.reset(new ProgressMeter (1.0,static_cast(chunk.num(TIME)+0.001),title+subtitle,"","","",True,pm_update_freq)); } // start pass for all active agents for( uInt ival = 0; ivalstartDry(new_field_spw); for( uInt itime=0; itimeupdate(itime); } // now, call individual VisBuffer iterators @@ -1799,16 +1799,16 @@ namespace casacore { sprintf(subtitle,"pass (flag)"); //cout << "-----------subtitle=" << subtitle << endl; - std::auto_ptr progmeter(NULL); + std::unique_ptr progmeter; if (chunk.num(TIME) > progmeter_limit) { - progmeter = std::auto_ptr(new ProgressMeter(1.0,static_cast(chunk.num(TIME)+0.001),title+"storing flags","","","",True,pm_update_freq)); + progmeter.reset(new ProgressMeter(1.0,static_cast(chunk.num(TIME)+0.001),title+"storing flags","","","",True,pm_update_freq)); } for (uInt i = 0; istartFlag(new_field_spw); uInt itime=0; for( vi.origin(); vi.more(); vi++,itime++ ) { - if (progmeter.get() != NULL) { + if (progmeter) { progmeter->update(itime); } diff --git a/flagging/Flagging/RFFlagCube.cc b/flagging/Flagging/RFFlagCube.cc index 6a83311..df06087 100644 --- a/flagging/Flagging/RFFlagCube.cc +++ b/flagging/Flagging/RFFlagCube.cc @@ -1,3 +1,5 @@ +// MV: Is this file unused? I tried to remove usage of auto_ptr throughout the code but in the process noticed that this file is not compiled +// It is included in the CMakefile at least. Leave it as is for now. //# RFFlagCube.cc: this defines RFFlagCube //# Copyright (C) 2000,2001,2002 @@ -432,12 +434,12 @@ void RFFlagCube::getMSFlags(uInt it) in_flags_flushed = false; } - auto_ptr fl_row(NULL); + std::unique_ptr fl_row; FlagVector *flr = NULL; // FlagVector fl_row;//(flagrow.column(pos_get_flag)); if (!kiss) { - fl_row = auto_ptr(new FlagVector(flagrow.column(pos_get_flag))); + fl_row.reset(new FlagVector(flagrow.column(pos_get_flag))); flr = fl_row.get(); } diff --git a/msvis/MSVis/test/tVisibilityIteratorAsync.cc b/msvis/MSVis/test/tVisibilityIteratorAsync.cc index 4ca0b5e..371bd46 100644 --- a/msvis/MSVis/test/tVisibilityIteratorAsync.cc +++ b/msvis/MSVis/test/tVisibilityIteratorAsync.cc @@ -36,7 +36,6 @@ #include #include #include -using std::auto_ptr; #include @@ -72,7 +71,7 @@ main(int argc, char **argv) ROVisibilityIteratorAsync::prefetchColumns(VIA::Ant1, VIA::Ant2, VIA::Freq, VIA::Time, VIA::ObservedCube, VIA::Sigma, VIA::Flag, VIA::Uvw, -1); - auto_ptr syniter (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi)); + std::unique_ptr syniter (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi)); VisBufferAutoPtr vb (syniter.get()); // set iterator to start of data @@ -136,7 +135,7 @@ main(int argc, char **argv) cout << " Now try to iterate in time-intervals of 10s"< + std::unique_ptr syniter2 (ROVisibilityIteratorAsync::create (synms,prefetchColumns, bi,10.)); VisBufferAutoPtr vb2 (* syniter2); @@ -163,7 +162,7 @@ main(int argc, char **argv) ROVisibilityIteratorAsync::PrefetchColumns prefetchColumns = ROVisibilityIteratorAsync::prefetchColumns(VIA::Time, -1); - auto_ptr + std::unique_ptr syniter3 (ROVisibilityIteratorAsync::create(synms,prefetchColumns, bi,10.)); syniter3->setInterval(1000.); diff --git a/synthesis/MeasurementEquations/SkyEquation.cc b/synthesis/MeasurementEquations/SkyEquation.cc index 7f4b7b8..4667f25 100644 --- a/synthesis/MeasurementEquations/SkyEquation.cc +++ b/synthesis/MeasurementEquations/SkyEquation.cc @@ -79,7 +79,6 @@ #include #include -using std::auto_ptr; namespace casacore { //# NAMESPACE CASACORE - BEGIN From 24b775e50245dc53a51fd39beecfb7bef87a9c75 Mon Sep 17 00:00:00 2001 From: Max Voronkov Date: Tue, 3 Jun 2025 16:17:23 +1000 Subject: [PATCH 4/4] bumped up the package version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f9a70a..6baf8ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ endif(HDF5_ROOT_DIR) # project version set( ${PROJECT_NAME}_MAJOR_VERSION 1 ) set( ${PROJECT_NAME}_MINOR_VERSION 9 ) -set( ${PROJECT_NAME}_PATCH_LEVEL 0 ) +set( ${PROJECT_NAME}_PATCH_LEVEL 1 ) if (UseCasaNamespace) add_definitions (-DUseCasaNamespace)