diff --git a/CMakeLists.txt b/CMakeLists.txt
index f636274a69b632382c2cd4fbc9f62aa4f7533bc5..a134b379a8af1e04caf31e165b1a1f739a58ca4f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -703,18 +703,18 @@ if( CHAMELEON_SCHED_STARPU )
         string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
         check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND)
         if ( STARPU_IDLE_PREFETCH_FOUND )
-            set(CHAMELEON_USE_STARPU_IDLE_PREFETCH 1)
-            message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_IDLE_PREFETCH${ColourReset}")
+            set(USE_STARPU_IDLE_PREFETCH 1)
+            message("-- ${Blue}Add definition USE_STARPU_IDLE_PREFETCH${ColourReset}")
         endif()
         check_function_exists(starpu_data_wont_use STARPU_DATA_WONT_USE_FOUND)
         if ( STARPU_DATA_WONT_USE_FOUND )
-            set(CHAMELEON_USE_STARPU_DATA_WONT_USE 1)
-            message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_DATA_WONT_USE${ColourReset}")
+            set(USE_STARPU_DATA_WONT_USE 1)
+            message("-- ${Blue}Add definition USE_STARPU_DATA_WONT_USE${ColourReset}")
         endif()
         check_function_exists(starpu_malloc_on_node_set_default_flags STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS)
         if ( STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS )
-            set(CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS 1)
-            message("-- ${Blue}Add definition CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}")
+            set(USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS 1)
+            message("-- ${Blue}Add definition USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}")
         endif()
         if(CHAMELEON_ENABLE_TRACING)
             # check if fxt profiling is accessible in starpu and activate it in chameleon
diff --git a/control/CMakeLists.txt b/control/CMakeLists.txt
index 05a510888707a7dc2c93ff5cea8345e3b3ca5fe3..dddb507e17a8ea96ad72fa605eedf497b6983c8f 100644
--- a/control/CMakeLists.txt
+++ b/control/CMakeLists.txt
@@ -37,11 +37,16 @@ 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 7f9a6beaf734f5e16e6a276351e7f70cbd23cc12..f08f2712c91a98fe18790d40331168d06b325f71 100644
--- a/control/common.h
+++ b/control/common.h
@@ -43,6 +43,8 @@
 #include <unistd.h>
 #endif
 
+/* need the config to get definitions */
+#include "control/config.h"
 
 /** ****************************************************************************
  * Implementation headers
diff --git a/control/config.h.in b/control/config.h.in
new file mode 100644
index 0000000000000000000000000000000000000000..9d1e5d8a3d3ef442b134b0fe697fdf1b27863ba4
--- /dev/null
+++ b/control/config.h.in
@@ -0,0 +1,45 @@
+/**
+ *
+ * @copyright (c) 2009-2014 The University of Tennessee and The University
+ *                          of Tennessee Research Foundation.
+ *                          All rights reserved.
+ * @copyright (c) 2012-2017 Inria. All rights reserved.
+ * @copyright (c) 2012-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
+ *
+ **/
+
+/**
+ *
+ *  @file config.h
+ *
+ *  MORSE main header
+ *  MORSE is a software package provided by Univ. of Tennessee,
+ *  Univ. of California Berkeley and Univ. of Colorado Denver,
+ *  and INRIA Bordeaux Sud-Ouest
+ *
+ *  @version 0.9.1
+ *  @author Florent Pruvost
+ *  @date 2017-01-09
+ *
+ **/
+#ifndef CONFIG_H_HAS_BEEN_INCLUDED
+#define CONFIG_H_HAS_BEEN_INCLUDED
+
+/* inherit from public chameleon's definitions */
+#include "include/chameleon_config.h"
+
+/* For BLAS Fortran mangling */
+#cmakedefine ADD_
+
+/* Profiling */
+#cmakedefine HAVE_STARPU_FXT_PROFILING
+
+/* Optional functions */
+#cmakedefine HAVE_MAGMA_GETRF_INCPIV_GPU
+#cmakedefine USE_STARPU_IDLE_PREFETCH
+#cmakedefine USE_STARPU_DATA_WONT_USE
+#cmakedefine USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
+#cmakedefine HAVE_STARPU_MPI_DATA_REGISTER
+#cmakedefine HAVE_STARPU_MPI_COMM_RANK
+
+#endif  /* CONFIG_H_HAS_BEEN_INCLUDED */
diff --git a/control/descriptor.h b/control/descriptor.h
index 6070f1c0735f43d9015fe8a494c14f1a2ebcc6c5..e0ebcc936077256f42902dd8a49dcf05ca3c54ab 100644
--- a/control/descriptor.h
+++ b/control/descriptor.h
@@ -27,6 +27,7 @@
 #define _MORSE_DESCRIPTOR_H_
 
 #include <assert.h>
+#include "include/chameleon_config.h"
 #include "morse_struct.h"
 #include "control/auxiliary.h"
 
diff --git a/cudablas/include/cudablas.h b/cudablas/include/cudablas.h
index 8ff43b50726cbb2e6f67e9996cebe4e944934543..f912f315c5fb75891fd0120b843c4226b1b4e901 100644
--- a/cudablas/include/cudablas.h
+++ b/cudablas/include/cudablas.h
@@ -37,6 +37,8 @@
 #include <cuda.h>
 #include <cuComplex.h>
 
+#include "include/chameleon_config.h"
+
 #if defined(CHAMELEON_USE_CUBLAS_V2)
 
 #include <cublas_v2.h>
diff --git a/cudablas/include/cudablas_z.h b/cudablas/include/cudablas_z.h
index e7a0bf44a700c0e84498c29653fa8d3a5c2648c8..e73912750cb83353c4f013520c5c0db7a55ba7dc 100644
--- a/cudablas/include/cudablas_z.h
+++ b/cudablas/include/cudablas_z.h
@@ -25,6 +25,7 @@
 #ifndef _MORSE_CUDA_ZBLAS_H_
 #define _MORSE_CUDA_ZBLAS_H_
 
+#include "include/chameleon_config.h"
 #include "morse_types.h"
 
 #ifdef __cplusplus
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 704b511a34502d20e140fc351a47997888437cba..965963b85b96890513bf14053f1af5700c29509e 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -3,7 +3,7 @@
 # @copyright (c) 2009-2014 The University of Tennessee and The University
 #                          of Tennessee Research Foundation.
 #                          All rights reserved.
-# @copyright (c) 2012-2014 Inria. All rights reserved.
+# @copyright (c) 2012-2017 Inria. All rights reserved.
 # @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
 #
 ###
@@ -22,6 +22,7 @@
 #  @author Cedric Castagnede
 #  @author Emmanuel Agullo
 #  @author Mathieu Faverge
+#  @author Florent Pruvost
 #  @date 13-07-2012
 #
 ###
@@ -40,8 +41,8 @@ set(ZHDR
 precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}"
                     PRECISIONS "z;c;d;s;zc;ds")
 
-configure_file("morse_config.h.in"
-               "morse_config.h"
+configure_file("chameleon_config.h.in"
+               "chameleon_config.h"
                @ONLY)
 configure_file("morse.h.in"
                "morse.h"
@@ -50,12 +51,12 @@ configure_file("morse.h.in"
 # Define the list of headers
 # --------------------------
 set(CHAMELEON_HDRS
+    chameleon_config.h
     morse_constants.h
     morse_kernels.h
     morse_simulate.h
     morse_struct.h
     morse_types.h
-    morse_config.h
     morse.h
     runtime.h
     ${CHAMELEON_HDRS_GENERATED}
@@ -83,7 +84,7 @@ set(HDR_INSTALL
 foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
     list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
 endforeach()
-list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/morse.h ${CMAKE_CURRENT_BINARY_DIR}/morse_config.h)
+list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/morse.h ${CMAKE_CURRENT_BINARY_DIR}/chameleon_config.h)
 
 # installation
 # ------------
diff --git a/include/morse_config.h.in b/include/chameleon_config.h.in
similarity index 65%
rename from include/morse_config.h.in
rename to include/chameleon_config.h.in
index 28df91beae56853a2956499b66d572801482861f..065558af0fff44f708f4534f535ccce782506d38 100644
--- a/include/morse_config.h.in
+++ b/include/chameleon_config.h.in
@@ -10,7 +10,7 @@
 
 /**
  *
- *  @file chameleon.h
+ *  @file chameleon_config.h
  *
  *  MORSE main header
  *  MORSE is a software package provided by Univ. of Tennessee,
@@ -22,8 +22,8 @@
  *  @date 2017-01-06
  *
  **/
-#ifndef MORSE_CONFIG_H_HAS_BEEN_INCLUDED
-#define MORSE_CONFIG_H_HAS_BEEN_INCLUDED
+#ifndef CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED
+#define CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED
 
 #define CHAMELEON_VERSION_MAJOR @CHAMELEON_VERSION_MAJOR@
 #define CHAMELEON_VERSION_MINOR @CHAMELEON_VERSION_MINOR@
@@ -43,24 +43,8 @@
 #cmakedefine CHAMELEON_USE_CUBLAS_V2
 #cmakedefine CHAMELEON_USE_MAGMA
 
-/* For BLAS Fortran mangling */
-#cmakedefine ADD_
-
-/* Profiling */
-#cmakedefine HAVE_STARPU_FXT_PROFILING
-
 /* Simulating */
 #cmakedefine CHAMELEON_SIMULATION
 
-/* Optional functions */
-#cmakedefine CBLAS_HAS_ZGEMM3M
-#cmakedefine CBLAS_HAS_CGEMM3M
-#cmakedefine HAVE_MAGMA_GETRF_INCPIV_GPU
-#cmakedefine CHAMELEON_USE_STARPU_IDLE_PREFETCH
-#cmakedefine CHAMELEON_USE_STARPU_DATA_WONT_USE
-#cmakedefine CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
-#cmakedefine HAVE_STARPU_MPI_DATA_REGISTER
-#cmakedefine HAVE_STARPU_MPI_COMM_RANK
-
 
-#endif  /*MORSE_CONFIG_H_HAS_BEEN_INCLUDED */
+#endif  /* CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED */
diff --git a/include/morse.h.in b/include/morse.h.in
index ef2491519b66097241b0d7fbb1deddc65503b5cb..1a01deb60182d79bb17222834705f0e8bc37a572 100644
--- a/include/morse.h.in
+++ b/include/morse.h.in
@@ -36,7 +36,7 @@
 /* ****************************************************************************
  * MORSE types and constants
  */
-#include "morse_config.h"
+#include "chameleon_config.h"
 #include "morse_types.h"
 #include "morse_struct.h"
 #include "morse_constants.h"
diff --git a/include/morse_simulate.h b/include/morse_simulate.h
index f66ce2318974a10e6429a8b925c803f28233c21a..03dd4fb401300d67ea0ad7782ba187dda5a2d1b0 100644
--- a/include/morse_simulate.h
+++ b/include/morse_simulate.h
@@ -25,6 +25,8 @@
 #ifndef _MORSE_SIMULATE_H_
 #define _MORSE_SIMULATE_H_
 
+#include "include/chameleon_config.h"
+
 /* we need this when starpu is compiled with simgrid enabled */
 #if defined(CHAMELEON_SCHED_STARPU) && defined(CHAMELEON_SIMULATION)
 #include <starpu_simgrid_wrap.h>
diff --git a/include/morse_struct.h b/include/morse_struct.h
index 7f866e60ae895c581f4dd8bba8add77545beebbd..a710366df4db13e608749f19a999f1f49fd3e9bf 100644
--- a/include/morse_struct.h
+++ b/include/morse_struct.h
@@ -28,6 +28,7 @@
 #ifndef _MORSE_STRUCT_H_
 #define _MORSE_STRUCT_H_
 
+#include "include/chameleon_config.h"
 #include "morse_types.h"
 
 /** ****************************************************************************
diff --git a/runtime/starpu/codelets/codelet_dataflush.c b/runtime/starpu/codelets/codelet_dataflush.c
index 84b280d03a7cc89fd56ce20a5ee140d4889ecf83..226d4b523cd3e6a45d64c47de60c0e6527c67d23 100644
--- a/runtime/starpu/codelets/codelet_dataflush.c
+++ b/runtime/starpu/codelets/codelet_dataflush.c
@@ -26,8 +26,8 @@
  **/
 #include "runtime/starpu/include/morse_starpu.h"
 
-#ifdef CHAMELEON_USE_STARPU_DATA_WONT_USE
-#elif defined CHAMELEON_USE_STARPU_IDLE_PREFETCH
+#ifdef USE_STARPU_DATA_WONT_USE
+#elif defined USE_STARPU_IDLE_PREFETCH
 static void data_flush(void *handle)
 {
         starpu_data_idle_prefetch_on_node(handle, STARPU_MAIN_RAM, 1);
@@ -63,9 +63,9 @@ void MORSE_TASK_dataflush(const MORSE_option_t *options,
             if ( A->myrank == A->get_rankof( A, Am, An ) )
             {
                 /* Push data to main memory when we have time to */
-#ifdef CHAMELEON_USE_STARPU_DATA_WONT_USE
+#ifdef USE_STARPU_DATA_WONT_USE
                 starpu_data_wont_use(*ptrtile);
-#elif defined CHAMELEON_USE_STARPU_IDLE_PREFETCH
+#elif defined USE_STARPU_IDLE_PREFETCH
                 starpu_data_acquire_on_node_cb(*ptrtile, -1, STARPU_R, data_flush, *ptrtile);
 #else
                 starpu_data_acquire_cb(*ptrtile, STARPU_R, data_release, *ptrtile);
diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c
index f63e73a4533fa5e02613119f058019d3838d6635..113939dd9f8022c79e5355f34564c0b5d80fba0b 100644
--- a/runtime/starpu/control/runtime_control.c
+++ b/runtime/starpu/control/runtime_control.c
@@ -113,7 +113,7 @@ int RUNTIME_init_scheduler( MORSE_context_t *morse, int ncpus, int ncudas, int n
         morse->nthreads_per_worker = nthreads_per_worker;
     }
 
-#ifdef CHAMELEON_USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
+#ifdef USE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS
     starpu_malloc_on_node_set_default_flags(STARPU_MAIN_RAM, STARPU_MALLOC_PINNED | STARPU_MALLOC_COUNT
 #ifdef STARPU_MALLOC_SIMULATION_FOLDED
             | STARPU_MALLOC_SIMULATION_FOLDED
diff --git a/runtime/starpu/include/morse_starpu.h b/runtime/starpu/include/morse_starpu.h
index 64edb2b180eb9ad07c2d2aec807683c68b30cc21..2f0ff0356241975c1082f3648fe69acb95e2d63c 100644
--- a/runtime/starpu/include/morse_starpu.h
+++ b/runtime/starpu/include/morse_starpu.h
@@ -32,6 +32,8 @@
 #ifndef _MORSE_STARPU_H_
 #define _MORSE_STARPU_H_
 
+#include "include/chameleon_config.h"
+
 #if defined(CHAMELEON_USE_MPI)
 #include <starpu_mpi.h>
 #else
diff --git a/runtime/starpu/include/runtime_codelets.h b/runtime/starpu/include/runtime_codelets.h
index 14b1c8e566125b1dba96c4f860bbf956d4d84a73..ad18261bcae347de1574cc45e491e46bf47f910a 100644
--- a/runtime/starpu/include/runtime_codelets.h
+++ b/runtime/starpu/include/runtime_codelets.h
@@ -28,6 +28,7 @@
 #ifndef _CODELETS_H_
 #define _CODELETS_H_
 
+#include "include/chameleon_config.h"
 #include "runtime_codelet_profile.h"
 
 //#undef STARPU_CUDA_ASYNC