diff --git a/bin/donkey_benchmark_compilation_wrapper.sh b/bin/donkey_benchmark_compilation_wrapper.sh
new file mode 100644
index 0000000000000000000000000000000000000000..c911180de5d90d3d8ce09bc027bb1dd7d03fbaa6
--- /dev/null
+++ b/bin/donkey_benchmark_compilation_wrapper.sh
@@ -0,0 +1,17 @@
+#!/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
+
+"$@"
+
+sleep 0.1s
+
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 717b9d804ef849b29e1c3fe3c4d7702010efc6e1..74146153b29ea03971bab9ae9ea1a5d1e7efcbe1 100644
--- a/python/dune/codegen/sumfact/autotune.py
+++ b/python/dune/codegen/sumfact/autotune.py
@@ -304,14 +304,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)