Skip to content

[8.18][ML] Windows 2016 boost 1.86 (#2780) #2791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rd_party/3rd_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ else()
# server is currently set up
set(BOOST_LOCATION "${LOCAL_DRIVE}/usr/local/lib")
set(BOOST_COMPILER "vc")
set(BOOST_EXTENSION "mt-x64-1_83.dll")
set(BOOST_EXTENSION "mt-x64-1_86.dll")
set(BOOST_LIBRARIES "atomic" "chrono" "date_time" "filesystem" "iostreams" "log" "log_setup" "program_options" "regex" "system" "thread" "unit_test_framework")
set(XML_LOCATION "${LOCAL_DRIVE}/usr/local/bin")
set(XML_EXTENSION ".dll")
Expand Down
2 changes: 1 addition & 1 deletion 3rd_party/licenses/boost-INFO.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name,version,revision,url,license,copyright,sourceURL
Boost C++ Libraries,1.83.0,,http://www.boost.org,BSL-1.0,,
Boost C++ Libraries,1.86.0,,http://www.boost.org,BSL-1.0,,
14 changes: 7 additions & 7 deletions build-setup/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,33 @@ nmake
nmake install
```

### Boost 1.83.0
### Boost 1.86.0

Download version 1.83.0 of Boost from <https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2> . You must get this exact version, as the Machine Learning build system requires it.
Download version 1.86.0 of Boost from <https://boostorg.jfrog.io/artifactory/main/release/1.86.0/source/boost_1_86_0.tar.bz2> . You must get this exact version, as the Machine Learning build system requires it.

Assuming you chose the `.bz2` version, extract it in a Git bash shell using the GNU tar that comes with Git for Windows, e.g.:

```
cd /c/tools
tar jxvf /z/cpp_src/boost_1_83_0.tar.bz2
tar jxvf /z/cpp_src/boost_1_86_0.tar.bz2
```

Edit `boost/unordered/detail/prime_fmod.hpp` and change line 134 from:
Edit `boost/unordered/detail/prime_fmod.hpp` and change line 37 from:

```
(13ul)(29ul)(53ul)(97ul)(193ul)(389ul)(769ul)(1543ul)(3079ul)(6151ul)( \
constexpr static std::size_t const sizes[] = {13ul, 29ul, 53ul, 97ul,
```

to:

```
(3ul)(13ul)(29ul)(53ul)(97ul)(193ul)(389ul)(769ul)(1543ul)(3079ul)(6151ul)( \
constexpr static std::size_t const sizes[] = {3ul, 13ul, 29ul, 53ul, 97ul,
```

Start a command prompt using Start Menu -&gt; Apps -&gt; Visual Studio 2019 -&gt; x64 Native Tools Command Prompt for VS 2019, then in it type:

```
cd \tools\boost_1_83_0
cd \tools\boost_1_86_0
bootstrap.bat
b2 -j6 --layout=versioned --disable-icu --toolset=msvc-14.2 cxxflags="-std:c++17" linkflags="-std:c++17" --build-type=complete -sZLIB_INCLUDE="C:\tools\zlib-1.2.13" -sZLIB_LIBPATH="C:\tools\zlib-1.2.13" -sZLIB_NAME=zdll --without-context --without-coroutine --without-graph_parallel --without-mpi --without-python architecture=x86 address-model=64 optimization=speed inlining=full define=BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS define=BOOST_LOG_WITHOUT_DEBUG_OUTPUT define=BOOST_LOG_WITHOUT_EVENT_LOG define=BOOST_LOG_WITHOUT_SYSLOG define=BOOST_LOG_WITHOUT_IPC define=_WIN32_WINNT=0x0601
b2 install --prefix=C:\usr\local --layout=versioned --disable-icu --toolset=msvc-14.2 cxxflags="-std:c++17" linkflags="-std:c++17" --build-type=complete -sZLIB_INCLUDE="C:\tools\zlib-1.2.13" -sZLIB_LIBPATH="C:\tools\zlib-1.2.13" -sZLIB_NAME=zdll --without-context --without-coroutine --without-graph_parallel --without-mpi --without-python architecture=x86 address-model=64 optimization=speed inlining=full define=BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS define=BOOST_LOG_WITHOUT_DEBUG_OUTPUT define=BOOST_LOG_WITHOUT_EVENT_LOG define=BOOST_LOG_WITHOUT_SYSLOG define=BOOST_LOG_WITHOUT_IPC define=_WIN32_WINNT=0x0601
Expand Down
7 changes: 6 additions & 1 deletion cmake/variables.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_DEBUG_RUNTIME OFF)
set(Boost_COMPILER "${ML_BOOST_COMPILER_VER}")

find_package(Boost 1.83.0 EXACT REQUIRED COMPONENTS iostreams filesystem program_options regex date_time log log_setup thread unit_test_framework)
set(Boost_VERSION 1.83.0)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
message(WARNING "Using Boost 1.86.0 on Windows only.")
set(Boost_VERSION 1.86.0)
endif()
find_package(Boost ${Boost_VERSION} EXACT REQUIRED COMPONENTS iostreams filesystem program_options regex date_time log log_setup thread unit_test_framework)
if(Boost_FOUND)
list(APPEND ML_SYSTEM_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
endif()
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
=== Enhancements

* Update the PyTorch library to version 2.5.0. (See {ml-pull}2783[#2783].)
* Upgrade Boost libraries to version 1.86. (See {ml-pull}2780[#2780].)

== {es} version 8.16.0

Expand Down
12 changes: 6 additions & 6 deletions lib/core/unittest/CMemoryUsageTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1287,12 +1287,12 @@ BOOST_AUTO_TEST_CASE(testSmallVector) {
BOOST_REQUIRE_EQUAL(0, extraMem);
growShrink.push_back(1.7);
extraMem = core::memory::dynamicSize(growShrink);
// Interesting (shocking?) result: once a boost::small_vector has switched
// off of internal storage it will NEVER go back to internal storage.
// Arguably this is a bug, and this assertion might start failing after a
// Boost upgrade. If that happens and changing it to assert extraMem is 0
// fixes it then this means boost::small_vector has been improved.
BOOST_TEST_REQUIRE(extraMem > 0);
// Interestingly we used to assert extraMem > 0 here as it used to be the case
// that once a boost::small_vector had switched
// off of internal storage it would NEVER go back to internal storage.
// Arguably that was a bug, and this assertion started failing after
// upgrading Boost to 1.86.0, meaning that boost::small_vector has been improved.
BOOST_TEST_REQUIRE(extraMem >= 0); // Change this to "==" when all platforms have been upgraded to Boost 1.86.0
}

BOOST_AUTO_TEST_CASE(testAlignedVector) {
Expand Down
2 changes: 2 additions & 0 deletions lib/model/CBucketGatherer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <model/CDataGatherer.h>

#include <boost/tuple/tuple.hpp>

#include <algorithm>
#include <map>

Expand Down