diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index 41bed024ef26df24163dd96f549c225f54628a0f..960c894439506e88b98206f212854097c1b333e1 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1961,6 +1961,8 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat
           {
             lk.unlock();
             int r {system(cmd.c_str())};
+            if (r)
+              cout << cmd.c_str() << endl;
             lk.lock();
             mex_compilation_ongoing.erase(output);
             if (r)