From c34dddd677b3e7b7b51a8dca5fec44790c68b033 Mon Sep 17 00:00:00 2001 From: MichelJuillard <michel.juillard@mjui.fr> Date: Wed, 6 Dec 2023 16:37:41 +0100 Subject: [PATCH] fix comments --- src/ModelTree.cc | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 2e799765..6d14cabb 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -1938,11 +1938,13 @@ 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] { + /* + 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 includes(mex_compilation_done.begin(), mex_compilation_done.end(), @@ -1968,27 +1970,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); @@ -1997,10 +2004,12 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat #ifdef __APPLE__ else if (mexext == "mex") { + */ /* On macOS, with Octave, enforce our compiler. In particular this is necessary if we’ve selected GCC; otherwise Clang will be used, and it does not accept the same optimization flags (see dynare#1797) */ - auto [compiler_path, is_clang] {findCompilerOnMacos(mexext)}; + /* + auto [compiler_path, is_clang] { findCompilerOnMacos(mexext) }; if (setenv("CC", compiler_path.c_str(), 1) != 0) { cerr << "Can't set CC environment variable" << endl; @@ -2013,7 +2022,8 @@ ModelTree::initializeMEXCompilationWorkers(int numworkers, const filesystem::pat exit(EXIT_FAILURE); } } -*/ +#endif + */ } void -- GitLab