Skip to content

chore: Removed several dependencies on Boost to reduce build complexity and improve portability - #1467

Merged
Nelson-numerical-software merged 1 commit into
masterfrom
chore-relaxing-boost-dependency
Oct 19, 2025
Merged

Nelson-numerical-software merged 1 commit into
masterfrom
chore-relaxing-boost-dependency

Conversation

@Nelson-numerical-software

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread modules/special_functions/src/cpp/GCD.cpp
Comment thread modules/os_functions/src/cpp/GetHostname.cpp
#else
#include <unistd.h>
#include <limits.h>
#include <sys/types.h>

Copilot AI Oct 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::vector is used but is not included on non-Windows builds; this will fail to compile. Add #include near the other standard headers.

Suggested change
#include <sys/types.h>
#include <sys/types.h>
#include <vector>

Copilot uses AI. Check for mistakes.
len = 256;
#endif
}
std::vector<char> buf(len);

Copilot AI Oct 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::vector is used but is not included on non-Windows builds; this will fail to compile. Add #include near the other standard headers.

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +30
wchar_t buf[MAX_COMPUTERNAME_LENGTH + 1];
DWORD size = (DWORD)std::size(buf);

Copilot AI Oct 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +120
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);

Copilot AI Oct 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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).

Copilot uses AI. Check for mistakes.
@Nelson-numerical-software
Nelson-numerical-software force-pushed the chore-relaxing-boost-dependency branch 3 times, most recently from 57a9f06 to e574860 Compare October 18, 2025 20:09
Comment thread modules/dynamic_link/src/cpp/DynamicLinkLibraryObject.cpp Dismissed
@Nelson-numerical-software
Nelson-numerical-software force-pushed the chore-relaxing-boost-dependency branch from e574860 to dc39249 Compare October 19, 2025 07:55
Comment thread modules/os_functions/src/cpp/SystemCommandTask.cpp Dismissed
Comment thread modules/os_functions/src/cpp/SystemCommandTask.cpp Fixed
@Nelson-numerical-software
Nelson-numerical-software force-pushed the chore-relaxing-boost-dependency branch from dc39249 to d3cb5c6 Compare October 19, 2025 10:40
Comment thread modules/os_functions/src/cpp/SystemCommandTask.cpp Dismissed
@Nelson-numerical-software
Nelson-numerical-software force-pushed the chore-relaxing-boost-dependency branch from d3cb5c6 to fad922d Compare October 19, 2025 14:20
@Nelson-numerical-software
Nelson-numerical-software merged commit de58a66 into master Oct 19, 2025
@Nelson-numerical-software
Nelson-numerical-software deleted the chore-relaxing-boost-dependency branch October 19, 2025 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants