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

Compilation failure on Linux #58

Closed
rongcuid opened this issue Dec 14, 2022 · 5 comments
Closed

Compilation failure on Linux #58

rongcuid opened this issue Dec 14, 2022 · 5 comments

Comments

@rongcuid
Copy link

I got massive amount of errors about libc. I thought this package uses prebundled library? It looks like it is trying to compile from source.

# github.com/marcboeker/go-duckdb
~/go/pkg/mod/github.com/marcboeker/go-duckdb@v1.0.7/deps/linux_amd64/libduckdb.a(duckdb.o): In function `std::vector<duckdb::PhysicalIndex, std::allocator<duckdb::PhysicalIndex> >::operator=(std::vector<duckdb::PhysicalIndex, std::allocator<duckdb::PhysicalIndex> > const&) [clone .isra.0]':
duckdb.cpp:(.text+0x1d97e): undefined reference to `std::__throw_bad_array_new_length()'
~/go/pkg/mod/github.com/marcboeker/go-duckdb@v1.0.7/deps/linux_amd64/libduckdb.a(duckdb.o): In function `std::vector<duckdb::LogicalType, std::allocator<duckdb::LogicalType> >::vector(std::initializer_list<duckdb::LogicalType>, std::allocator<duckdb::LogicalType> const&) [clone .constprop.0]':
duckdb.cpp:(.text+0x26bbb): undefined reference to `__libc_single_threaded'
~/go/pkg/mod/github.com/marcboeker/go-duckdb@v1.0.7/deps/linux_amd64/libduckdb.a(duckdb.o): In function `duckdb::InitializeValidities(duckdb::Vector&, unsigned long&)':
duckdb.cpp:(.text+0x2d288): undefined reference to `__libc_single_threaded'
duckdb.cpp:(.text+0x2d30c): undefined reference to `__libc_single_threaded'
~/go/pkg/mod/github.com/marcboeker/go-duckdb@v1.0.7/deps/linux_amd64/libduckdb.a(duckdb.o): In function `duckdb::RelationStatement::Copy() const':
duckdb.cpp:(.text+0x2e9b9): undefined reference to `__libc_single_threaded'

The system I am running on is old, so maybe stdc++ is also old. Not sure if it is related.

@marcboeker
Copy link
Owner

Looks like the same issue as in #54. What does your command look like to build/run your app?

Does make test or make examples work inside the repo, when checking out on your machine?

@begelundmuller
Copy link
Contributor

begelundmuller commented Dec 19, 2022

We are also seeing this bug, but only for DuckDB v0.6.1. I noticed that the ubuntu-latest Github runner moved from Ubuntu 20.04.5 to Ubuntu 22.04.01 between v0.6.0 and v0.6.1, which might be related.

It seems the problem also relates to the static libraries not being fully static, instead dynamically linking to the C++ standard library. Will investigate further, but I'm not an expert on linking, so any input would be appreciated.

@marcboeker
Copy link
Owner

I've downgraded Ubuntu to 20.04 in this branch.

@rongcuid could you please check out this branch and try it again on your machine. If it works, we can diff the Ubuntu versions for possible changes that break the static build.

@marcboeker
Copy link
Owner

@rongcuid I've switched to clang++ instead of g++. Could you please check, if the libs in the https://github.com/marcboeker/go-duckdb/tree/switch-compiler branch now work?

@marcboeker
Copy link
Owner

Issue seems to be stale. Feel free to reopen when you have an update.

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