From 02f131c5446a60d74bc13b33fb03ccdd3caeb3b7 Mon Sep 17 00:00:00 2001
From: Richard Berger <richard.berger@temple.edu>
Date: Mon, 27 Aug 2018 22:11:15 -0400
Subject: [PATCH] Fix USER-OMP compilation with CMake

---
 cmake/CMakeLists.txt  |  3 +-
 src/accelerator_omp.h | 88 +------------------------------------------
 2 files changed, 4 insertions(+), 87 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 78e18e489c..b1287661c0 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -678,7 +678,8 @@ if(PKG_USER-OMP)
     set(USER-OMP_SOURCES ${USER-OMP_SOURCES_DIR}/thr_data.cpp
                          ${USER-OMP_SOURCES_DIR}/thr_omp.cpp
                          ${USER-OMP_SOURCES_DIR}/fix_nh_omp.cpp
-                         ${USER-OMP_SOURCES_DIR}/fix_nh_sphere_omp.cpp)
+                         ${USER-OMP_SOURCES_DIR}/fix_nh_sphere_omp.cpp
+                         ${USER-OMP_SOURCES_DIR}/domain_omp.cpp)
     add_definitions(-DLMP_USER_OMP)
     set_property(GLOBAL PROPERTY "OMP_SOURCES" "${USER-OMP_SOURCES}")
 
diff --git a/src/accelerator_omp.h b/src/accelerator_omp.h
index 6caa0826fe..25910ae800 100644
--- a/src/accelerator_omp.h
+++ b/src/accelerator_omp.h
@@ -17,47 +17,6 @@
 
 // true interface to USER-OMP
 
-// this part is used inside the neighbor.h header file to
-// add functions to the Neighbor class definition
-
-#ifdef LMP_INSIDE_NEIGHBOR_H
-
-  void half_nsq_no_newton_omp(class NeighList *);
-  void half_nsq_no_newton_ghost_omp(class NeighList *);
-  void half_nsq_newton_omp(class NeighList *);
-
-  void half_bin_no_newton_omp(class NeighList *);
-  void half_bin_no_newton_ghost_omp(class NeighList *);
-  void half_bin_newton_omp(class NeighList *);
-  void half_bin_newton_tri_omp(class NeighList *);
-
-  void half_multi_no_newton_omp(class NeighList *);
-  void half_multi_newton_omp(class NeighList *);
-  void half_multi_newton_tri_omp(class NeighList *);
-
-  void full_nsq_omp(class NeighList *);
-  void full_nsq_ghost_omp(class NeighList *);
-  void full_bin_omp(class NeighList *);
-  void full_bin_ghost_omp(class NeighList *);
-  void full_multi_omp(class NeighList *);
-
-  void half_from_full_no_newton_omp(class NeighList *);
-  void half_from_full_newton_omp(class NeighList *);
-
-  void granular_nsq_no_newton_omp(class NeighList *);
-  void granular_nsq_newton_omp(class NeighList *);
-  void granular_bin_no_newton_omp(class NeighList *);
-  void granular_bin_newton_omp(class NeighList *);
-  void granular_bin_newton_tri_omp(class NeighList *);
-
-  void respa_nsq_no_newton_omp(class NeighList *);
-  void respa_nsq_newton_omp(class NeighList *);
-  void respa_bin_no_newton_omp(class NeighList *);
-  void respa_bin_newton_omp(class NeighList *);
-  void respa_bin_newton_tri_omp(class NeighList *);
-
-#else /* !LMP_INSIDE_NEIGHBOR_H */
-
 // provide a DomainOMP class with some overrides for Domain
 #include "domain.h"
 
@@ -68,8 +27,8 @@ namespace LAMMPS_NS {
 
 class DomainOMP : public Domain {
  public:
-  DomainOMP(class LAMMPS *lmp) : Domain(lmp) {};
-  virtual ~DomainOMP() {};
+  DomainOMP(class LAMMPS *lmp) : Domain(lmp) {}
+  virtual ~DomainOMP() {}
 
   // multi-threaded versions
   virtual void pbc();
@@ -81,48 +40,5 @@ class DomainOMP : public Domain {
 }
 
 #endif /* LMP_DOMAIN_OMP_H */
-#endif /* !LMP_INSIDE_NEIGHBOR_H */
-
-#else /* !LMP_USER_OMP */
-
-// dummy interface to USER-OMP
-// needed for compiling when USER-OMP is not installed
-
-#ifdef LMP_INSIDE_NEIGHBOR_H
-
-  void half_nsq_no_newton_omp(class NeighList *) {}
-  void half_nsq_no_newton_ghost_omp(class NeighList *) {}
-  void half_nsq_newton_omp(class NeighList *) {}
-
-  void half_bin_no_newton_omp(class NeighList *) {}
-  void half_bin_no_newton_ghost_omp(class NeighList *) {}
-  void half_bin_newton_omp(class NeighList *) {}
-  void half_bin_newton_tri_omp(class NeighList *) {}
-
-  void half_multi_no_newton_omp(class NeighList *) {}
-  void half_multi_newton_omp(class NeighList *) {}
-  void half_multi_newton_tri_omp(class NeighList *) {}
-
-  void full_nsq_omp(class NeighList *) {}
-  void full_nsq_ghost_omp(class NeighList *) {}
-  void full_bin_omp(class NeighList *) {}
-  void full_bin_ghost_omp(class NeighList *) {}
-  void full_multi_omp(class NeighList *) {}
-
-  void half_from_full_no_newton_omp(class NeighList *) {}
-  void half_from_full_newton_omp(class NeighList *) {}
-
-  void granular_nsq_no_newton_omp(class NeighList *) {}
-  void granular_nsq_newton_omp(class NeighList *) {}
-  void granular_bin_no_newton_omp(class NeighList *) {}
-  void granular_bin_newton_omp(class NeighList *) {}
-  void granular_bin_newton_tri_omp(class NeighList *) {}
-
-  void respa_nsq_no_newton_omp(class NeighList *) {}
-  void respa_nsq_newton_omp(class NeighList *) {}
-  void respa_bin_no_newton_omp(class NeighList *) {}
-  void respa_bin_newton_omp(class NeighList *) {}
-  void respa_bin_newton_tri_omp(class NeighList *) {}
-#endif
 
 #endif /* !LMP_USER_OMP */
-- 
GitLab