diff --git a/configure.ac b/configure.ac
index 3cb4679da342a7830a5ffe4345fec3385fc1efc1..c29c74859ad6b034c447b6512a8a108ad00189b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -559,7 +559,6 @@ case "$with_hydro" in
    ;;
 esac
 
-
 # SPH Kernel function
 AC_ARG_WITH([kernel],
    [AS_HELP_STRING([--with-kernel=<kernel>],
@@ -592,7 +591,6 @@ case "$with_kernel" in
    ;;
 esac
 
-
 #  Dimensionality of the hydro scheme.
 AC_ARG_WITH([hydro-dimension],
    [AS_HELP_STRING([--with-hydro-dimension=<dim>],
@@ -662,6 +660,32 @@ case "$with_gamma" in
    ;;
 esac
 
+#  Riemann solver
+AC_ARG_WITH([riemann-solver],
+   [AS_HELP_STRING([--with-riemann-solver=<solver>],
+      [riemann solver (gizmo-sph only) @<:@none, exact, trrs, hllc, default: none@:>@]
+   )],
+   [with_riemann="$withval"],
+   [with_riemann="none"]
+)
+case "$with_riemann" in
+   none)
+      AC_DEFINE([RIEMANN_SOLVER_NONE], [1], [No Riemann solver])
+   ;; 
+   exact)
+      AC_DEFINE([RIEMANN_SOLVER_EXACT], [1], [Exact Riemann solver])
+   ;; 
+   trrs)
+      AC_DEFINE([RIEMANN_SOLVER_TRRS], [1], [Two Rarefaction Riemann Solver])
+   ;; 
+   hllc)
+      AC_DEFINE([RIEMANN_SOLVER_HLLC], [1], [Harten-Lax-van Leer-Contact Riemann solver])
+   ;; 
+   *)
+      AC_MSG_ERROR([Unknown Riemann solver: $with_riemann])
+   ;;
+esac
+
 #  Cooling function
 AC_ARG_WITH([cooling],
    [AS_HELP_STRING([--with-cooling=<function>],
@@ -760,6 +784,7 @@ AC_MSG_RESULT([
    Kernel function    : $with_kernel
    Equation of state  : $with_eos
    Adiabatic index    : $with_gamma
+   Riemann solver     : $with_riemann
    Cooling function   : $with_cooling
    External potential : $with_potential
    Task debugging     : $enable_task_debugging
diff --git a/src/const.h b/src/const.h
index 8f8d25f93e4d924f0c12a5578d6e38b94c562b7c..c290a3e73a524e9003cadb63f8bd45e8b3c51dac 100644
--- a/src/const.h
+++ b/src/const.h
@@ -45,11 +45,6 @@
 #define const_gravity_r_cut 4.5f
 #define const_gravity_eta 0.025f
 
-/* Riemann solver to use (GIZMO_SPH only) */
-#define RIEMANN_SOLVER_EXACT
-//#define RIEMANN_SOLVER_TRRS
-//#define RIEMANN_SOLVER_HLLC
-
 /* Type of gradients to use (GIZMO_SPH only) */
 /* If no option is chosen, no gradients are used (first order scheme) */
 //#define GRADIENTS_SPH
diff --git a/src/hydro.h b/src/hydro.h
index 4345c9a979fbd169a25594b46b35ea8efe39eba0..3dce6df074767c15828c3a0c9eec738b32b5d7a3 100644
--- a/src/hydro.h
+++ b/src/hydro.h
@@ -19,10 +19,12 @@
 #ifndef SWIFT_HYDRO_H
 #define SWIFT_HYDRO_H
 
-/* Includes. */
+/* Config parameters. */
+#include "../config.h"
+
+/* Local headers. */
 #include "hydro_properties.h"
 #include "kernel_hydro.h"
-#include "part.h"
 
 /* Import the right functions */
 #if defined(MINIMAL_SPH)
diff --git a/src/riemann.h b/src/riemann.h
index 69e1a038fc37cb07e1094c8e6736f79b6afa4f35..685d40708e598249151f6cbe13be016edea79553 100644
--- a/src/riemann.h
+++ b/src/riemann.h
@@ -19,13 +19,8 @@
 #ifndef SWIFT_RIEMANN_H
 #define SWIFT_RIEMANN_H
 
-/* gives us const_hydro_gamma and tells us which floating point type to use */
-#include "const.h"
-#include "error.h"
-#include "float.h"
-#include "math.h"
-#include "stdio.h"
-#include "stdlib.h"
+/* Config parameters. */
+#include "../config.h"
 
 #if defined(RIEMANN_SOLVER_EXACT)
 
@@ -35,8 +30,7 @@
 #elif defined(EOS_ISOTHERMAL_GAS)
 #include "riemann/riemann_exact_isothermal.h"
 #else
-#error \
-    "The Exact Riemann solver is incompatible with the selected equation of state!"
+#error "The Exact Riemann solver is incompatible with this equation of state!"
 #endif
 
 #elif defined(RIEMANN_SOLVER_TRRS)
diff --git a/src/riemann/riemann_exact.h b/src/riemann/riemann_exact.h
index 10dfe56ef35a82e721a715bbb8c7a71979b8e6ce..4a20561def8ac56889d4e2d836dd698e663e8d7e 100644
--- a/src/riemann/riemann_exact.h
+++ b/src/riemann/riemann_exact.h
@@ -25,12 +25,18 @@
  *  Dynamics, Springer (2009, 3rd edition)
  *
  ******************************************************************************/
-
 #ifndef SWIFT_RIEMANN_EXACT_H
 #define SWIFT_RIEMANN_EXACT_H
 
+/* Some standard headers. */
 #include <float.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Local headers. */
 #include "adiabatic_index.h"
+#include "error.h"
 #include "minmax.h"
 #include "riemann_vacuum.h"
 
diff --git a/src/riemann/riemann_hllc.h b/src/riemann/riemann_hllc.h
index 962fb8380ad9919d7b7ad96325a12f0bfc53d255..e9a32cb93689e4beccc2a53831c56fcb612eac54 100644
--- a/src/riemann/riemann_hllc.h
+++ b/src/riemann/riemann_hllc.h
@@ -20,7 +20,15 @@
 #ifndef SWIFT_RIEMANN_HLLC_H
 #define SWIFT_RIEMANN_HLLC_H
 
+/* Some standard headers. */
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Local headers. */
 #include "adiabatic_index.h"
+#include "error.h"
 #include "minmax.h"
 #include "riemann_vacuum.h"
 
diff --git a/src/riemann/riemann_trrs.h b/src/riemann/riemann_trrs.h
index be56b93583b693d7d492e0c8b1357cdbe57e88b5..44fbe6ffb8fb1f557045b6e466c87e7d8b591aab 100644
--- a/src/riemann/riemann_trrs.h
+++ b/src/riemann/riemann_trrs.h
@@ -16,11 +16,19 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  ******************************************************************************/
-
 #ifndef SWIFT_RIEMANN_TRRS_H
 #define SWIFT_RIEMANN_TRRS_H
 
+/* Some standard headers. */
+#include <float.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Local headers. */
 #include "adiabatic_index.h"
+#include "error.h"
+#include "minmax.h"
 #include "riemann_vacuum.h"
 
 #ifndef EOS_IDEAL_GAS