diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 23c513d6cf51f97f9d6a2f9e6a3ab0a9cc11fc6d..cc27315018044c69f432e0d144d507123962b24c 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -1851,11 +1851,12 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat unique_lock<mutex> lk {mex_compilation_mut}; filesystem::path output; string cmd; - + */ /* Look for an object to compile, whose prerequisites are already compiled. If found, remove it from the queue, save the output path and the compilation command, and return true. Must be run under the lock. */ - auto pick_job = [&cmd, &output] + /* + auto pick_job = [&cmd, &output] { for (auto it {mex_compilation_queue.begin()}; it != mex_compilation_queue.end(); ++it) if (const auto &prerequisites {get<1>(*it)}; // Will become dangling after erase @@ -1882,27 +1883,32 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat mex_compilation_failed.insert(output); else mex_compilation_done.insert(output); + */ /* The object just compiled may be a prerequisite for several other objects, so notify all waiting workers. Also needed to notify the main thread when in ModelTree::waitForMEXCompilationWorkers().*/ - mex_compilation_cv.notify_all(); + /* + mex_compilation_cv.notify_all(); } }); - + */ /* Set some environment variables needed for compilation on Windows/MATLAB and macOS/Octave. For Windows/MATLAB, this should be done only once, because otherwise the PATH variable can become too long and GCC will not be found. */ + /* if (mexext == "mexw64") { // Put the MinGW environment shipped with Dynare in the path auto mingwpath = dynareroot / "mingw64" / "bin"; string newpath = "PATH=" + mingwpath.string() + ';' + getenv("PATH"); + */ /* We can’t use setenv() since it is not available on MinGW. Note that putenv() seems to make an internal copy of the string on MinGW, contrary to what is done on GNU/Linux and macOS. */ - if (putenv(const_cast<char *>(newpath.c_str())) != 0) + /* + if (putenv(const_cast<char *>(newpath.c_str())) != 0) { cerr << "Can't set PATH" << endl; exit(EXIT_FAILURE); @@ -1911,9 +1917,11 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat #ifdef __APPLE__ else if (mexext == "mex") { + */ /* On macOS, with Octave, enforce GCC, otherwise Clang will be used, and it does not accept our custom optimization flags (see dynare#1797) */ - filesystem::path gcc_path {findGccOnMacos(mexext)}; + /* + filesystem::path gcc_path {findGccOnMacos(mexext)}; if (setenv("CC", gcc_path.c_str(), 1) != 0) { cerr << "Can't set CC environment variable" << endl; @@ -1926,7 +1934,7 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat exit(EXIT_FAILURE); } } -*/ + */ } void