diff --git a/GaudiAlg/GaudiAlg/TupleObj.h b/GaudiAlg/GaudiAlg/TupleObj.h
index 2ddd1e32fd9c8466db70a512aa6ffd8984aaf390..6783a86233993810ce4568168276649d9282aea1 100644
--- a/GaudiAlg/GaudiAlg/TupleObj.h
+++ b/GaudiAlg/GaudiAlg/TupleObj.h
@@ -1951,8 +1951,8 @@ namespace Tuples
     {
       using Info = std::pair<KEY,VALUE>;
       static const std::array< std::function<float(const Info&)>, 2>
-                    fns = { [](const Info& i) { return i.first;  } ,
-                            [](const Info& i) { return i.second; } };
+         fns = { { [](const Info& i) { return i.first;  } ,
+                   [](const Info& i) { return i.second; } } };
       return fmatrix( name,
                       std::begin(fns), std::end(fns),
                       std::begin(info), std::end(info),
diff --git a/GaudiAlg/src/lib/GaudiSequencer.cpp b/GaudiAlg/src/lib/GaudiSequencer.cpp
index 31182a1d39c19e643ac4d72c57a7223edce584ae..9df75c4cee9250e67b72225fc133a5f21c75da03 100644
--- a/GaudiAlg/src/lib/GaudiSequencer.cpp
+++ b/GaudiAlg/src/lib/GaudiSequencer.cpp
@@ -18,7 +18,7 @@ namespace
   }
 
   bool isDefault(const std::string& s) { return s.empty(); }
-  constexpr bool isDefault(double x) { return x == 0; }
+   //  constexpr bool isDefault(double x) { return x == 0; }
 
    // utility class to populate some properties in the job options service
    // for a given instance name in case those options are not explicitly
diff --git a/GaudiAud/src/ProcStats.cpp b/GaudiAud/src/ProcStats.cpp
index 38274828094ebec68b6bc416230f8faf6c348db6..e59bd03005852050b40edba72262c0b49f8b3c29 100644
--- a/GaudiAud/src/ProcStats.cpp
+++ b/GaudiAud/src/ProcStats.cpp
@@ -9,12 +9,14 @@
 
 #include "ProcStats.h"
 
-#ifdef __linux
+#if defined(__linux__) or defined(__APPLE__)
 #include <iostream>
 #include <sstream>
 #include <sys/signal.h>
 #include <sys/syscall.h>
-#include <sys/procfs.h>
+#ifdef __linux__
+#  include <sys/procfs.h>
+#endif // __linux__
 #include <cstdio>
 
 using std::cerr;
@@ -225,7 +227,7 @@ struct linux_proc {
   unsigned long sigcatch;
   unsigned long wchan;
 };
-#endif // __linux
+#endif // __linux__ or __APPLE__
 
 ProcStats::cleanup::~cleanup() {
   if(ProcStats::inst!=0)  {
@@ -244,7 +246,7 @@ ProcStats* ProcStats::inst = 0;
 
 ProcStats::ProcStats():valid(false)
 {
-#ifdef __linux
+#if defined(__linux__) or defined(__APPLE__)
   pg_size = sysconf(_SC_PAGESIZE); // getpagesize();
 
   fname = "/proc/" + std::to_string(getpid()) + "/stat"; 
@@ -255,7 +257,7 @@ ProcStats::ProcStats():valid(false)
     cerr << "Failed to open " << fname << endl;
     return;
   }
-#endif
+#endif // __linux__ or __APPLE__
   valid=true;
 }
 
@@ -264,7 +266,7 @@ bool ProcStats::fetch(procInfo& f)
 {
   if( valid == false ) return false;
 
-#ifdef __linux
+#if defined(__linux__) or defined(__APPLE__)
   double pr_size, pr_rssize;
   linux_proc pinfo;
   int cnt;
@@ -332,7 +334,7 @@ bool ProcStats::fetch(procInfo& f)
 #else
   f.vsize = 0;
   f.rss   = 0;
-#endif
+#endif // __linux__ or __APPLE__
 
   bool rc = (curr==f)?false:true;
 
@@ -341,4 +343,3 @@ bool ProcStats::fetch(procInfo& f)
 
   return rc;
 }
-
diff --git a/GaudiAud/src/ProcStats.h b/GaudiAud/src/ProcStats.h
index 591e96250c6404cd1285ef75f9446ee269d78205..d7c6bd8af2257bac6753585749137736c45f67c3 100644
--- a/GaudiAud/src/ProcStats.h
+++ b/GaudiAud/src/ProcStats.h
@@ -7,11 +7,12 @@
 
 #include <string>
 #include <vector>
-#ifdef __linux
+#if defined(__linux__) or defined(__APPLE__)
 #include <unistd.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <fcntl.h>
-#endif
+#endif // __linux__ or __APPLE__
 
 struct procInfo
 {
diff --git a/GaudiCommonSvc/CMakeLists.txt b/GaudiCommonSvc/CMakeLists.txt
index 48b32a5d39906d648c8437f30aecc4755b9718c5..ace6c5c497f761f9a915725509d2f1198ef55f1f 100644
--- a/GaudiCommonSvc/CMakeLists.txt
+++ b/GaudiCommonSvc/CMakeLists.txt
@@ -12,5 +12,5 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS})
 #---Libraries---------------------------------------------------------------
 gaudi_add_module(GaudiCommonSvc
                  src/*.cpp DataSvc/*.cpp HistogramSvc/*.cpp PersistencySvc/*.cpp
-                 LINK_LIBRARIES GaudiKernel GaudiHive Boost ROOT
+                 LINK_LIBRARIES GaudiKernel Boost ROOT
                  INCLUDE_DIRS Boost ROOT AIDA)
diff --git a/GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp b/GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp
index b5cde4c31d502c795dcfaeee2bd7e2429c77ae15..b7426c237a2dadbbdd30476419153458be656345 100644
--- a/GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp
+++ b/GaudiCommonSvc/src/DataSvc/StoreExplorerAlg.cpp
@@ -19,6 +19,8 @@
 #include "GaudiKernel/MsgStream.h"
 #include "GaudiKernel/SmartIF.h"
 
+#include <numeric>
+
 /**@class StoreExplorerAlg
   *
   * Small algorith, which traverses the data store and
diff --git a/GaudiCommonSvc/src/HistogramSvc/H2D.cpp b/GaudiCommonSvc/src/HistogramSvc/H2D.cpp
index 1b572bb27a3b17116a1999feb2f25712938f3508..6d23bc6553af28b515cf1ccd60a61af47bc4a251 100644
--- a/GaudiCommonSvc/src/HistogramSvc/H2D.cpp
+++ b/GaudiCommonSvc/src/HistogramSvc/H2D.cpp
@@ -9,6 +9,7 @@
 // coming from TString.h
 #pragma warning(disable:4996)
 #endif
+#include <array>
 #include "H2D.h"
 #include "H1D.h"
 #include "P1D.h"
diff --git a/GaudiCoreSvc/CMakeLists.txt b/GaudiCoreSvc/CMakeLists.txt
index 35e31545ab834230b809adb3c3e8a463f54a545c..245da2c6a345f12be08fc09bc9043fc110ee6293 100644
--- a/GaudiCoreSvc/CMakeLists.txt
+++ b/GaudiCoreSvc/CMakeLists.txt
@@ -10,6 +10,12 @@ find_package(ROOT)
 # Hide some Boost/ROOT/TBB compile time warnings
 include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS})
 
+# Only link against the rt library on linux:
+set( extralibs )
+if( UNIX AND NOT APPLE )
+   set( extralibs rt )
+endif()
+
 #---Libraries---------------------------------------------------------------
 gaudi_add_module(GaudiCoreSvc
                  src/ApplicationMgr/*.cpp
@@ -18,5 +24,5 @@ gaudi_add_module(GaudiCoreSvc
                  src/JobOptionsSvc/*.cpp
                  src/MessageSvc/*.cpp
                  src/AlgExecStateSvc/*.cpp
-                 LINK_LIBRARIES GaudiKernel Boost TBB rt PythonLibs
+                 LINK_LIBRARIES GaudiKernel Boost TBB PythonLibs ${extralibs}
                  INCLUDE_DIRS TBB PythonLibs)
diff --git a/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.cpp b/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.cpp
index 8088893b8ebf2fa93675445931bc7c45af575c1f..fd1fbb6c5d25dca843f231331d2627079f4a5f53 100644
--- a/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.cpp
+++ b/GaudiCoreSvc/src/IncidentSvc/IncidentProcAlg.cpp
@@ -73,7 +73,7 @@ StatusCode IncidentProcAlg::execute() {
 	// check wheter one of the listeners is singleShot
       }
     }
-    incPack=std::move(m_incSvc->getIncidents(getContext()));
+    incPack=m_incSvc->getIncidents(getContext());
   }
 
   return StatusCode::SUCCESS;
diff --git a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp
index c6c5d435bd7052cf7ae475625b3d3a0948c626f7..f5c924c68365171df33cbd63c1b894d2b54479b4 100644
--- a/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp
+++ b/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.cpp
@@ -303,7 +303,7 @@ IIncidentSvc::IncidentPack IncidentSvc::getIncidents(const EventContext* ctx){
       }
     }
   }
-  return std::move(p);
+  return p;
 }
 // ============================================================================
 // The END
diff --git a/GaudiExamples/src/FileMgr/FileMgrTest.cpp b/GaudiExamples/src/FileMgr/FileMgrTest.cpp
index e9e310525bfc9dc825925af8dd2abad070e80a0a..c9d2662e740153b9fc7e7d05140919950a397977 100644
--- a/GaudiExamples/src/FileMgr/FileMgrTest.cpp
+++ b/GaudiExamples/src/FileMgr/FileMgrTest.cpp
@@ -7,7 +7,9 @@
 
 #include <fstream>
 #include <stdio.h>
+#ifndef __APPLE__
 #include <ext/stdio_filebuf.h>  // __gnu_cxx::stdio_filebuf
+#endif // not __APPLE__
 
 // Static Factory declaration
 
@@ -211,6 +213,7 @@ StatusCode FileMgrTest::initialize() {
 
 StatusCode FileMgrTest::execute() {
 
+#ifndef __APPLE__
   info() << "writing to " << p_fileMgr->fname((void*)fp_2) << endmsg;
 
   std::ofstream ofs;
@@ -227,7 +230,7 @@ StatusCode FileMgrTest::execute() {
 
   ofs2.std::ios::rdbuf(&fb2);
   ofs2 << "Hello World!" << std::endl;
-
+#endif // not __APPLE__
 
 
   return StatusCode::SUCCESS;
diff --git a/GaudiGSL/GaudiMath/FunAdapters.h b/GaudiGSL/GaudiMath/FunAdapters.h
index 34972c423b697cfd841e9ecbee4c866151c1e15f..6a37f1500f0e5bb75cdd1081a06d9548fbee0a29 100644
--- a/GaudiGSL/GaudiMath/FunAdapters.h
+++ b/GaudiGSL/GaudiMath/FunAdapters.h
@@ -70,6 +70,8 @@ namespace Genfun
       size_t                      m_dim ;
       mutable std::vector<double> m_arg ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( AdapterIFunction )
 
     // ========================================================================
     /** @class Adapter2DoubleFunction Adapters.h GaudiMath/Adapters.h
@@ -132,6 +134,8 @@ namespace Genfun
     private:
       Function                 m_func  ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( Adapter2DoubleFunction )
 
     // ========================================================================
     /** @class Adapter3DoubleFunction Adapters.h GaudiMath/Adapters.h
@@ -198,6 +202,8 @@ namespace Genfun
     private:
       Function                 m_func  ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( Adapter3DoubleFunction )
 
     // ========================================================================
     /** @class SimpleFunction Adapters.h GaudiMath/Adapters.h
@@ -278,6 +284,8 @@ namespace Genfun
       Function3                    m_func3    ;
       mutable std::vector<double>  m_arg3     ;
     };
+    /// From CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( SimpleFunction )
 
   } // end of namespace GaudiMathImeplementation
 } // end of namespace Genfun
diff --git a/GaudiGSL/GaudiMath/GSLFunAdapters.h b/GaudiGSL/GaudiMath/GSLFunAdapters.h
index 4c31571f56623b5ef17be7487e755e8ea350a3ad..c770c7eec6b28b27496d746d7fafce2285be3d80 100644
--- a/GaudiGSL/GaudiMath/GSLFunAdapters.h
+++ b/GaudiGSL/GaudiMath/GSLFunAdapters.h
@@ -74,6 +74,8 @@ namespace Genfun
       Function        m_function ;
       std::unique_ptr<gsl_sf_result>  m_result   ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( GSLFunctionWithError )
 
     class GAUDI_API GSLFunctionWithMode : public AbsFunction
     {
@@ -110,6 +112,8 @@ namespace Genfun
       Function        m_function ;
       gsl_mode_t*     m_mode     ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( GSLFunctionWithMode )
 
     class GAUDI_API GSLFunctionWithModeAndError : public AbsFunction
     {
@@ -154,6 +158,8 @@ namespace Genfun
       std::unique_ptr<gsl_mode_t>     m_mode     ;
       std::unique_ptr<gsl_sf_result>  m_result   ;
     };
+    /// mandatory macro from CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( GSLFunctionWithModeAndError )
 
   } // end of namespace GaudiMath Implemnentation
 } // end of namespace Genfun
diff --git a/GaudiGSL/GaudiMath/NumericalDefiniteIntegral.h b/GaudiGSL/GaudiMath/NumericalDefiniteIntegral.h
index 1e7f4338d6c48628c224f40e8079bd6de07ac83d..fc43fd37c21b30dafe2a1f597eb4dde4d2385b0a 100644
--- a/GaudiGSL/GaudiMath/NumericalDefiniteIntegral.h
+++ b/GaudiGSL/GaudiMath/NumericalDefiniteIntegral.h
@@ -422,6 +422,8 @@ namespace Genfun
       mutable  Argument                   m_argF     ;
 
     };
+    /// From CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( NumericalDefiniteIntegral )
 
   } // end of namespace GaudiMathImplementation
 } // end of namespace Genfun
diff --git a/GaudiGSL/GaudiMath/NumericalDerivative.h b/GaudiGSL/GaudiMath/NumericalDerivative.h
index ff798d7246cb928b4d1a508a65e493614f0bd68b..a4f3dd219ef1a8f0458666e11e05d35c7987efba 100644
--- a/GaudiGSL/GaudiMath/NumericalDerivative.h
+++ b/GaudiGSL/GaudiMath/NumericalDerivative.h
@@ -154,6 +154,8 @@ namespace Genfun
       mutable double     m_result    ;
       mutable double     m_error     ;
     };
+    /// From CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( NumericalDerivative )
 
   } // end of namespace GaudiMathImplementation
 } // end of namespace GenFun
diff --git a/GaudiGSL/GaudiMath/NumericalIndefiniteIntegral.h b/GaudiGSL/GaudiMath/NumericalIndefiniteIntegral.h
index bb7bc788c203a4848c577d9ac57f220996177afc..77f256fed8a116d489b0df6bfbba9cfdec82ca73 100644
--- a/GaudiGSL/GaudiMath/NumericalIndefiniteIntegral.h
+++ b/GaudiGSL/GaudiMath/NumericalIndefiniteIntegral.h
@@ -397,6 +397,8 @@ namespace Genfun
       mutable  Argument                   m_argument ;
 
     };
+    /// From CLHEP/GenericFunctions
+    FUNCTION_OBJECT_IMP( NumericalIndefiniteIntegral )
 
   } // end of namespace GaudiMathImplementation
 } // end of namespace Genfun
diff --git a/GaudiGSL/src/Lib/Adapter.cpp b/GaudiGSL/src/Lib/Adapter.cpp
index fb88e14e1ed52418bc1b30cdf1e94a7b88401aaa..6f4a68415fd44dad9676e303153decaa2e6a4a4f 100644
--- a/GaudiGSL/src/Lib/Adapter.cpp
+++ b/GaudiGSL/src/Lib/Adapter.cpp
@@ -15,8 +15,6 @@ namespace Genfun
   namespace GaudiMathImplementation
   {
 
-    FUNCTION_OBJECT_IMP( AdapterIFunction )
-
     AdapterIFunction::AdapterIFunction ( const AIDA::IFunction& fun)
       : AbsFunction ( )
       , m_fun ( &fun  )
@@ -57,8 +55,6 @@ namespace Genfun
       return Genfun::FunctionNoop ( &aux ) ;
     }
 
-    FUNCTION_OBJECT_IMP( Adapter2DoubleFunction )
-
     Adapter2DoubleFunction::Adapter2DoubleFunction
     ( Adapter2DoubleFunction::Function  func )
       : AbsFunction (       )
@@ -98,8 +94,6 @@ namespace Genfun
       return Genfun::FunctionNoop ( &aux ) ;
     }
 
-    FUNCTION_OBJECT_IMP( Adapter3DoubleFunction )
-
     Adapter3DoubleFunction::Adapter3DoubleFunction
     ( Adapter3DoubleFunction::Function  func )
       : AbsFunction (       )
@@ -140,10 +134,6 @@ namespace Genfun
       return Genfun::FunctionNoop ( &aux ) ;
     }
 
-    // ========================================================================
-    /// from CLHGEP/GenericFunctions
-    // ========================================================================
-    FUNCTION_OBJECT_IMP( SimpleFunction )
     // ========================================================================
 
     // =======================================================================
diff --git a/GaudiGSL/src/Lib/GSLFunAdapters.cpp b/GaudiGSL/src/Lib/GSLFunAdapters.cpp
index cc5c57cfa867b2bc95a45a6a0653545d5462a3c4..e083c1cf7a5aceb5d0551d008807ba17524e39f5 100644
--- a/GaudiGSL/src/Lib/GSLFunAdapters.cpp
+++ b/GaudiGSL/src/Lib/GSLFunAdapters.cpp
@@ -23,9 +23,7 @@ namespace Genfun
 {
   namespace GaudiMathImplementation
   {
-    
-    FUNCTION_OBJECT_IMP( GSLFunctionWithError )
-    
+
     GSLFunctionWithError::GSLFunctionWithError 
     ( GSLFunctionWithError::Function function ) 
       : AbsFunction()
@@ -35,7 +33,7 @@ namespace Genfun
       m_result -> val = -1.e+10 ;
       m_result -> err = -1.e+10 ;
     }
-    
+
     GSLFunctionWithError::GSLFunctionWithError 
     ( const GSLFunctionWithError& func  )
       : AbsFunction()
@@ -45,22 +43,21 @@ namespace Genfun
       m_result -> val = func.m_result -> val ;
       m_result -> err = func.m_result -> err ;
     }
-    
-    
+
     double GSLFunctionWithError::operator() 
       (       double    x ) const 
     {
       (*m_function)( x , m_result.get() ) ;
       return m_result -> val ;
     }
-    
+
     double GSLFunctionWithError::operator() 
       ( const Genfun::Argument& x ) const
     {
       (*m_function)( x[0] , m_result.get() ) ;
       return m_result -> val ;
     }
-    
+
     Genfun::Derivative GSLFunctionWithError::partial 
     ( unsigned int i ) const 
     {
@@ -72,19 +69,17 @@ namespace Genfun
       const AbsFunction& aux = GaudiMath::Derivative( *this , i) ;
       return Genfun::FunctionNoop( &aux ) ;      
     }
-    
+
     GSLFunctionWithError::Function GSLFunctionWithError::function() const 
     { return  m_function      ; }    
-    
+
     const gsl_sf_result& GSLFunctionWithError::result () const 
     { return *m_result        ; }    
-    
+
     double               GSLFunctionWithError::error  () const 
     { return  m_result -> err ; }
 
 
-    FUNCTION_OBJECT_IMP( GSLFunctionWithMode )
-    
     GSLFunctionWithMode::GSLFunctionWithMode 
     ( GSLFunctionWithMode::Function  function , 
       const gsl_mode_t&              mod      ) 
@@ -94,7 +89,7 @@ namespace Genfun
     {
       *m_mode = mod ;
     }
-    
+
     GSLFunctionWithMode::GSLFunctionWithMode 
     ( const GSLFunctionWithMode& func  )
       : AbsFunction()
@@ -103,15 +98,15 @@ namespace Genfun
     {
       *m_mode = *(func.m_mode) ;
     }
-    
+
     double GSLFunctionWithMode::operator() 
       (       double    x ) const 
     { return (*m_function)( x , *m_mode ) ; }
-    
+
     double GSLFunctionWithMode::operator() 
       ( const Genfun::Argument& x ) const
     { return (*m_function)( x[0] , *m_mode ) ; }
-    
+
     Genfun::Derivative GSLFunctionWithMode::partial 
     ( unsigned int i ) const 
     {
@@ -123,16 +118,14 @@ namespace Genfun
       const AbsFunction& aux = GaudiMath::Derivative( *this , i) ;
       return Genfun::FunctionNoop( &aux ) ;      
     }
-    
+
     GSLFunctionWithMode::Function GSLFunctionWithMode::function() const 
     { return  m_function      ; }    
-    
+
     const gsl_mode_t&             GSLFunctionWithMode::mode    () const 
     { return *m_mode          ; }
 
 
-    FUNCTION_OBJECT_IMP( GSLFunctionWithModeAndError )
-    
     GSLFunctionWithModeAndError::GSLFunctionWithModeAndError 
     ( GSLFunctionWithModeAndError::Function  function , 
       const gsl_mode_t&              mod      ) 
@@ -145,7 +138,7 @@ namespace Genfun
       m_result -> val = -1.e+10 ;
       m_result -> err = -1.e+10 ;
     }
-    
+
     GSLFunctionWithModeAndError::GSLFunctionWithModeAndError 
     ( const GSLFunctionWithModeAndError& func  )
       : AbsFunction()
@@ -157,22 +150,21 @@ namespace Genfun
       m_result -> val =   func.m_result -> val ;
       m_result -> err =   func.m_result -> err ;
     }
-    
-    
+
     double GSLFunctionWithModeAndError::operator() 
       (       double    x ) const 
     { 
       (*m_function)( x , *m_mode , m_result.get() ) ; 
       return m_result -> val ;
     }
-    
+
     double GSLFunctionWithModeAndError::operator() 
       ( const Genfun::Argument& x ) const
     { 
       (*m_function)( x[0] , *m_mode , m_result.get() ) ; 
       return m_result -> val ;
     }
-    
+
     Genfun::Derivative GSLFunctionWithModeAndError::partial 
     ( unsigned int i ) const 
     {
@@ -184,11 +176,11 @@ namespace Genfun
       const AbsFunction& aux = GaudiMath::Derivative( *this , i) ;
       return Genfun::FunctionNoop( &aux ) ;      
     }
-    
+
     GSLFunctionWithModeAndError::Function 
     GSLFunctionWithModeAndError::function() const 
     { return  m_function      ; }    
-    
+
     const gsl_mode_t&             
     GSLFunctionWithModeAndError::mode    () const 
     { return *m_mode          ; }
@@ -196,7 +188,7 @@ namespace Genfun
     const gsl_sf_result& 
     GSLFunctionWithModeAndError::result  () const 
     { return *m_result        ; }    
-    
+
     double               
     GSLFunctionWithModeAndError::error   () const 
     { return  m_result -> err ; }
diff --git a/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp b/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
index d2d19e6ee4d64824f00e71be592c718ce85fba65..4d0c86ccfd71e531fcc0617b207cb836f8642612 100644
--- a/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
+++ b/GaudiGSL/src/Lib/NumericalDefiniteIntegral.cpp
@@ -46,10 +46,6 @@ namespace Genfun
     struct NumericalDefiniteIntegral::_Function
     { gsl_function*              fn ; };
 
-    // ========================================================================
-    /// from CLHEP/GenericFunctions
-    // ========================================================================
-    FUNCTION_OBJECT_IMP( NumericalDefiniteIntegral )
     // ========================================================================
 
     /** Standard constructor
diff --git a/GaudiGSL/src/Lib/NumericalDerivative.cpp b/GaudiGSL/src/Lib/NumericalDerivative.cpp
index fef1e5a842012e030b90f68416dfcf5b9a7d7673..15cddd2edef580199508878c604fd7db047c058b 100644
--- a/GaudiGSL/src/Lib/NumericalDerivative.cpp
+++ b/GaudiGSL/src/Lib/NumericalDerivative.cpp
@@ -35,10 +35,6 @@ namespace Genfun
   namespace GaudiMathImplementation
   {
     // ========================================================================
-    /// from CLHEP/GenericFunctions
-    // ========================================================================
-    FUNCTION_OBJECT_IMP( NumericalDerivative )
-    // ========================================================================
     
     // ========================================================================
     /** The standard constructor from 
diff --git a/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp b/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
index 65ab2ec6de5f5a36b30bbce25e452229f26b6507..0bb1ff26286d248ca82d1216a752e8705215a41f 100644
--- a/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
+++ b/GaudiGSL/src/Lib/NumericalIndefiniteIntegral.cpp
@@ -52,10 +52,6 @@ namespace Genfun
     struct NumericalIndefiniteIntegral::_Function
     { gsl_function*              fn ; };
 
-    // ========================================================================
-    /// from CLHEP/GenericFunctions
-    // ========================================================================
-    FUNCTION_OBJECT_IMP( NumericalIndefiniteIntegral )
     // ========================================================================
 
     // ========================================================================
diff --git a/GaudiHive/src/ExecutionFlowGraph.h b/GaudiHive/src/ExecutionFlowGraph.h
index c9f8743ae591085f4e5726dae3c9aa73f175e553..ca0ee6cde867f567f93d6da6547796d50cf40aaa 100644
--- a/GaudiHive/src/ExecutionFlowGraph.h
+++ b/GaudiHive/src/ExecutionFlowGraph.h
@@ -279,7 +279,7 @@ class ExecutionFlowGraph : public CommonMessaging<IExecutionFlowGraph> {
 public:
     /// Constructor
     ExecutionFlowGraph(const std::string& name, SmartIF<ISvcLocator> svc) :
-     m_headNode(0), m_nodeCounter(0), m_svcLocator(svc), m_name(name), m_initTime(std::chrono::high_resolution_clock::now()),
+     m_headNode(0), m_nodeCounter(0), m_svcLocator(svc), m_name(name), m_initTime(std::chrono::system_clock::now()),
      m_eventSlots(nullptr) {}
     /// Destructor
     ~ExecutionFlowGraph() override {
diff --git a/GaudiHive/src/HiveWhiteBoard.cpp b/GaudiHive/src/HiveWhiteBoard.cpp
index ed52d39c96d3de7b824a000c196cd63d1de70b7b..92b0d2c6de025be26ec7788bd1a3efdda85c1385 100644
--- a/GaudiHive/src/HiveWhiteBoard.cpp
+++ b/GaudiHive/src/HiveWhiteBoard.cpp
@@ -16,6 +16,8 @@
 #include "GaudiKernel/DataSvc.h"
 #include "tbb/spin_mutex.h"
 #include "tbb/recursive_mutex.h"
+#include "Rtypes.h"
+#include "ThreadLocalStorage.h"
 
 
 //Interfaces
@@ -70,7 +72,7 @@ namespace {
   };
 }
 
-thread_local Partition* s_current(0);
+TTHREAD_TLS( Partition* ) s_current( 0 );
 
 /**
  * @class HiveWhiteBoard
diff --git a/GaudiKernel/GaudiKernel/IFileMgr.h b/GaudiKernel/GaudiKernel/IFileMgr.h
index 7cf7c3453812e4807fc7c67bebb5c82342f0a4fb..83fc36bc1c909d282a9c0be6f20e3af7d4be1a08 100644
--- a/GaudiKernel/GaudiKernel/IFileMgr.h
+++ b/GaudiKernel/GaudiKernel/IFileMgr.h
@@ -157,9 +157,9 @@ namespace Io {
   };
 
   inline std::ostream & operator << (std::ostream & s, const IoTech &t) {
-    static const std::array<const char*, SQLITE+1> tbl = {
+    static const std::array<const char*, SQLITE+1> tbl = { {
                  "UNKNOWN", "POSIX", "ROOT",
-                 "BS", "HDF5", "SQLITE" };
+                 "BS", "HDF5", "SQLITE" } };
     return t < tbl.size() ? s << tbl[t] : s;
   }
 
@@ -298,10 +298,10 @@ namespace Io {
   };
 
   inline std::ostream & operator << (std::ostream & s, const Action &t) {
-    static const std::array<const char*, INVALID_ACTION+1> tbl = {
+    static const std::array<const char*, INVALID_ACTION+1> tbl = { {
             "OPEN", "CLOSE", "REOPEN",
             "OPEN_ERR","CLOSE_ERR", "REOPEN_ERR",
-            "INVALID_ACTION" };
+            "INVALID_ACTION" } };
     return t < tbl.size() ? s<< tbl[t] : s;
   }
 
diff --git a/GaudiKernel/GaudiKernel/ITimelineSvc.h b/GaudiKernel/GaudiKernel/ITimelineSvc.h
index f170951b62ae1e0d507b54a3742b82c581f8a9e6..f62a168cbbf64276e6a1bf8d1923c89734a1e95f 100644
--- a/GaudiKernel/GaudiKernel/ITimelineSvc.h
+++ b/GaudiKernel/GaudiKernel/ITimelineSvc.h
@@ -3,6 +3,7 @@
 
 #include "GaudiKernel/IService.h"
 
+#include <pthread.h>
 #include <string>
 
 #include <chrono>
@@ -10,7 +11,7 @@ typedef std::chrono::high_resolution_clock Clock;
 typedef Clock::time_point time_point;
 
 struct TimelineEvent{
-	uint thread;
+	pthread_t thread;
 	uint slot;
 	uint event;
 
diff --git a/GaudiKernel/GaudiKernel/MsgStream.h b/GaudiKernel/GaudiKernel/MsgStream.h
index d21198bc2eb6c374be4928e76fcad9b1181acd89..af955e4c461565a5a80f9cd892538f2113658d8e 100644
--- a/GaudiKernel/GaudiKernel/MsgStream.h
+++ b/GaudiKernel/GaudiKernel/MsgStream.h
@@ -275,6 +275,7 @@ MsgStream& operator << (MsgStream& s, const std::_Smanip<_Tm>& manip) {
   return s;
 }
 #elif defined (__GNUC__)
+#ifndef __APPLE__
 inline MsgStream& operator << (MsgStream& s,
                                const std::_Setiosflags &manip) {
   try {
@@ -315,20 +316,7 @@ inline MsgStream& operator << (MsgStream& s,
   } catch (...) {}
   return s;
 }
-
-namespace MSG {
-  inline
-  MsgStream& dec(MsgStream& log) {
-    log.setf(std::ios_base::dec, std::ios_base::basefield);
-    return log;
-  }
-  inline
-  MsgStream& hex(MsgStream& log) {
-    log.setf(std::ios_base::hex, std::ios_base::basefield);
-    return log;
-  }
-}
-
+#endif // not __APPLE__
 #else // GCC, version << 3
 /// I/O Manipulator for setfill
 template<class _Tm> inline
@@ -341,6 +329,19 @@ MsgStream& operator << (MsgStream& s, const std::smanip<_Tm>& manip)  {
 }
 #endif    // WIN32 or (__GNUC__)
 
+namespace MSG {
+  inline
+  MsgStream& dec(MsgStream& log) {
+    log << std::dec;
+    return log;
+  }
+  inline
+  MsgStream& hex(MsgStream& log) {
+    log << std::hex;
+    return log;
+  }
+}
+
 /// Specialization to avoid the generation of implementations for char[].
 /// \see {<a href="https://savannah.cern.ch/bugs/?87340">bug #87340</a>}
 inline MsgStream& operator<< (MsgStream& s, const char *arg){
@@ -364,7 +365,7 @@ MsgStream& operator<< (MsgStream& lhs, const T& arg)  {
   return lhs;
 }
 
-#ifdef __GNUC__
+#if defined(__GNUC__) and not defined(__APPLE__)
 /// compiler is stupid. Must specialize
 template<typename T>
 MsgStream& operator << (MsgStream& lhs, const std::_Setfill<T> &manip) {
diff --git a/GaudiKernel/src/Lib/Algorithm.cpp b/GaudiKernel/src/Lib/Algorithm.cpp
index ffe0b60a3af7ced46a98d45455a6c0a0ad7f0041..a994240da4260e9861364e5443c4f6269d885504 100644
--- a/GaudiKernel/src/Lib/Algorithm.cpp
+++ b/GaudiKernel/src/Lib/Algorithm.cpp
@@ -1,5 +1,7 @@
+
 #include <algorithm>
 #include <numeric>
+
 #include "GaudiKernel/Kernel.h"
 #include "GaudiKernel/ISvcLocator.h"
 #include "GaudiKernel/IMessageSvc.h"
diff --git a/GaudiKernel/src/Lib/DataObjectHandle.cpp b/GaudiKernel/src/Lib/DataObjectHandle.cpp
index a6e66ab424bc68c0920e05ae5b1b75469f1d59e5..a55388fca27711c7c6572ac23444084dd3ab2306 100644
--- a/GaudiKernel/src/Lib/DataObjectHandle.cpp
+++ b/GaudiKernel/src/Lib/DataObjectHandle.cpp
@@ -6,9 +6,9 @@
 #include <csignal>
 #include <algorithm>
 
-const char ADDR_SEP = '&';
-const char FIELD_SEP = '|';
-const char ITEM_SEP = '#';
+//const char ADDR_SEP = '&';
+//const char FIELD_SEP = '|';
+//const char ITEM_SEP = '#';
 
 // const std::string DataObjectHandle::NULL_ = "NULL";
 
diff --git a/GaudiKernel/src/Lib/ParsersStandardSingle.cpp b/GaudiKernel/src/Lib/ParsersStandardSingle.cpp
index 87ac79af67b05c577d5e096a56d795f439982346..02b0fd382d3994aac7013e536329dc041800d00b 100644
--- a/GaudiKernel/src/Lib/ParsersStandardSingle.cpp
+++ b/GaudiKernel/src/Lib/ParsersStandardSingle.cpp
@@ -38,7 +38,7 @@ StatusCode Gaudi::Parsers::parse(float& result, const std::string& input) {
   double tmp{0};
   StatusCode sc = Gaudi::Parsers::parse_(tmp, input);
   result = static_cast<float>(tmp);
-  return std::move(sc);
+  return sc;
 }
 #endif
 PARSERS_DEF_FOR_SINGLE(long double)
diff --git a/GaudiKernel/src/Lib/ProcessDescriptor.cpp b/GaudiKernel/src/Lib/ProcessDescriptor.cpp
index 67cc375f65a970c94ccc034846ef7f5a4683c8b2..82e37a56c1572a08fec8dcebdafe0b69ccc5d7b5 100644
--- a/GaudiKernel/src/Lib/ProcessDescriptor.cpp
+++ b/GaudiKernel/src/Lib/ProcessDescriptor.cpp
@@ -14,7 +14,9 @@
 //====================================================================
 #define GAUDIKERNEL_PROCSTAT_CPP
 
+#ifndef __APPLE__
 static const long TICK_TO_100NSEC = 100000;
+#endif // not __APPLE__
 
 namespace System    {
   enum ProcessInfoCommand {
@@ -371,10 +373,12 @@ void readProcStat(long pid, linux_proc& pinfo) {
 //static long s_myPid  = ::getpid();
 // In order to properly support e.g. fork() calls, we cannot keep a copy of the pid!
 #define s_myPid (::getpid())
+#ifndef __APPLE__
 static inline long processID(long pid) {
   long thePid = (pid>0) ? pid : s_myPid;
   return thePid;
 }
+#endif // not __APPLE__
 
 // Framework include files
 #include "ProcessDescriptor.h"
diff --git a/GaudiKernel/src/Lib/System.cpp b/GaudiKernel/src/Lib/System.cpp
index 746a5c151eab4379eea13948970f3c756bd8aa63..c1ad1bf3859134ee3ad6237616fcbeaf0e4448e6 100644
--- a/GaudiKernel/src/Lib/System.cpp
+++ b/GaudiKernel/src/Lib/System.cpp
@@ -20,6 +20,7 @@
 #include <typeinfo>
 #include <memory>
 #include <regex>
+#include <array>
 
 #include "GaudiKernel/System.h"
 #include "instrset.h"
diff --git a/GaudiKernel/src/Lib/ThreadLocalContext.cpp b/GaudiKernel/src/Lib/ThreadLocalContext.cpp
index 4279ccc9662319e22937890a82f3a37a19e1152f..ba788388d92dfa4ba44278e60f5289770ab3b143 100644
--- a/GaudiKernel/src/Lib/ThreadLocalContext.cpp
+++ b/GaudiKernel/src/Lib/ThreadLocalContext.cpp
@@ -1,43 +1,53 @@
 #include "GaudiKernel/ThreadLocalContext.h"
 #include "GaudiKernel/EventContext.h"
 
-static thread_local EventContext s_curCtx;
+#include "Rtypes.h"
+#include "ThreadLocalStorage.h"
+
+namespace {
+   // MacOS X's clang doesn't provide thread_local. So we need to use ROOT's
+   // thread-local implementation to operate on this platform.
+   EventContext& s_curCtx() {
+      TTHREAD_TLS_DECL( EventContext, localContext );
+      return localContext;
+   }
+}
 
 namespace Gaudi {
   namespace Hive {
     ContextIdType currentContextId() {
-      return s_curCtx.slot();
+      return s_curCtx().slot();
     }
     ContextIdType currentContextEvt() {
-      return s_curCtx.evt();
+      return s_curCtx().evt();
     }
     const EventContext& currentContext() {
-      return s_curCtx;
+      return s_curCtx();
     }
 
     void setCurrentContextEvt(long int evtN) {
-      s_curCtx.setEvt(evtN);
+      s_curCtx().setEvt(evtN);
     }
     void setCurrentContextId(ContextIdType newId) {
-      s_curCtx.setSlot(newId);
+      s_curCtx().setSlot(newId);
     }
 
     // FIXME: do we need this method?
     void setCurrentContextId(ContextIdType newId, long int evtN) {
-      s_curCtx.set(evtN,newId);
+      s_curCtx().set(evtN,newId);
     }
 
     // FIXME: do we need this method?
     void setCurrentContextId(const EventContext* ctx) {
-      s_curCtx = *ctx;
+      s_curCtx() = *ctx;
     }
 
     void setCurrentContext(const EventContext* ctx) {
-      s_curCtx = *ctx;
+      s_curCtx() = *ctx;
     }
 
     void setCurrentContext(const EventContext& ctx) {
-      s_curCtx = ctx;
+      s_curCtx() = ctx;
     }
   }
 }
diff --git a/GaudiKernel/src/Lib/Time.cpp b/GaudiKernel/src/Lib/Time.cpp
index 71001b93ee41ef8145ebd0ffca0a25b120898f98..ad9a17941ef6d974918cfddcd81514664c2ae3e0 100644
--- a/GaudiKernel/src/Lib/Time.cpp
+++ b/GaudiKernel/src/Lib/Time.cpp
@@ -121,7 +121,7 @@ Time Time::current (void) {
     char buf[256];
     std::ostringstream tag,msg;
     tag << "errno=" << errno;
-    if( strerror_r(errno, buf, 256) == nullptr ) {
+    if( strerror_r(errno, buf, 256) == 0 ) {
       msg << buf;
     } else {
       msg << "Unknown error retrieving current time";
diff --git a/GaudiMP/CMakeLists.txt b/GaudiMP/CMakeLists.txt
index 0d05424d7ea9441bcec0e1e271c02ad18b81ad83..a4842fbb24c4ccffeccb3ef294088cd535c826b3 100644
--- a/GaudiMP/CMakeLists.txt
+++ b/GaudiMP/CMakeLists.txt
@@ -2,7 +2,7 @@ gaudi_subdir(GaudiMP)
 
 gaudi_depends_on_subdirs(GaudiKernel GaudiAlg)
 
-find_package(ROOT)
+find_package(ROOT COMPONENTS Net RIO Thread)
 find_package(PythonLibs)
 
 # Hide some Boost/ROOT compile time warnings
diff --git a/GaudiMP/dict/gaudimp_dict.h b/GaudiMP/dict/gaudimp_dict.h
index 19f22011250dacb566e5379bfcdb9d3a1b57febb..75456570c43a3c6cd6e3c959aed58f7d041150e3 100644
--- a/GaudiMP/dict/gaudimp_dict.h
+++ b/GaudiMP/dict/gaudimp_dict.h
@@ -4,7 +4,9 @@
 
 // ============================================================================
 // Python must always be the first.
-#include <Python.h>
+#ifndef __APPLE__
+#   include <Python.h>
+#endif // not __APPLE__
 
 #include "GaudiKernel/Algorithm.h"
 #include "GaudiKernel/ParticleProperty.h"
diff --git a/GaudiPython/dict/kernel.h b/GaudiPython/dict/kernel.h
index 1dd926978043d240b3507cd88b8451f4eec0ab80..eec9feff30052b911166f1dd1eb16b2489bd9e84 100644
--- a/GaudiPython/dict/kernel.h
+++ b/GaudiPython/dict/kernel.h
@@ -4,7 +4,9 @@
 
 // ============================================================================
 // Python must always be the first.
-#include "Python.h"
+#ifndef __APPLE__
+#   include "Python.h"
+#endif // not __APPLE__
 
 #include "GaudiKernel/Algorithm.h"
 #include "GaudiKernel/ParticleProperty.h"
diff --git a/GaudiSvc/CMakeLists.txt b/GaudiSvc/CMakeLists.txt
index a42d45b36cdd3104df1eb63c5a7f93e70a89a3c5..97c2b4dc5b9b946a02731fee60e15ff2886ecde5 100644
--- a/GaudiSvc/CMakeLists.txt
+++ b/GaudiSvc/CMakeLists.txt
@@ -4,7 +4,7 @@ gaudi_depends_on_subdirs(GaudiKernel)
 
 find_package(AIDA REQUIRED)
 find_package(Boost REQUIRED COMPONENTS regex)
-find_package(ROOT REQUIRED COMPONENTS Hist RIO Tree Net)
+find_package(ROOT REQUIRED COMPONENTS Hist RIO Tree Net Matrix Thread MathCore)
 find_package(CLHEP REQUIRED)
 
 # Hide some Boost/ROOT/CLHEP compile time warnings
diff --git a/RootHistCnv/CMakeLists.txt b/RootHistCnv/CMakeLists.txt
index 20b3d1144eede81d87b34968732dd9663a24b089..f368e6eb9ec3aadc63e849b0ed69b2d67f524c1f 100644
--- a/RootHistCnv/CMakeLists.txt
+++ b/RootHistCnv/CMakeLists.txt
@@ -3,7 +3,7 @@ gaudi_subdir(RootHistCnv)
 gaudi_depends_on_subdirs(GaudiKernel)
 
 find_package(AIDA)
-find_package(ROOT COMPONENTS RIO Hist Matrix Tree)
+find_package(ROOT COMPONENTS RIO Hist Matrix Tree Thread MathCore Net)
 find_package(Boost)
 
 # Hide some ROOT compile time warnings
diff --git a/cmake/GaudiBuildFlags.cmake b/cmake/GaudiBuildFlags.cmake
index e30afb578f47894daab18723a8ff38794067034d..79de5c6ccfebb0645db346cbe2ea95a65b6da37a 100644
--- a/cmake/GaudiBuildFlags.cmake
+++ b/cmake/GaudiBuildFlags.cmake
@@ -205,10 +205,10 @@ if(NOT GAUDI_FLAGS_SET)
 
   if(APPLE)
     # special link options for MacOSX
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flat_namespace -undefined dynamic_lookup"
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup"
         CACHE STRING "Flags used by the linker during the creation of dll's."
         FORCE)
-    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flat_namespace -undefined dynamic_lookup"
+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -undefined dynamic_lookup"
         CACHE STRING "Flags used by the linker during the creation of modules."
         FORCE)
   endif()
diff --git a/cmake/GaudiProjectConfig.cmake b/cmake/GaudiProjectConfig.cmake
index 7335f82aeffea4aa5d6e5c9525b006a8595d0f78..d6701bb6847cce9e90ac1e416fac7ca5bf0976dd 100644
--- a/cmake/GaudiProjectConfig.cmake
+++ b/cmake/GaudiProjectConfig.cmake
@@ -37,6 +37,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
 # Ensure that the include directories added are always taken first.
 set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
 #set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(CMAKE_MACOSX_RPATH OFF)
 
 # Regular expression used to parse version strings in LHCb and ATLAS.
 # It handles versions strings like "vXrY[pZ[aN]]" and "1.2.3.4"