wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.25k stars 692 forks source link

How to compile on MacOS Sonoma 14.6.1 x64 #902

Closed sillyc0n closed 1 week ago

sillyc0n commented 1 month ago

Beginner question, because I must be doing something wrong.

I used instructions from the User Manual: cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release - this one passes and cmake --build profiler/build --config Release --parallel - on this one i get errors:

clang: error: unknown argument: '-fexperimental-library'

and

the clang compiler does not support '-march=native'

I tried forcing brew version of llvm with a bunch of exports but it makes no difference

export PATH="/usr/local/opt/llvm/bin:$PATH
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CXX="/usr/local/opt/llvm/bin/clang++"
export CC="/usr/local/opt/llvm/bin/clang"

What am i missing?

sillyc0n commented 1 month ago

Using these exports

export PATH="/usr/local/opt/cmake/bin:/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CXX="/usr/local/opt/llvm/bin/clang++"
export CC="/usr/local/opt/llvm/bin/clang"

and calling cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DNO_ISA_EXTENSIONS=ON

cmake --build profiler/build --config Release --parallel

I can get past previous errors but it gets stuck on:

warning: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: Unknown attribute kind (86) (Producer: 'LLVM19.1.0' Reader: 'LLVM APPLE_1_1316.0.21.1_0')
fatal error: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't figure out the architecture type of: /var/folders/v_/xwv19rqs4b5fbgf_txn4v79r0000gn/T/MCInstrDesc-aee33d/MCInstrDesc-x86_64.o
clang: error: lipo command failed with exit code 1 (use -v to see invocation)
make[2]: *** [_deps/capstone-build/CMakeFiles/capstone.dir/MCInstrDesc.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
geiseri commented 1 week ago

Master builds just fine for what its worth.

wolfpld commented 1 week ago

Probably fixed by #918.