From 9f92a91cf75908e8c1bf333c03b9fb0e76a595e0 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 7 Feb 2025 12:03:46 +0000 Subject: [PATCH 1/4] remove STIR_USE_BOOST_SHARED_PTR remove obsolete (and not working) code Fixes #1350 --- src/CMakeLists.txt | 7 ------- src/include/stir/shared_ptr.h | 21 ++------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6eca7a8152..4859ddc393 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,13 +188,6 @@ check_cxx_source_compiles(" HAVE_STD_SHARED_PTR ) -if(HAVE_STD_SHARED_PTR) - option(STIR_USE_BOOST_SHARED_PTR "Use boost::shared_ptr as opposed to std::shared_ptr (not recommended)" OFF) - mark_as_advanced(STIR_USE_BOOST_SHARED_PTR) -else() - set(STIR_USE_BOOST_SHARED_PTR ON) -endif() - # Byte order if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) # Use CMake to find byte order of target system. diff --git a/src/include/stir/shared_ptr.h b/src/include/stir/shared_ptr.h index a24edfe3cd..b1c6c8cb45 100644 --- a/src/include/stir/shared_ptr.h +++ b/src/include/stir/shared_ptr.h @@ -5,9 +5,7 @@ \ingroup buildblock \brief Import of std::shared_ptr, std::dynamic_pointer_cast and - std::static_pointer_cast (or corresponding boost versions if - STIR_USE_BOOST_SHARED_PTR is set, i.e. normally when std::shared_ptr doesn't exist) - into the stir namespace. + std::static_pointer_cast into the stir namespace. */ /* Copyright (C) 2011-07-01 - 2012, Kris Thielemans @@ -22,20 +20,6 @@ #define __stir_SHARED_PTR__ #include "stir/common.h" -#if defined(STIR_USE_BOOST_SHARED_PTR) -# include "boost/shared_ptr.hpp" -# include "boost/make_shared.hpp" -# include "boost/pointer_cast.hpp" -namespace stir -{ -using boost::shared_ptr; -using boost::dynamic_pointer_cast; -using boost::static_pointer_cast; -//! work-around for using std::make_shared on old compilers -# define MAKE_SHARED boost::make_shared -} // namespace stir -#else - # include namespace stir @@ -43,9 +27,8 @@ namespace stir using std::shared_ptr; using std::dynamic_pointer_cast; using std::static_pointer_cast; -//! work-around for using std::make_shared on old compilers +//! work-around for using std::make_shared on old compilers (deprecated) # define MAKE_SHARED std::make_shared } // namespace stir -#endif #endif From 75f52f137e1d8ce1cdd876ef52d50c5c02747fef Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 7 Feb 2025 12:05:15 +0000 Subject: [PATCH 2/4] fix some include guards - add guard in num_threads.h - fix misspelling for WierImageFilter2D Fixes #1534 --- src/include/stir/WienerImageFilter2D.h | 2 +- src/include/stir/num_threads.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/include/stir/WienerImageFilter2D.h b/src/include/stir/WienerImageFilter2D.h index 36463362a3..403ffe9dbb 100644 --- a/src/include/stir/WienerImageFilter2D.h +++ b/src/include/stir/WienerImageFilter2D.h @@ -20,7 +20,7 @@ */ #ifndef __stir_WienerImageFilter2D_H__ -# define __stir_WienerImageFilter2_H__ +# define __stir_WienerImageFilter2D_H__ # include "stir/DataProcessor.h" # include "stir/WienerArrayFilter2D.h" diff --git a/src/include/stir/num_threads.h b/src/include/stir/num_threads.h index 7e65104f72..5e30a68e79 100644 --- a/src/include/stir/num_threads.h +++ b/src/include/stir/num_threads.h @@ -16,6 +16,9 @@ \author Kris Thielemans */ +#ifndef __stir_num_threads_h__ +#define __stir_num_threads_h__ + #include "stir/common.h" START_NAMESPACE_STIR @@ -65,3 +68,5 @@ int get_default_num_threads(); void set_default_num_threads(); END_NAMESPACE_STIR + +#endif From 5eee71163cf7a3a3efd8b96d0d67c806fe694d35 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 7 Feb 2025 12:17:59 +0000 Subject: [PATCH 3/4] [CMake] Switch OpenMP On by default Fixes #1554 --- documentation/release_6.3.htm | 1 + src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/release_6.3.htm b/documentation/release_6.3.htm index ee330680cf..84a6c074ad 100644 --- a/documentation/release_6.3.htm +++ b/documentation/release_6.3.htm @@ -83,6 +83,7 @@

Build system

  • Enable more diagnostics in CMake when finding CERN's ROOT (we used to silence them)
    PR #1552
  • +
  • Use OpenMP by default
  • Known problems

    diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4859ddc393..7d914bdd67 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,7 @@ option(STIR_MPI "Compile with MPI" OFF) option(STIR_OPENMP - "Compile with OpenMP" OFF) + "Compile with OpenMP" ON) option(BUILD_TESTING "Build test programs" ON) From e58d78f572aef90d5b494bf73268df1171549967 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Fri, 7 Feb 2025 12:20:49 +0000 Subject: [PATCH 4/4] white space fixes [ci skip] --- src/include/stir/WienerImageFilter2D.h | 10 +++++----- src/include/stir/shared_ptr.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/include/stir/WienerImageFilter2D.h b/src/include/stir/WienerImageFilter2D.h index 403ffe9dbb..89d369dae2 100644 --- a/src/include/stir/WienerImageFilter2D.h +++ b/src/include/stir/WienerImageFilter2D.h @@ -20,12 +20,12 @@ */ #ifndef __stir_WienerImageFilter2D_H__ -# define __stir_WienerImageFilter2D_H__ +#define __stir_WienerImageFilter2D_H__ -# include "stir/DataProcessor.h" -# include "stir/WienerArrayFilter2D.h" -# include "stir/DiscretisedDensity.h" -# include "stir/RegisteredParsingObject.h" +#include "stir/DataProcessor.h" +#include "stir/WienerArrayFilter2D.h" +#include "stir/DiscretisedDensity.h" +#include "stir/RegisteredParsingObject.h" START_NAMESPACE_STIR diff --git a/src/include/stir/shared_ptr.h b/src/include/stir/shared_ptr.h index b1c6c8cb45..c4ee12bd3f 100644 --- a/src/include/stir/shared_ptr.h +++ b/src/include/stir/shared_ptr.h @@ -20,7 +20,7 @@ #define __stir_SHARED_PTR__ #include "stir/common.h" -# include +#include namespace stir { @@ -28,7 +28,7 @@ using std::shared_ptr; using std::dynamic_pointer_cast; using std::static_pointer_cast; //! work-around for using std::make_shared on old compilers (deprecated) -# define MAKE_SHARED std::make_shared +#define MAKE_SHARED std::make_shared } // namespace stir #endif