diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index 41bed024ef26df24163dd96f549c225f54628a0f..21be20024d73b2a63a973b59620206fb971149f7 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)