Repository navigation
chore: Removed several dependencies on Boost to reduce build complexity and improve portability - #1467
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR reduces Boost usage across the codebase to simplify builds and improve portability by replacing Boost components with standard library equivalents and platform APIs.
- Replace Boost date_time/chrono with std::chrono and C time APIs in time-related modules and profiler.
- Replace Boost interprocess named_mutex with Win32 named mutexes and POSIX named semaphores for IPC flags; remove Boost linking from CMake/vcxproj.
- Replace Boost utilities (gcd, ibeta, endian) with std::gcd, a local incomplete beta implementation, and custom byte-swap helpers.
Reviewed Changes
Copilot reviewed 73 out of 73 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/webtools/CMakeLists.txt | Drop Boost include dirs from webtools module include paths. |
| modules/validators/CMakeLists.txt | Drop Boost include dirs from validators. |
| modules/trigonometric_functions/CMakeLists.txt | Remove Boost includes from target includes. |
| modules/time/src/cpp/Time.cpp | Replace Boost date_time/chrono with std::chrono for nanosecond time. |
| modules/time/src/cpp/Now.cpp | Replace Boost posix_time with std::time + localtime_s/r. |
| modules/time/src/cpp/Clock.cpp | Replace Boost posix_time with std::time + localtime_s/r. |
| modules/time/src/cpp/Calendar.cpp | Remove Boost date_time; implement chrono-based date math and calendar rendering. |
| modules/time/src/c/nlsTime.vcxproj | Remove Boost include path from project includes. |
| modules/time/CMakeLists.txt | Drop Boost include dirs from time module. |
| modules/text_completion/CMakeLists.txt | Remove Boost include dirs. |
| modules/tests_manager/CMakeLists.txt | Remove Boost include dirs. |
| modules/string/CMakeLists.txt | Remove Boost include dirs. |
| modules/stream_manager/src/include/File.hpp | Remove stale comment about Boost endian. |
| modules/stream_manager/src/cpp/dllMain.cpp | Remove Boost helper include and pragma link for boost_iostreams. |
| modules/stream_manager/CMakeLists.txt | Remove Boost includes and link to ${Boost_LIBRARIES}. |
| modules/statistics/CMakeLists.txt | Remove Boost include dirs. |
| modules/special_functions/src/cpp/GCD.cpp | Replace Boost gcd with std::gcd; add wrappers. |
| modules/special_functions/src/cpp/BetaIncomplete.cpp | Replace boost::math::ibeta with local implementation and std headers. |
| modules/special_functions/CMakeLists.txt | Remove Boost include dirs. |
| modules/sparse/CMakeLists.txt | Remove Boost include dirs. |
| modules/slicot/CMakeLists.txt | Remove Boost include dirs. |
| modules/single/CMakeLists.txt | Remove Boost include dirs. |
| modules/random/CMakeLists.txt | Remove Boost include dirs. |
| modules/qml_engine/CMakeLists.txt | Remove Boost include dirs. |
| modules/profiler/src/cpp/HtmlExporter.cpp | Replace Boost time with std::time and formatting. |
| modules/profiler/src/c/nlsProfiler.vcxproj | Remove Boost include path. |
| modules/profiler/CMakeLists.txt | Remove Boost include dirs. |
| modules/parallel/CMakeLists.txt | Remove Boost include dirs. |
| modules/os_functions/src/cpp/GetHostname.cpp | Replace Boost ASIO hostname with platform APIs. |
| modules/operators/CMakeLists.txt | Remove Boost include dirs. |
| modules/mpi/CMakeLists.txt | Remove Boost include dirs. |
| modules/modules_manager/src/cpp/GatewaysManager.cpp | Remove Boost DLL include. |
| modules/modules_manager/CMakeLists.txt | Remove Boost include dirs. |
| modules/mex/CMakeLists.txt | Remove Boost include dirs. |
| modules/memory_manager/CMakeLists.txt | Remove Boost include dirs. |
| modules/matio/CMakeLists.txt | Remove Boost include dirs. |
| modules/logical/CMakeLists.txt | Remove Boost include dirs. |
| modules/linear_algebra/CMakeLists.txt | Remove Boost include dirs. |
| modules/ipc/src/cpp/IpcReadyReceiverNamedMutex.cpp | Replace Boost named_mutex with Win32 mutex/POSIX semaphore. |
| modules/interpreter/src/include/Evaluator.hpp | Remove setCLI/getCLI declarations. |
| modules/interpreter/src/cpp/NelsonReadyNamedMutex.cpp | Replace Boost named_mutex with Win32 mutex/POSIX semaphore. |
| modules/interpreter/src/cpp/Evaluator.cpp | Remove Boost interprocess include; use OS PID APIs. |
| modules/interpreter/src/c/nlsInterpreter.vcxproj | Adjust includes (Boost path remains unchanged). |
| modules/interpreter/CMakeLists.txt | Remove Boost include dirs. |
| modules/integer/CMakeLists.txt | Remove Boost include dirs. |
| modules/history_manager/CMakeLists.txt | Remove Boost include dirs. |
| modules/help_tools/CMakeLists.txt | Remove Boost include dirs. |
| modules/help_browser/CMakeLists.txt | Remove Boost include dirs. |
| modules/hdf5/CMakeLists.txt | Remove Boost include dirs. |
| modules/handle/CMakeLists.txt | Remove Boost include dirs. |
| modules/gui/CMakeLists.txt | Remove Boost include dirs. |
| modules/graphics/CMakeLists.txt | Remove Boost include dirs. |
| modules/functions_manager/CMakeLists.txt | Remove Boost include dirs. |
| modules/function_handle/CMakeLists.txt | Remove Boost include dirs. |
| modules/files_folders_functions/CMakeLists.txt | Remove Boost include dirs. |
| modules/file_archiver/src/cpp/ZipHelpers.cpp | Remove Boost regex include. |
| modules/file_archiver/src/c/nlsFile_archiver.vcxproj | Remove Boost include path. |
| modules/file_archiver/CMakeLists.txt | Remove Boost include dirs. |
| modules/engine/src/cpp/StartNelson.cpp | Remove Boost interprocess include; use OS PID APIs. |
| modules/engine/src/cpp/NelsonNamedMutex.cpp | Replace Boost named_mutex with Win32/POSIX primitives. |
| modules/engine/src/c/nlsEngine.vcxproj | Remove Boost include path. |
| modules/engine/CMakeLists.txt | Remove Boost include dirs. |
| modules/elementary_functions/src/cpp/SwapBytes.cpp | Replace Boost endian with local byte-swap helpers. |
| modules/elementary_functions/src/c/nlsElementary_functions.vcxproj | Remove Boost include path. |
| modules/elementary_functions/CMakeLists.txt | Remove Boost include dirs. |
| modules/double/CMakeLists.txt | Remove Boost include dirs. |
| modules/display_format/CMakeLists.txt | Remove Boost include dirs. |
| modules/core/CMakeLists.txt | Remove Boost include dirs. |
| modules/constructors_functions/CMakeLists.txt | Remove Boost include dirs. |
| modules/console/CMakeLists.txt | Remove Boost include dirs. |
| modules/commons/src/cpp/FileSystemWrapper.cpp | Replace Boost filesystem time conversion with std::filesystem-based conversion. |
| modules/audio/CMakeLists.txt | Remove Boost include dirs. |
| CHANGELOG.md | Document Boost dependency removals. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| #else | ||
| #include <unistd.h> | ||
| #include <limits.h> | ||
| #include <sys/types.h> |
There was a problem hiding this comment.
std::vector is used but is not included on non-Windows builds; this will fail to compile. Add #include near the other standard headers.
| #include <sys/types.h> | |
| #include <sys/types.h> | |
| #include <vector> |
| len = 256; | ||
| #endif | ||
| } | ||
| std::vector<char> buf(len); |
There was a problem hiding this comment.
std::vector is used but is not included on non-Windows builds; this will fail to compile. Add #include near the other standard headers.
| wchar_t buf[MAX_COMPUTERNAME_LENGTH + 1]; | ||
| DWORD size = (DWORD)std::size(buf); |
There was a problem hiding this comment.
std::size for raw arrays requires in C++17; it's not included here and may cause build failures. Simpler and clearer: initialize size with MAX_COMPUTERNAME_LENGTH + 1 and avoid std::size.
| long long yy = 0; | ||
| unsigned mm = 0; | ||
| unsigned dd = 0; | ||
| // Note: we use UTC date because C++17 std::chrono has no built-in timezone database. | ||
| current_utc_ymd(yy, mm, dd); | ||
| y = static_cast<uint64>(yy); | ||
| m = static_cast<uint8>(mm); |
There was a problem hiding this comment.
[nitpick] The previous implementation used local time; switching to UTC changes Calendar's default month/year in locales west/east of UTC around midnight. To preserve prior behavior, derive y/m from local time (e.g., using std::time + localtime_r/s).
57a9f06 to
e574860
Compare
e574860 to
dc39249
Compare
dc39249 to
d3cb5c6
Compare
…ty and improve portability
d3cb5c6 to
fad922d
Compare
No description provided.