From 00bd4e4492e918fb7673709c17afe454d1ad5802 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Mon, 31 Jul 2017 18:37:47 +0200
Subject: [PATCH] Move StarPU configuration to the StarPU directory

---
 CMakeLists.txt                               |  5 ++---
 control/CMakeLists.txt                       |  5 -----
 control/common.h                             |  3 ---
 runtime/starpu/CMakeLists.txt                |  6 +++++-
 runtime/starpu/include/chameleon_starpu.h.in | 13 ++++++++++++-
 5 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f106b6f49..1f50d75be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,8 +3,8 @@
 # @copyright (c) 2009-2014 The University of Tennessee and The University
 #                          of Tennessee Research Foundation.
 #                          All rights reserved.
-# @copyright (c) 2012-2016 Inria. All rights reserved.
-# @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
+# @copyright (c) 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
+#                          Univ. Bordeaux. All rights reserved.
 #
 ###
 #
@@ -612,7 +612,6 @@ endif(NOT CHAMELEON_SIMULATION)
 
 # CHAMELEON depends on a runtime
 # -------------------------------
-
 if( CHAMELEON_SCHED_STARPU )
 
   set(CHAMELEON_STARPU_VERSION "1.1" CACHE STRING "oldest STARPU version desired")
diff --git a/control/CMakeLists.txt b/control/CMakeLists.txt
index e1861ba32..6813bbf27 100644
--- a/control/CMakeLists.txt
+++ b/control/CMakeLists.txt
@@ -38,16 +38,11 @@ set(ZHDR
 precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}"
                     PRECISIONS "s;d;c;z;ds;zc")
 
-configure_file("config.h.in"
-               "config.h"
-               @ONLY)
-
 # Define the list of headers
 # --------------------------
 set(CHAMELEON_HDRS
     async.h
     auxiliary.h
-    config.h
     common.h
     context.h
     descriptor.h
diff --git a/control/common.h b/control/common.h
index 64d8fa07b..3e0854f85 100644
--- a/control/common.h
+++ b/control/common.h
@@ -38,9 +38,6 @@
 #include <unistd.h>
 #endif
 
-/* need the config to get definitions */
-#include "control/config.h"
-
 /** ****************************************************************************
  * Implementation headers
  **/
diff --git a/runtime/starpu/CMakeLists.txt b/runtime/starpu/CMakeLists.txt
index bf86ebc1a..4c5da51f5 100644
--- a/runtime/starpu/CMakeLists.txt
+++ b/runtime/starpu/CMakeLists.txt
@@ -31,6 +31,10 @@ cmake_minimum_required(VERSION 2.8)
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
 include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include )
 
+configure_file("include/chameleon_starpu.h.in"
+               "include/chameleon_starpu.h"
+               @ONLY)
+
 # Generate headers for all possible precisions
 # --------------------------------------------
 set(RUNTIME_HDRS_GENERATED "")
@@ -45,7 +49,7 @@ precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
 # Define the list of headers
 # --------------------------
 set(RUNTIME_HDRS
-  include/chameleon_starpu.h
+  ${CMAKE_CURRENT_BINARY_DIR}/include/chameleon_starpu.h
   include/runtime_codelet_profile.h
   include/runtime_codelets.h
   include/runtime_profiling.h
diff --git a/runtime/starpu/include/chameleon_starpu.h.in b/runtime/starpu/include/chameleon_starpu.h.in
index e171edd10..5c24359b8 100644
--- a/runtime/starpu/include/chameleon_starpu.h.in
+++ b/runtime/starpu/include/chameleon_starpu.h.in
@@ -7,7 +7,6 @@
  * @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
  *
  **/
-
 /**
  *
  * @file morse_starpu.h
@@ -20,6 +19,7 @@
  * @version 0.9.0
  * @author Mathieu Faverge
  * @author Cedric Castagnede
+ * @author Florent Pruvost
  * @date 2011-06-01
  *
  **/
@@ -28,6 +28,17 @@
 
 #include "chameleon/chameleon_config.h"
 
+/* StarPU options */
+#cmakedefine HAVE_STARPU_FXT_PROFILING
+#cmakedefine HAVE_STARPU_IDLE_PREFETCH
+#cmakedefine HAVE_STARPU_ITERATION_PUSH
+#cmakedefine HAVE_STARPU_DATA_WONT_USE
+#cmakedefine HAVE_STARPU_DATA_SET_COORDINATES
+#cmakedefine HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
+#cmakedefine HAVE_STARPU_MPI_DATA_REGISTER
+#cmakedefine HAVE_STARPU_MPI_COMM_RANK
+#cmakedefine HAVE_STARPU_MPI_CACHED_RECEIVE
+
 #if defined(CHAMELEON_USE_MPI)
 #include <starpu_mpi.h>
 #else
-- 
GitLab