infinity icon indicating copy to clipboard operation
infinity copied to clipboard

[Feature Request]: Make Infinity work under Mac

Open yingfeng opened this issue 1 year ago • 10 comments

Is there an existing issue for the same feature request?

  • [X] I have checked the existing issues.

Is your feature request related to a problem?

No response

Describe the feature you'd like

Both Intel and ARM would be supported under Mac OS

Describe implementation you've considered

No response

Documentation, adoption, use case

No response

Additional information

No response

yingfeng avatar Aug 26 '24 04:08 yingfeng

Build source from Mac

# Make sure clang-18 is installed
brew install llvm 

# .bash_profile
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
export CPPFLAGS = "-I/usr/local/opt/llvm/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/include"
export LDFLAGS = "-L/usr/local/opt/llvm/lib/c++ -L/usr/local/opt/llvm/lib -L/usr//local/Cellar/llvm/18.1.8/lib -lunwind -L/usr/local/lib"
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/llvm/lib/c++:/usr/local/opt/llvm/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib:/usr/local/lib:/usr//local/Cellar/gcc/14.1.0_2/lib/gcc/14"
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/local/include:/usr/local//Cellar/boost/1.86.0/include"
export DYLD_LIBRARY_PATH="/usr/local/opt/llvm/lib:$DYLD_LIBRARY_PATH"

yingfeng avatar Aug 26 '24 12:08 yingfeng

Help wanted. We need Mac apple sillicon to verify infinity

yingfeng avatar Aug 27 '24 11:08 yingfeng

Can the code on the main branch be compiled on the Mac Apple Silicon platform?

ballontt avatar Sep 05 '24 09:09 ballontt

Can the code on the main branch be compiled on the Mac Apple Silicon platform?

We do not have such a mackbook, so we could not tell the answer right now ...

yingfeng avatar Sep 05 '24 10:09 yingfeng

The code won't compile on my mac with m1 pro since the cpu does not support FMA and AVX instructions even with Rosetta on.

vsian avatar Sep 07 '24 09:09 vsian

To support AArch CPU, we have to implement vector distance computation functions with neon instructions of AArch64 in the directory of src/common/simd .

JinHai-CN avatar Sep 07 '24 11:09 JinHai-CN

Help wanted. We need Mac apple sillicon to verify infinity

By fixing the CMakeLists.txt and some header files, I was able to successfully compile the project on my M1 Mac (Apple OS). The unit tests passed, and ran a partial pytest.

After running all the tests, I can create a PR if needed.

ballontt avatar Sep 11 '24 03:09 ballontt

Help wanted. We need Mac apple sillicon to verify infinity

By fixing the CMakeLists.txt and some header files, I was able to successfully compile the project on my M1 Mac (Apple OS). The unit tests passed, and ran a partial pytest.

After running all the tests, I can create a PR if needed.

@ballontt
I've made infinity worked under Linux/aarch64, could you please verify it could work under Mac M1 ?

yingfeng avatar Oct 21 '24 12:10 yingfeng

export LDFLAGS = "-L/usr/local/opt/llvm/lib/c++ -L/usr/local/opt/llvm/lib -L/usr//local/Cellar/llvm/18.1.8/lib -lunwind -L/usr/local/lib"

export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/include"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind"
export LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/opt/llvm/lib/c++:/opt/homebrew/opt/llvm/lib:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib:/opt/homebrew/lib:/opt/homebrew/Cellar/gcc/14.2.0_1/lib/gcc/14"
export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/homebrew/include:/opt/homebrew/Cellar/boost/1.87.0/include"
export DYLD_LIBRARY_PATH="/opt/homebrew/opt/llvm/lib:$DYLD_LIBRARY_PATH"

git clone https://github.com/infiniflow/infinity.git
git config --global --add safe.directory infinity
mkdir cmake-build-debug && cd cmake-build-debug
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON ..
cmake --build . -t infinity

but occur error final line: ninja: build stopped: subcommand failed.

Image

zouchengli avatar Feb 26 '25 14:02 zouchengli

Hi, Infinity can not be compiled after v0.3,which is caused by Jemalloc dependencies. We do not have time to work on this issue right now, any contributions are welcome 😆

yingfeng avatar Feb 26 '25 14:02 yingfeng