From 7068f814384a3e63fb95fb9d5cff8121f340dc9c Mon Sep 17 00:00:00 2001 From: MichelJuillard <michel.juillard@mjui.fr> Date: Fri, 31 Mar 2023 15:00:48 +0200 Subject: [PATCH] fix comments --- src/ModelTree.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 23c513d6..cc273150 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 -- GitLab