From f83427ac63b4d1f4588b5fe8a1f409ecfce8482b Mon Sep 17 00:00:00 2001
From: Rafael Ravedutti <rafaelravedutti@gmail.com>
Date: Thu, 15 Feb 2024 03:16:46 +0100
Subject: [PATCH] Fix compilation with waLBerla

Signed-off-by: Rafael Ravedutti <rafaelravedutti@gmail.com>
---
 CMakeLists.txt                  | 11 +++++------
 runtime/domain/block_forest.cpp |  6 +++---
 runtime/domain/block_forest.hpp |  6 +++---
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57f4d0b..a53979a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,8 @@ execute_process(
     COMMAND ${PYTHON_EXECUTABLE} setup.py install --user
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 
+add_executable(${CPU_BIN} ${CPU_SRC} ${RUNTIME_COMMON_FILES} ${RUNTIME_CPU_FILES})
+
 if(USE_WALBERLA)
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WALBERLA_LOAD_BALANCING ")
     find_package(waLBerla REQUIRED)
@@ -60,9 +62,7 @@ if(USE_WALBERLA)
     waLBerla_add_executable(
         NAME ${CPU_BIN}
         FILES ${CPU_SRC} ${RUNTIME_COMMON_FILES} ${RUNTIME_CPU_FILES}
-        DEPENDS blockforest core pe ${CPU_SRC} runtime_cpu)
-else()
-    add_executable(${CPU_BIN} ${CPU_SRC} ${RUNTIME_COMMON_FILES} ${RUNTIME_CPU_FILES})
+        DEPENDS blockforest core pe ${CPU_SRC})
 endif()
 
 add_library(runtime_cpu STATIC runtime/devices/dummy.cpp)
@@ -80,14 +80,13 @@ add_dependencies(${CPU_BIN} gen_cpu)
 if(COMPILE_CUDA)
     find_package(CUDA REQUIRED)
     enable_language(CUDA)
+    add_executable(${GPU_BIN} ${GPU_SRC} ${RUNTIME_COMMON_FILES} ${RUNTIME_GPU_FILES})
 
     if(USE_WALBERLA)
         waLBerla_add_executable(
             NAME ${GPU_BIN}
             FILES ${GPU_SRC} ${RUNTIME_COMMON_FILES}
-            DEPENDS blockforest core pe ${GPU_SRC} runtime_gpu)
-    else()
-        add_executable(${GPU_BIN} ${GPU_SRC} ${RUNTIME_COMMON_FILES} ${RUNTIME_GPU_FILES})
+            DEPENDS blockforest core pe ${GPU_SRC})
     endif()
 
     if(ENABLE_GPU_DIRECT)
diff --git a/runtime/domain/block_forest.cpp b/runtime/domain/block_forest.cpp
index 54aba1d..8996ed6 100644
--- a/runtime/domain/block_forest.cpp
+++ b/runtime/domain/block_forest.cpp
@@ -8,9 +8,9 @@
 #include <blockforest/loadbalancing/DynamicParMetis.h>
 #include <blockforest/loadbalancing/InfoCollection.h>
 #include <blockforest/loadbalancing/PODPhantomData.h>
-#include <pe/amr/level_determination/MinMaxLevelDetermination.h>
-#include <pe/amr/weight_assignment/MetisAssignmentFunctor.h>
-#include <pe/amr/weight_assignment/WeightAssignmentFunctor.h>
+#include <blockforest/loadbalancing/level_determination/MinMaxLevelDetermination.h>
+#include <blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h>
+#include <blockforest/loadbalancing/weight_assignment/WeightAssignmentFunctor.h>
 //---
 #include "../boundary_weights.hpp"
 #include "../pairs_common.hpp"
diff --git a/runtime/domain/block_forest.hpp b/runtime/domain/block_forest.hpp
index 22b7fe1..fd49eb1 100644
--- a/runtime/domain/block_forest.hpp
+++ b/runtime/domain/block_forest.hpp
@@ -7,9 +7,9 @@
 #include <blockforest/loadbalancing/DynamicParMetis.h>
 #include <blockforest/loadbalancing/InfoCollection.h>
 #include <blockforest/loadbalancing/PODPhantomData.h>
-#include <pe/amr/level_determination/MinMaxLevelDetermination.h>
-#include <pe/amr/weight_assignment/MetisAssignmentFunctor.h>
-#include <pe/amr/weight_assignment/WeightAssignmentFunctor.h>
+#include <blockforest/loadbalancing/level_determination/MinMaxLevelDetermination.h>
+#include <blockforest/loadbalancing/weight_assignment/MetisAssignmentFunctor.h>
+#include <blockforest/loadbalancing/weight_assignment/WeightAssignmentFunctor.h>
 //---
 #include "../pairs_common.hpp"
 #include "domain_partitioning.hpp"
-- 
GitLab