Odin icon indicating copy to clipboard operation
Odin copied to clipboard

macos release not self-contained -- requires llvm installed on the system

Open hasenj opened this issue 3 years ago • 4 comments

Context

Downloading the macos build from this page:

https://github.com/odin-lang/Odin/releases/tag/dev-2021-06

The assumption here is that someone who just wants to use the language, and not build it from source.

  • Operating System: macOS
  • Please paste odin version output: N/A. See below. Release number mentioned above.

Expected Behavior

Compiler works out of the box.

Current Behavior

  • The executable does not have the executable permission

    • The user must manually run chmod u+x odin
  • The executable is not self-contained. It requires a specific version of llvm to be installed in a specific location

$ odin
dyld: Library not loaded: /usr/local/opt/llvm@11/lib/libLLVM-C.dylib
  Referenced from: /Users/hasenj/odin/odin
  Reason: image not found
Abort trap: 6

$ odin version
dyld: Library not loaded: /usr/local/opt/llvm@11/lib/libLLVM-C.dylib
  Referenced from: /Users/hasenj/odin/odin
  Reason: image not found
Abort trap: 6

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Have a macOS system without llvm installed
  2. Download the release and unzip it to a reasonable location, e.g. ~/odin and make sure it's added to the $PATH variable
  3. Invoke the odin command

hasenj avatar Jun 10 '21 05:06 hasenj

I suspect it would make sense to have a llvmlib directory in which this library goes ideally setup with rpath‘s so that it doesn’t require a fixed position for the library.

Platin21 avatar Jun 10 '21 05:06 Platin21

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]

in case anyone else runs across this issue trying out Odin, you can fix it by doing the following:

Download version of LLVM Odin is using

brew install llvm@11

add to PATH

echo 'export PATH="/usr/local/opt/llvm@11/bin:$PATH"' >> ~/.zshrc

add execute permission to Odin

chmod +x odin

Profit

./odin run examples/demo/demo.odin -file

ctrl-dlahr avatar Aug 26 '22 06:08 ctrl-dlahr

In case anyone is trying this in 2023, I was trying to install Odin in my M2 Macbook with asdf and asdf-odin.

I got an error saying that a llvm@11/lib/libLLVM-C.dylib file was needed. I had the file, but the error said it was (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')).

That's when I realized that the GitHub releases don't currently include arm64 builds, but maybe that'll change someday? 😄

Sooooo, for now I'll just have to compile Odin from source on my arm64 machine.

Nezteb avatar Sep 28 '23 22:09 Nezteb

Since the 2024-03 macOS releases are now self contained, it now also supports arm64 so this can be closed.

laytan avatar Apr 02 '24 22:04 laytan