mirror of https://github.com/milvus-io/milvus.git
improvement for macos build script (#23082)
Signed-off-by: Ji Bin <matrixji@live.com>pull/22942/head
parent
b1992e84cc
commit
0d0dc95f9d
|
@ -193,13 +193,25 @@ conan remote add default-conan-local https://milvus01.jfrog.io/artifactory/api/c
|
|||
unameOut="$(uname -s)"
|
||||
case "${unameOut}" in
|
||||
Darwin*)
|
||||
llvm_prefix="$(brew --prefix llvm)"
|
||||
# detect llvm version by valid list
|
||||
for llvm_version in 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"
|
||||
exit 1
|
||||
fi
|
||||
llvm_prefix="$(brew --prefix llvm@${llvm_version})"
|
||||
export CLANG_TOOLS_PATH="${llvm_prefix}/bin"
|
||||
export CC="${llvm_prefix}/bin/clang"
|
||||
export CXX="${llvm_prefix}/bin/clang++"
|
||||
export CFLAGS=-Wno-deprecated-declarations
|
||||
export CXXFLAGS=-Wno-deprecated-declarations
|
||||
conan install ${CPP_SRC_DIR} --install-folder conan --build=missing -s compiler=clang -s compiler.version=15 -s compiler.libcxx=libc++ -s compiler.cppstd=17 || { echo 'conan install failed'; exit 1; }
|
||||
export CFLAGS="-Wno-deprecated-declarations -I$(brew --prefix libomp)/include"
|
||||
export CXXFLAGS=${CFLAGS}
|
||||
export LDFLAGS="-L$(brew --prefix libomp)/lib"
|
||||
|
||||
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; }
|
||||
;;
|
||||
Linux*)
|
||||
echo "Running on ${OS_NAME}"
|
||||
|
|
|
@ -50,7 +50,7 @@ function install_linux_deps() {
|
|||
|
||||
function install_mac_deps() {
|
||||
sudo xcode-select --install > /dev/null 2>&1
|
||||
brew install libomp ninja cmake llvm ccache grep
|
||||
brew install libomp ninja cmake llvm@15 ccache grep
|
||||
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
|
||||
brew update && brew upgrade && brew cleanup
|
||||
|
||||
|
@ -60,14 +60,6 @@ function install_mac_deps() {
|
|||
brew install openssl
|
||||
brew install librdkafka
|
||||
brew install pkg-config
|
||||
sudo mkdir /usr/local/include
|
||||
sudo mkdir /usr/local/opt
|
||||
sudo ln -s "$(brew --prefix llvm)" "/usr/local/opt/llvm"
|
||||
sudo ln -s "$(brew --prefix libomp)/include/omp.h" "/usr/local/include/omp.h"
|
||||
sudo ln -s "$(brew --prefix libomp)" "/usr/local/opt/libomp"
|
||||
sudo ln -s "$(brew --prefix boost)/include/boost" "/usr/local/include/boost"
|
||||
sudo ln -s "$(brew --prefix tbb)/include/tbb" "/usr/local/include/tbb"
|
||||
sudo ln -s "$(brew --prefix tbb)/include/oneapi" "/usr/local/include/oneapi"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue