diff --git a/internal/core/thirdparty/CMakeLists.txt b/internal/core/thirdparty/CMakeLists.txt index 55750f3710..f8750894e1 100644 --- a/internal/core/thirdparty/CMakeLists.txt +++ b/internal/core/thirdparty/CMakeLists.txt @@ -70,7 +70,7 @@ if ( LINUX AND BUILD_DISK_ANN STREQUAL "ON" ) endif() # ******************************* Thirdparty google cloud sdk ******************************** -if ( LINUX AND BUILD_DISK_ANN STREQUAL "ON" ) +if ( LINUX OR APPLE ) add_subdirectory( google_cloud_sdk ) endif() diff --git a/internal/core/thirdparty/google_cloud_sdk/CMakeLists.txt b/internal/core/thirdparty/google_cloud_sdk/CMakeLists.txt index bfcdd8ead7..f7675845f6 100644 --- a/internal/core/thirdparty/google_cloud_sdk/CMakeLists.txt +++ b/internal/core/thirdparty/google_cloud_sdk/CMakeLists.txt @@ -23,7 +23,9 @@ macro(build_google_sdk_s3) set(GOOGLE_ABSEIL_BUILD_COMMAND make -j $(nproc)) set(GOOGLE_ABSEIL_INSTALL_COMMAND make install) - set(GOOGLE_PATCH_COMMAND sed -i "s/^#define ABSL_OPTION_USE_\\(.*\\) 2/#define ABSL_OPTION_USE_\\1 0/" "absl/base/options.h") + if (LINUX) + set(GOOGLE_PATCH_COMMAND sed -i "s/^#define ABSL_OPTION_USE_\\(.*\\) 2/#define ABSL_OPTION_USE_\\1 0/" "absl/base/options.h") + endif() set(GOOGLE_ABSEIL_CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}" @@ -92,15 +94,33 @@ macro(build_google_sdk_s3) set(GOOGLE_SDK_BUILD_COMMAND make) set(GOOGLE_SDK_INSTALL_COMMAND make install) - set(GOOGLE_SDK_CMAKE_ARGS - "-DCMAKE_BUILD_TYPE=Release" - "-DBUILD_DEPS=OFF" - "-DBUILD_TESTING=OFF" - "-DBUILD_SHARED_LIBS=ON" - "-DGOOGLE_CLOUD_CPP_ENABLE=storage" - "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF" - "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + if (APPLE) + if(EXISTS "/usr/local/opt/openssl") + set(OPENSSL_DIR "/usr/local/opt/openssl") + else() + set(OPENSSL_DIR "/opt/homebrew/opt/openssl") + endif() + set(GOOGLE_SDK_CMAKE_ARGS + "-DCMAKE_BUILD_TYPE=Release" + "-DBUILD_DEPS=OFF" + "-DBUILD_TESTING=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DGOOGLE_CLOUD_CPP_ENABLE=storage" + "-DOPENSSL_ROOT_DIR=${OPENSSL_DIR}" + "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF" + "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + else() + set(GOOGLE_SDK_CMAKE_ARGS + "-DCMAKE_BUILD_TYPE=Release" + "-DBUILD_DEPS=OFF" + "-DBUILD_TESTING=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DGOOGLE_CLOUD_CPP_ENABLE=storage" + "-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF" + "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}") + endif() + message(STATUS "GOOGLE_SDK_CMAKE_ARGS: ${GOOGLE_SDK_CMAKE_ARGS}") ExternalProject_Add(google_sdk_ep GIT_REPOSITORY https://github.com/googleapis/google-cloud-cpp.git GIT_TAG ${GOOGLE_SDK_VERSION} diff --git a/scripts/start_cluster.sh b/scripts/start_cluster.sh index 042dc8f2e7..942a8dbbc7 100755 --- a/scripts/start_cluster.sh +++ b/scripts/start_cluster.sh @@ -26,6 +26,8 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then fi fi +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/internal/core/output/lib/ + echo "Starting rootcoord..." nohup ./bin/milvus run rootcoord > /tmp/rootcoord.log 2>&1 & diff --git a/scripts/start_standalone.sh b/scripts/start_standalone.sh index 31732ba0d3..2ed5b0e30e 100755 --- a/scripts/start_standalone.sh +++ b/scripts/start_standalone.sh @@ -26,5 +26,6 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then fi fi +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/internal/core/output/lib/ echo "Starting standalone..." nohup ./bin/milvus run standalone > /tmp/standalone.log 2>&1 &