Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update requirements for OpenBSD #2838

Closed
niko-ng opened this issue May 20, 2024 · 10 comments
Closed

update requirements for OpenBSD #2838

niko-ng opened this issue May 20, 2024 · 10 comments

Comments

@niko-ng
Copy link

niko-ng commented May 20, 2024

Hello,
Since OpenBSD 7.4 the libclang path has changed.
users have to make sure they install the port of llvm by running pkg_add llvm.
And then, depending on the version that was chosen for install, the path for the dynamic library varies.
by example, for the 17 version, it should be

LIBCLANG_PATH=/usr/local/llvm17/lib

this is the solution for all users encountering the error :

Unable to find libclang: "the `libclang` shared library at /usr/local/lib/libclang.so.8.2 could not be opened: Cannot load specified object"
@basicfeatures
Copy link

Any updates on this?

@niko-ng
Copy link
Author

niko-ng commented May 29, 2024

Any updates on this?

What do yo mean "update" ?
The team of rust-bindgen needs to update their docs. I have provided what should be updated. They havent done it yet. not sure they have seen this issue.
If you need to make rust-bindgen work on your openbsd system with version 7.4 or 7.5, then you just have to follow the instructions i detailed above.

@basicfeatures
Copy link

I need to install langchainrb basically. I'll follow your setup, many thanks man!

@niko-ng
Copy link
Author

niko-ng commented May 29, 2024

langchainrb

I think this command will work (or something similar)

env LIBCLANG_PATH=/usr/local/llvm17/lib gmake gem install langchainrb

you can also try to run export LIBCLANG_PATH=/usr/local/llvm17/lib before running gem install langchainrb

Make sure you installed the version 17 of LLVM before, by running pkg_add llvm.

BTW, I am curious why all those AI projects are running on Ruby, and why you guys are choosing OpenBSD as an OS for your AI stuff ? I love OpenBSD, just didn't know it is used for LLM. Is there a specific reason?

@basicfeatures
Copy link

To me Ruby is mankind's greatest achievement so far in programming, and Rails is the best way of organizing it into a web framework. It's like Python's little brother. Same concepts basically, but with a modernized syntax and package system.

Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software like NGiNX & Apache (https://openbsd.org/papers/httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker and so on.

OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest configuration syntax.

The biggest obstacle to OpenBSD is its lack of NVidia drivers, but we're working on it!

@niko-ng
Copy link
Author

niko-ng commented May 29, 2024

Ah nice! Yes I love OpenBSd, the best OS for security and simplicity.
I know Ruby a bit and Rails too, from 15 years ago. Nice to see it is still used.
I'll give a try to those AI things you are using ;)
there was also this guy that had the same issue :
https://www.reddit.com/r/rust/comments/1cg82vz/rust_openbsd_and_ruby_gems/

@niko-ng
Copy link
Author

niko-ng commented May 29, 2024

BTW, if the fix works for you, you should talk to the maintainers of langchainrb and tiktoken_ruby because they need to upgrade their build scripts for openbsd (change the LIBCLANG_PATH env var)

@emilio
Copy link
Contributor

emilio commented May 29, 2024

We'd take a pr with the doc fix fwiw, but an even better approach might be to teach clang-sys about where libclang is in openbsd

@niko-ng
Copy link
Author

niko-ng commented May 29, 2024

You are right that it is not a rust-bindgen issue, but a clang-sys one.
in fact, llvm-config --libdir should return the right path and clang-sys should be able to find the lib without the need for the env var LIBCLANG_PATH.
But something is wrong in the setup, at least on my machine, as it looks like there are 2 competing llvm-config on the machine. the old one and the newer one. Seems like an OpenBSD issue too.
In any case, you can update your docs indeed, and clang-sys would have to do the same.
I don't have the time for that right now, nor to open more issues everywhere, nor to make you a PR for your docs.
i just created an issue at clang-sys now.
I did my part which was to locate the issue (that has been mostly affecting rust-bindgen so far, as it is used extensively in the AI ruby ecosystem, apparently). For me it was when compiling rust-rocksdb, which can be also pretty common in general, but not so much on OpenBSD.
Anyway, you can take it in your hands @emilio, or not.
Me i leave you here with that.

@pvdrz
Copy link
Contributor

pvdrz commented May 29, 2024

closed as KyleMayes/clang-sys#180 was opened. The readme already mentions what to do to point to the right libclang path.

@pvdrz pvdrz closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants