diff --git a/bin/donkey_benchmark_compilation_wrapper.sh b/bin/donkey_benchmark_compilation_wrapper.sh
new file mode 100755
index 0000000000000000000000000000000000000000..e2691b5d71db2473b731fabcea6a1095ec2516d9
--- /dev/null
+++ b/bin/donkey_benchmark_compilation_wrapper.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+ml gcc/6.4.0
+ml benchmark/1.4.0
+ml python/3.6.3
+ml openmpi
+ml cmake
+ml openblas
+ml metis
+ml suite-sparse
+ml superlu
+ml parmetis
+
+("$@")
+code=$?
+echo "Code: $code"
+sleep 0.1s
+
+exit $code
diff --git a/bin/donkey_benchmark_wrapper.py b/bin/donkey_benchmark_execution_wrapper.py
similarity index 100%
rename from bin/donkey_benchmark_wrapper.py
rename to bin/donkey_benchmark_execution_wrapper.py
diff --git a/python/dune/codegen/sumfact/autotune.py b/python/dune/codegen/sumfact/autotune.py
index bbe00a78f4552932d29f4cc1a18c07c8384db78a..4653e4b8ce71b0197999fbb830ff11d4ed5a4136 100644
--- a/python/dune/codegen/sumfact/autotune.py
+++ b/python/dune/codegen/sumfact/autotune.py
@@ -308,14 +308,20 @@ def autotune_realization(sf):
                 else:
                     generate_standalone_code(sf, filename)
 
+                call = []
+                wrapper = get_cmake_cache_entry("DUNE_CODEGEN_BENCHMARK_COMPILATION_WRAPPER")
+                if wrapper:
+                    call.append(wrapper)
+
+                call.extend(compiler_invocation(executable, filename))
                 devnull = open(os.devnull, 'w')
-                ret = subprocess.call(compiler_invocation(executable, filename), stdout=devnull, stderr=subprocess.STDOUT)
+                ret = subprocess.call(call, stdout=devnull, stderr=subprocess.STDOUT)
                 if ret != 0:
-                    raise CodegenAutotuneError("Compilation of autotune executable failed. Invocation: {}".format(" ".join(compiler_invocation(executable, filename))))
+                    raise CodegenAutotuneError("Compilation of autotune executable failed. Invocation: {}".format(" ".join(call)))
 
                 # Check whether the user specified an execution wrapper
                 call = []
-                wrapper = get_cmake_cache_entry("DUNE_CODEGEN_BENCHMARK_WRAPPER")
+                wrapper = get_cmake_cache_entry("DUNE_CODEGEN_BENCHMARK_EXECUTION_WRAPPER")
                 if wrapper:
                     call.append(wrapper)