Skip to content

Commit

Permalink
milvus-io#34217 Modify codebase for conan2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SID262000 committed Jun 28, 2024
1 parent 00e5a40 commit bd46cb1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 42 deletions.
6 changes: 3 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Linux systems (Recommend Ubuntu 20.04 or later):
go: >= 1.21
cmake: >= 3.18
gcc: 7.5
conan: 1.61
conan: >= 2.4.1
```

MacOS systems with x86_64 (Big Sur 11.5 or later recommended):
Expand All @@ -116,7 +116,7 @@ MacOS systems with x86_64 (Big Sur 11.5 or later recommended):
go: >= 1.21
cmake: >= 3.18
llvm: >= 15
conan: 1.61
conan: >= 2.4.1
```

MacOS systems with Apple Silicon (Monterey 12.0.1 or later recommended):
Expand All @@ -125,7 +125,7 @@ MacOS systems with Apple Silicon (Monterey 12.0.1 or later recommended):
go: >= 1.21 (Arch=ARM64)
cmake: >= 3.18
llvm: >= 15
conan: 1.61
conan: >= 2.4.1
```

#### Installing Dependencies
Expand Down
66 changes: 32 additions & 34 deletions internal/core/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from conans import ConanFile
from conan import ConanFile


class MilvusConan(ConanFile):
keep_imports = True
settings = "os", "compiler", "build_type", "arch"
requires = (
"rocksdb/6.29.5@milvus/dev",
"boost/1.82.0",
"boost/1.84.0",
"onetbb/2021.9.0",
"nlohmann_json/3.11.2",
"zstd/1.5.4",
Expand Down Expand Up @@ -46,41 +46,39 @@ class MilvusConan(ConanFile):
)
generators = ("cmake", "cmake_find_package")
default_options = {
"libevent:shared": True,
"double-conversion:shared": True,
"folly:shared": True,
"librdkafka:shared": True,
"librdkafka:zstd": True,
"librdkafka:ssl": True,
"librdkafka:sasl": True,
"rocksdb:shared": True,
"rocksdb:with_zstd": True,
"arrow:filesystem_layer": True,
"arrow:parquet": True,
"arrow:compute": True,
"arrow:with_re2": True,
"arrow:with_zstd": True,
"arrow:with_boost": True,
"arrow:with_thrift": True,
"arrow:with_jemalloc": True,
"arrow:shared": False,
"arrow:with_s3": True,
"aws-sdk-cpp:config": True,
"aws-sdk-cpp:text-to-speech": False,
"aws-sdk-cpp:transfer": False,
"gtest:build_gmock": False,
"boost:without_locale": False,
"glog:with_gflags": True,
"glog:shared": True,
"prometheus-cpp:with_pull": False,
"fmt:header_only": True,
"onetbb:tbbmalloc": False,
"onetbb:tbbproxy": False,
"libevent/*:shared": True,
"double-conversion/*:shared": True,
"folly/*:shared": True,
"librdkafka/*:shared": True,
"librdkafka/*:zstd": True,
"librdkafka/*:ssl": True,
"librdkafka/*:sasl": True,
"rocksdb/*:shared": True,
"rocksdb/*:with_zstd": True,
"arrow/*:filesystem_layer": True,
"arrow/*:parquet": True,
"arrow/*:compute": True,
"arrow/*:with_re2": True,
"arrow/*:with_zstd": True,
"arrow/*:with_boost": True,
"arrow/*:with_thrift": True,
"arrow/*:with_jemalloc": True,
"arrow/*:shared": False,
"arrow/*:with_s3": True,
"aws-sdk-cpp/*:config": True,
"aws-sdk-cpp/*:text-to-speech": False,
"aws-sdk-cpp/*:transfer": False,
"gtest/*:build_gmock": False,
"boost/*:without_locale": False,
"glog/*:with_gflags": True,
"glog/*:shared": True,
"prometheus-cpp/*:with_pull": False,
"fmt/*:header_only": True,
"onetbb/*:tbbmalloc": False,
"onetbb/*:tbbproxy": False,
}

def configure(self):
if self.settings.arch not in ("x86_64", "x86"):
del self.options["folly"].use_sse4_2
if self.settings.os == "Macos":
# By default abseil use static link but can not be compatible with macos X86
self.options["abseil"].shared = True
Expand Down
6 changes: 3 additions & 3 deletions scripts/3rdparty_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ fi
unameOut="$(uname -s)"
case "${unameOut}" in
Darwin*)
conan install ${CPP_SRC_DIR} --install-folder conan --build=missing -s compiler=clang -s compiler.version=${llvm_version} -s compiler.libcxx=libc++ -s compiler.cppstd=17 || { echo 'conan install failed'; exit 1; }
conan install ${CPP_SRC_DIR} --deployer-folder conan --build=missing -s compiler=clang -s compiler.version=${llvm_version} -s compiler.libcxx=libc++ -s compiler.cppstd=17 || { echo 'conan install failed'; exit 1; }
;;
Linux*)
echo "Running on ${OS_NAME}"
export CPU_TARGET=avx
GCC_VERSION=`gcc -dumpversion`
if [[ `gcc -v 2>&1 | sed -n 's/.*\(--with-default-libstdcxx-abi\)=\(\w*\).*/\2/p'` == "gcc4" ]]; then
conan install ${CPP_SRC_DIR} --install-folder conan --build=missing -s compiler.version=${GCC_VERSION} || { echo 'conan install failed'; exit 1; }
conan install ${CPP_SRC_DIR} --deployer-folder conan --build=missing -s compiler.version=${GCC_VERSION} || { echo 'conan install failed'; exit 1; }
else
conan install ${CPP_SRC_DIR} --install-folder conan --build=missing -s compiler.version=${GCC_VERSION} -s compiler.libcxx=libstdc++11 || { echo 'conan install failed'; exit 1; }
conan install ${CPP_SRC_DIR} --deployer-folder conan --build=missing -s compiler.version=${GCC_VERSION} -s compiler.libcxx=libstdc++11 || { echo 'conan install failed'; exit 1; }
fi
;;
*)
Expand Down
4 changes: 2 additions & 2 deletions scripts/collect_arrow_dep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ echo ${ARROWBIN_DIR}
pushd ${ARROWBIN_DIR}
targetNames=(
"jemalloc-5.2.1.tar.bz2"
"thrift-0.13.0.tar.gz"
"thrift-0.20.0.tar.gz"
"utf8proc-v2.7.0.tar.gz"
"xsimd-7d1778c3b38d63db7cec7145d939f40bc5d859d1.tar.gz"
"zstd-v1.5.1.tar.gz"
)

srcNames=(
"jemalloc_ep-prefix/src/jemalloc-5.2.1.tar.bz2"
"thrift_ep-prefix/src/thrift-0.13.0.tar.gz"
"thrift_ep-prefix/src/thrift-0.20.0.tar.gz"
"utf8proc_ep-prefix/src/v2.7.0.tar.gz"
"src/7d1778c3b38d63db7cec7145d939f40bc5d859d1.tar.gz"
"zstd_ep-prefix/src/v1.5.1.tar.gz"
Expand Down

0 comments on commit bd46cb1

Please sign in to comment.