Skip to content

Commit f97d5a7

Browse files
authored
Fix compile failed with llvm16 (milvus-io#26112)
Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
1 parent 518b631 commit f97d5a7

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

internal/core/conanfile.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class MilvusConan(ConanFile):
55
settings = "os", "compiler", "build_type", "arch"
66
requires = (
77
"rocksdb/6.29.5",
8-
"boost/1.79.0",
8+
"boost/1.82.0",
99
"onetbb/2021.7.0",
1010
"nlohmann_json/3.11.2",
1111
"zstd/1.5.4",
@@ -81,13 +81,6 @@ def configure(self):
8181
del self.options["folly"].use_sse4_2
8282

8383
self.options["arrow"].with_jemalloc = False
84-
self.options["boost"].without_fiber = True
85-
self.options["boost"].without_json = True
86-
self.options["boost"].without_wave = True
87-
self.options["boost"].without_math = True
88-
self.options["boost"].without_graph = True
89-
self.options["boost"].without_graph_parallel = True
90-
self.options["boost"].without_nowide = True
9184

9285
def imports(self):
9386
self.copy("*.dylib", "../lib", "lib")

internal/core/src/common/Types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <boost/align/aligned_allocator.hpp>
2424
#include <boost/container/vector.hpp>
2525
#include <boost/dynamic_bitset.hpp>
26+
#include <folly/FBVector.h>
2627

2728
#include <limits>
2829
#include <memory>
@@ -123,7 +124,8 @@ using BitsetTypePtr = std::shared_ptr<boost::dynamic_bitset<>>;
123124
using BitsetTypeOpt = std::optional<BitsetType>;
124125

125126
template <typename Type>
126-
using FixedVector = boost::container::vector<Type>;
127+
using FixedVector = folly::fbvector<
128+
Type>; // boost::container::vector has memory leak when version > 1.79, so use folly::fbvector instead
127129

128130
using Config = nlohmann::json;
129131
using TargetBitmap = FixedVector<bool>;

scripts/setenv.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ case "${unameOut}" in
4747
export RPATH=$LD_LIBRARY_PATH;;
4848
Darwin*)
4949
# detect llvm version by valid list
50-
for llvm_version in 15 14 NOT_FOUND ; do
50+
for llvm_version in 16 15 14 NOT_FOUND ; do
5151
if brew ls --versions llvm@${llvm_version} > /dev/null; then
5252
break
5353
fi
5454
done
5555
if [ "${llvm_version}" = "NOT_FOUND" ] ; then
56-
echo "valid llvm(14 or 15) not installed"
56+
echo "valid llvm(>=14) not installed"
5757
exit 1
5858
fi
5959
llvm_prefix="$(brew --prefix llvm@${llvm_version})"

0 commit comments

Comments
 (0)