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

Compiling a statically linked binary #8

Open
loicalleyne opened this issue May 17, 2024 · 3 comments
Open

Compiling a statically linked binary #8

loicalleyne opened this issue May 17, 2024 · 3 comments

Comments

@loicalleyne
Copy link

Is it possible to have an option to compile a statically linked Go binary so there's no dependency on having libchdb.so present on the machine it's running on?
My understanding is you need to build a static library libchdb.a file instead of a dynamic library libchdb.so, I tried modifying the chdb build script to see if it was possible and ran into a linker issue which I couldn't get past.

@auxten
Copy link
Member

auxten commented Jun 18, 2024

It's not that simple. libchdb contains so many libs like llvm, jemalloc. There need some special linkage tricks to make it work well with symbols from golang.

Still, it's possible to make a libchdb.a. Just need some efforts.

@aybabtme
Copy link

aybabtme commented Nov 19, 2024

👋 coming here for this as well. I'm currently using duckdb whereas I'd prefer to use chdb. I'm not super well versed into linking C libs, but the Go duckdb bindings use modvendor and default to static linking.

@auxten
Copy link
Member

auxten commented Nov 19, 2024

@aybabtme Thank you for the insight.
The most challenging part is make the libchdb.a work.
Please also follow up on this issue chdb-io/chdb#101

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

3 participants