c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Can't open In M3 mac

Open wizard-lgtm opened this issue 1 year ago • 14 comments

❯ c3c dyld[53358]: Library not loaded: /opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib Referenced from: <2D50C22A-0492-3DC4-9738-F08EE7CF712B> /Users/hootie/Documents/c3c/c3c Reason: tried: '/opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib' (no such file), '/opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib' (no such file) [1] 53358 abort c3c

wizard-lgtm avatar Nov 01 '24 21:11 wizard-lgtm

Sadly a known issue Homebrew producing non-standalone static libraries. One can really ask oneself what the point is of static libraries when the libraries retain dependencies on dynamic libraries.

lerno avatar Nov 01 '24 21:11 lerno

For now, using Homebrew to get c3c, grab LLVM from homebrew just to get the dependencies or building it yourself are the available solutions. I am very sorry about this.

lerno avatar Nov 01 '24 21:11 lerno

What we need is a CI similar to https://github.com/c3lang/win-llvm but for MacOS which creates builds for Aarch64 and x64. Then we could use those to build C3 instead.

lerno avatar Nov 06 '24 10:11 lerno

yeah im experiencing this on M3 too.. missing a lot dylib

nmsobri avatar Nov 13 '24 01:11 nmsobri

I has this problem too.

The temporary fix is make a symlink '/opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib' refer to the original 'libunwind.1.dylib' in unwind folder (I have libunwind.1.dylib but inside unwind folder in lib)

ZGA2519 avatar Nov 15 '24 07:11 ZGA2519

Why not bundle a version of libunwind? It's not a huge library...

xvln avatar Dec 07 '24 12:12 xvln

This is what building a custom version of LLVM could do.

lerno avatar Dec 07 '24 15:12 lerno

Temp Fix

c3c it's looking for libunwind from LLVM 17 and some Homebrew stuff.

➜  otool -L c3c | grep libunwind
	/opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)

a quick fix is run:

brew install llvm@17

rodgomesc avatar Dec 18 '24 01:12 rodgomesc

I got the compiler working on LLVM 19.1.6 by just grab the codebase and build it on my machine. Building from source prevents a lot of annoying dylib problems. スクリーンショット 2024-12-28 14 17 12 (I did encountered some problem while building though, that's because now llvm and lld become two different packages in homebrew so I adjusted some settings to make it find the lld libraries)

onion108 avatar Dec 28 '24 06:12 onion108

Temp Fix

c3c it's looking for libunwind from LLVM 17 and some Homebrew stuff.

➜ otool -L c3c | grep libunwind /opt/homebrew/opt/llvm@17/lib/libunwind.1.dylib (compatibility version 1.0.0, current version 1.0.0)

a quick fix is run:

brew install llvm@17

brew install llvm@17 also just worked for me.

sstadick avatar Jan 23 '25 21:01 sstadick

This is in progress but will probably not be fixed quite yet.

lerno avatar Mar 25 '25 13:03 lerno

I had newer versions of llvm and lld installed (Looks like they were split since 19) but was able to clone and build c3c from source with cmake -DCMAKE_PREFIX_PATH="$(brew --prefix llvm)" -DC3_LLD_DIR="$(brew --prefix lld)/lib" ..

thomashope avatar Apr 04 '25 12:04 thomashope

I had newer versions of llvm and lld installed (Looks like they were split since 19) but was able to clone and build c3c from source with cmake -DCMAKE_PREFIX_PATH="$(brew --prefix llvm)" -DC3_LLD_DIR="$(brew --prefix lld)/lib" ..

Only -DC3_LLD_DIR="$(brew --prefix lld)/lib" is enough if llvm is properly installed by homebrew

onion108 avatar Apr 05 '25 09:04 onion108