Fix compile failed with llvm16 (#26112)

Signed-off-by: Enwei Jiao <enwei.jiao@zilliz.com>
This commit is contained in:
Enwei Jiao 2023-08-03 17:29:07 +08:00 committed by GitHub
parent 518b6310a2
commit f97d5a7d08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 11 deletions

View File

@ -5,7 +5,7 @@ class MilvusConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = (
"rocksdb/6.29.5",
"boost/1.79.0",
"boost/1.82.0",
"onetbb/2021.7.0",
"nlohmann_json/3.11.2",
"zstd/1.5.4",
@ -81,13 +81,6 @@ class MilvusConan(ConanFile):
del self.options["folly"].use_sse4_2
self.options["arrow"].with_jemalloc = False
self.options["boost"].without_fiber = True
self.options["boost"].without_json = True
self.options["boost"].without_wave = True
self.options["boost"].without_math = True
self.options["boost"].without_graph = True
self.options["boost"].without_graph_parallel = True
self.options["boost"].without_nowide = True
def imports(self):
self.copy("*.dylib", "../lib", "lib")

View File

@ -23,6 +23,7 @@
#include <boost/align/aligned_allocator.hpp>
#include <boost/container/vector.hpp>
#include <boost/dynamic_bitset.hpp>
#include <folly/FBVector.h>
#include <limits>
#include <memory>
@ -123,7 +124,8 @@ using BitsetTypePtr = std::shared_ptr<boost::dynamic_bitset<>>;
using BitsetTypeOpt = std::optional<BitsetType>;
template <typename Type>
using FixedVector = boost::container::vector<Type>;
using FixedVector = folly::fbvector<
Type>; // boost::container::vector has memory leak when version > 1.79, so use folly::fbvector instead
using Config = nlohmann::json;
using TargetBitmap = FixedVector<bool>;

View File

@ -47,13 +47,13 @@ case "${unameOut}" in
export RPATH=$LD_LIBRARY_PATH;;
Darwin*)
# detect llvm version by valid list
for llvm_version in 15 14 NOT_FOUND ; do
for llvm_version in 16 15 14 NOT_FOUND ; do
if brew ls --versions llvm@${llvm_version} > /dev/null; then
break
fi
done
if [ "${llvm_version}" = "NOT_FOUND" ] ; then
echo "valid llvm(14 or 15) not installed"
echo "valid llvm(>=14) not installed"
exit 1
fi
llvm_prefix="$(brew --prefix llvm@${llvm_version})"