Skip to content

Commit

Permalink
Remove deprecated conan generator
Browse files Browse the repository at this point in the history
Signed-off-by: Enwei Jiao <[email protected]>
  • Loading branch information
jiaoew1991 committed Nov 2, 2023
1 parent e3e9258 commit ff7096c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ find_package(nlohmann_json REQUIRED)
find_package(glog REQUIRED)
find_package(prometheus-cpp REQUIRED)
find_package(fmt REQUIRED)
include_directories(${fmt_INCLUDE_DIR})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version" FORCE)

Expand Down Expand Up @@ -130,6 +129,7 @@ list(APPEND KNOWHERE_LINKER_LIBS faiss)
list(APPEND KNOWHERE_LINKER_LIBS glog::glog)
list(APPEND KNOWHERE_LINKER_LIBS nlohmann_json::nlohmann_json)
list(APPEND KNOWHERE_LINKER_LIBS prometheus-cpp::core prometheus-cpp::push)
list(APPEND KNOWHERE_LINKER_LIBS fmt::fmt-header-only)
list(APPEND KNOWHERE_LINKER_LIBS ${FOLLY_LIBRARIES})

add_library(knowhere SHARED ${KNOWHERE_SRCS})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here's a list of verified OS types where Knowhere can successfully build and run

```bash
$ sudo apt install build-essential libopenblas-dev libaio-dev python3-dev python3-pip
$ pip3 install conan==1.59.0 --user
$ pip3 install conan==1.61.0 --user
$ export PATH=$PATH:$HOME/.local/bin
```

Expand Down
2 changes: 1 addition & 1 deletion ci/E2E2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
version="${env.CHANGE_ID}.${date}.${gitShortCommit}"
sh "apt-get update || true"
sh "apt-get install libaio-dev libopenblas-dev libcurl4-openssl-dev libdouble-conversion-dev libevent-dev libgflags-dev git -y"
sh "pip3 install conan==1.58.0"
sh "pip3 install conan==1.61.0"
sh "conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local"
sh "rm -rf /usr/local/lib/cmake/"
sh "mkdir build"
Expand Down
2 changes: 1 addition & 1 deletion ci/E2E_GPU.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pipeline {
sh "apt-get install build-essential libopenblas-dev libcurl4-openssl-dev libaio-dev libdouble-conversion-dev libevent-dev libgflags-dev git -y"
sh "git config --global --add safe.directory '*'"
sh "git submodule update --recursive --init"
sh "pip3 install conan==1.58.0"
sh "pip3 install conan==1.61.0"
sh "conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local"
sh "rm -rf /usr/local/lib/cmake/"
sh "mkdir build"
Expand Down
2 changes: 1 addition & 1 deletion ci/UT_GPU.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
version="${env.CHANGE_ID}.${date}.${gitShortCommit}"
sh "apt-get update || true"
sh "apt-get install libaio-dev libcurl4-openssl-dev libdouble-conversion-dev libevent-dev libgflags-dev git -y"
sh "pip3 install conan==1.58.0"
sh "pip3 install conan==1.61.0"
sh "conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local"
sh "rm -rf /usr/local/lib/cmake/"
sh "mkdir build"
Expand Down
1 change: 1 addition & 0 deletions cmake/libs/libdiskann.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ target_link_libraries(diskann PUBLIC ${AIO_LIBRARIES}
${DISKANN_BOOST_PROGRAM_OPTIONS_LIB}
nlohmann_json::nlohmann_json
Folly::folly
fmt::fmt-header-only
glog::glog)
if(__X86_64)
target_compile_options(
Expand Down
6 changes: 4 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ class KnowhereConan(ConanFile):
homepage = "https://github.com/milvus-io/knowhere"
license = "Apache-2.0"

generators = {"pkg_config","cmake_find_package"}

settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
Expand Down Expand Up @@ -157,9 +155,13 @@ def generate(self):
tc.variables["WITH_BENCHMARK"] = self.options.with_benchmark
tc.variables["WITH_COVERAGE"] = self.options.with_coverage
tc.generate()

deps = CMakeDeps(self)
deps.generate()

pc = PkgConfigDeps(self)
pc.generate()

def build(self):
# files.apply_conandata_patches(self)
cmake = CMake(self)
Expand Down
6 changes: 3 additions & 3 deletions scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [[ "${MACHINE}" == "Linux" ]]; then
#DiskANN dependencies
sudo apt-get install -y libboost-program-options-dev
sudo apt-get install -y libaio-dev
pip3 install conan==1.58.0
pip3 install conan==1.61.0
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
# Pre-installation of openblas can save about 15 minutes of openblas building time.
# But the apt-installed openblas version is 0.2.20, while the latest openblas version is 0.3.19.
Expand Down Expand Up @@ -95,14 +95,14 @@ if [[ "${MACHINE}" == "Linux" ]]; then
wget -c https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2-linux-x86_64.tar.gz && \
tar -zxvf cmake-3.22.2-linux-x86_64.tar.gz && \
sudo ln -sf $(pwd)/cmake-3.22.2-linux-x86_64/bin/cmake /usr/bin/cmake
pip3 install conan==1.58.0
pip3 install conan==1.61.0
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
fi
fi

if [[ "${MACHINE}" == "Mac" ]]; then
brew install libomp llvm ninja openblas
pip3 install conan==1.58.0
pip3 install conan==1.61.0
conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/conan/default-conan-local
fi

Expand Down
8 changes: 4 additions & 4 deletions scripts/python_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [[ "${MACHINE}" == "Linux" ]]; then
# for Ubuntu 18.04
release_num=$(lsb_release -r --short)
sudo apt install -y libcurl4-openssl-dev libaio libaio-devel libopenblas-dev
pip3 install conan==1.58.0
pip3 install conan==1.61.0
elif [[ -x "$(command -v yum)" ]]; then
yum install -y sudo
case $(uname -m) in
Expand All @@ -45,10 +45,10 @@ if [[ "${MACHINE}" == "Linux" ]]; then
x86_64) sudo yum install -y openblas-devel libaio libaio-devel ;;
arm) ;;
esac
pip3 install conan==1.58.0
pip3 install conan==1.61.0
elif [[ -x "$(command -v apk)" ]]; then
apk add openblas-dev libaio libaio-dev
pip3 install conan==1.58.0
pip3 install conan==1.61.0
fi
fi

Expand All @@ -63,7 +63,7 @@ if [[ "${MACHINE}" == "Mac" ]]; then
export CMAKE_PREFIX_PATH="/usr/local;${CMAKE_PREFIX_PATH}"
export CC="$(brew --prefix llvm)/bin/clang"
export CXX="$(brew --prefix llvm)/bin/clang++"
pip3 install conan==1.58.0
pip3 install conan==1.61.0
conan profile new default --detect --force
conan profile update settings.compiler=clang default
conan profile update settings.compiler.version=16 default
Expand Down

0 comments on commit ff7096c

Please sign in to comment.