From 662dbf0cbdfb51f00993e116ba9a9e0cb2434723 Mon Sep 17 00:00:00 2001
From: Giovanni Bussi <giovanni.bussi@gmail.com>
Date: Sat, 19 May 2018 15:20:45 +0200
Subject: [PATCH] Stop using wrapper in plumedKernel

The reason for this change is to eliminate dependencies of
plumedKernel.dylib on plumed.dylib.
Still there is a dependence on plumed_kernel_register that
will be addressed in the next commit.
---
 src/cltools/Driver.cpp   | 8 ++++----
 src/cltools/Makefile     | 2 +-
 src/cltools/SimpleMD.cpp | 6 +++---
 src/cltools/pesmd.cpp    | 4 ++--
 src/ves/Makefile         | 2 +-
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/cltools/Driver.cpp b/src/cltools/Driver.cpp
index 6ca916fb6..cef1cb03a 100644
--- a/src/cltools/Driver.cpp
+++ b/src/cltools/Driver.cpp
@@ -22,7 +22,7 @@
 #include "CLTool.h"
 #include "CLToolRegister.h"
 #include "tools/Tools.h"
-#include "wrapper/Plumed.h"
+#include "core/PlumedMain.h"
 #include "tools/Communicator.h"
 #include "tools/Random.h"
 #include "tools/Pbc.h"
@@ -201,7 +201,7 @@ public:
   static void registerKeywords( Keywords& keys );
   explicit Driver(const CLToolOptions& co );
   int main(FILE* in,FILE*out,Communicator& pc);
-  void evaluateNumericalDerivatives( const long int& step, Plumed& p, const std::vector<real>& coordinates,
+  void evaluateNumericalDerivatives( const long int& step, PlumedMain& p, const std::vector<real>& coordinates,
                                      const std::vector<real>& masses, const std::vector<real>& charges,
                                      std::vector<real>& cell, const double& base, std::vector<real>& numder );
   string description()const;
@@ -493,7 +493,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) {
     if( !Communicator::initialized() ) error("needs mpi for debug-pd");
   }
 
-  Plumed p;
+  PlumedMain p;
   int rr=sizeof(real);
   p.cmd("setRealPrecision",&rr);
   int checknatoms=-1;
@@ -981,7 +981,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) {
 }
 
 template<typename real>
-void Driver<real>::evaluateNumericalDerivatives( const long int& step, Plumed& p, const std::vector<real>& coordinates,
+void Driver<real>::evaluateNumericalDerivatives( const long int& step, PlumedMain& p, const std::vector<real>& coordinates,
     const std::vector<real>& masses, const std::vector<real>& charges,
     std::vector<real>& cell, const double& base, std::vector<real>& numder ) {
 
diff --git a/src/cltools/Makefile b/src/cltools/Makefile
index 6bd17cab5..fbaef65d0 100644
--- a/src/cltools/Makefile
+++ b/src/cltools/Makefile
@@ -1,4 +1,4 @@
-USE=core wrapper config tools molfile
+USE=core config tools molfile
 
 # generic makefile
 include ../maketools/make.module
diff --git a/src/cltools/SimpleMD.cpp b/src/cltools/SimpleMD.cpp
index 490b19f68..d8c591eba 100644
--- a/src/cltools/SimpleMD.cpp
+++ b/src/cltools/SimpleMD.cpp
@@ -21,7 +21,7 @@
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 #include "CLTool.h"
 #include "CLToolRegister.h"
-#include "wrapper/Plumed.h"
+#include "core/PlumedMain.h"
 #include "tools/Vector.h"
 #include "tools/Random.h"
 #include <string>
@@ -444,10 +444,10 @@ private:
 
     Random random;                 // random numbers stream
 
-    std::unique_ptr<Plumed> plumed;
+    std::unique_ptr<PlumedMain> plumed;
 
 // Commenting the next line it is possible to switch-off plumed
-    plumed.reset(new PLMD::Plumed);
+    plumed.reset(new PLMD::PlumedMain);
 
     if(plumed) {
       int s=sizeof(double);
diff --git a/src/cltools/pesmd.cpp b/src/cltools/pesmd.cpp
index a9cd1b5b2..2fae8545b 100644
--- a/src/cltools/pesmd.cpp
+++ b/src/cltools/pesmd.cpp
@@ -21,7 +21,7 @@
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 #include "CLTool.h"
 #include "CLToolRegister.h"
-#include "wrapper/Plumed.h"
+#include "core/PlumedMain.h"
 #include "tools/Vector.h"
 #include "tools/Random.h"
 #include "tools/Communicator.h"
@@ -184,7 +184,7 @@ public:
     else if( lperiod ) error("invalid dimension for periodic potential must be 1, 2 or 3");
 
     // Create plumed object and initialize
-    std::unique_ptr<PLMD::Plumed> plumed(new PLMD::Plumed);
+    std::unique_ptr<PLMD::PlumedMain> plumed(new PLMD::PlumedMain);
     int s=sizeof(double);
     plumed->cmd("setRealPrecision",&s);
     if(Communicator::initialized()) plumed->cmd("setMPIComm",&pc.Get_comm());
diff --git a/src/ves/Makefile b/src/ves/Makefile
index 692933db4..e8b221d2e 100644
--- a/src/ves/Makefile
+++ b/src/ves/Makefile
@@ -1,4 +1,4 @@
-USE=bias cltools colvar config core tools wrapper lepton
+USE=bias cltools colvar config core tools lepton
 
 #generic makefile
 include ../maketools/make.module
-- 
GitLab