homebrew – ln: /usr/bin/clang: Operation not permitted


I am trying to build the Apache Doris follow the document https://doris.apache.org/docs/install/source-install/compilation-mac/ in macOS 13.3.1 terminal like this(I have already tried to reopen the terminal to make the clang env work):

./build.sh

the part of log shows error like this:

Compiling as RELEASE
-- old Boost_INCLUDE_DIR    : /Users/xiaoqiangjiang/source/third-party/doris/thirdparty/installed/include
-- Found Boost: /Users/xiaoqiangjiang/source/third-party/doris/thirdparty/installed/lib64/cmake/Boost-1.81.0/BoostConfig.cmake (found version "1.81.0")
Boost found
-- Boost_INCLUDE_DIR    : /Users/xiaoqiangjiang/source/third-party/doris/thirdparty/installed/include
-- Looking for MapViewOfFile
-- Looking for MapViewOfFile(0,0,0,0,0) - not found
-- Looking for _close
-- Looking for _close((int)0) - not found
-- Looking for _read
-- Looking for _read((int)0, (void*)0, (unsigned int)0) - not found
-- Looking for _open
-- Looking for _open(0,0,0) - not found
-- Looking for _write
-- Looking for _write((int)0, (const void*)0, (unsigned int)0) - not found
-- Looking for _unlink
-- Looking for _unlink((const char*)0) - not found
-- Looking for _ftime
-- Looking for _ftime(0) - not found
-- Looking for _mkdir
-- Looking for _mkdir((const char*)0) - not found
-- Checking support new float byte<->float conversions
-- Checking support new float byte<->float conversions - yes
CMake Error at CMakeLists.txt:268 (message):
  Need Clang version at least 16

I have installed the new version of clang with homebrew, this is the new clang:

> clang --version
Homebrew clang version 18.1.7
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin

but the /usr/bin/clang still use the legacy version:

> /usr/bin/clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

now I want to change the clang to specify to the new version of clang like this:

> sudo ln -sf /opt/homebrew/opt/llvm/bin/clang /usr/bin/clang
ln: /usr/bin/clang: Operation not permitted

Am I missing something? is it possible to replace the system clang in macOS 13.3.1? This is the path in .zshrc:

export PATH="/opt/homebrew/opt/llvm/bin:$PATH"

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img