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

static library is not compiling #354

Closed
pkoosha opened this issue Jan 11, 2024 · 3 comments
Closed

static library is not compiling #354

pkoosha opened this issue Jan 11, 2024 · 3 comments

Comments

@pkoosha
Copy link

pkoosha commented Jan 11, 2024

I am opening this issue as I am facing the error for building the static library. the static library is not linked to use lz4 or cityhash. I don't see this error when using shared libraries but for my case I need to opt in for static library. @Enmk any hints?

/usr/local/lib/libclickhouse-cpp-lib.a(types.cpp.o): In function `clickhouse::Type::GetTypeUniqueId() const':
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/types/types.cpp:166: undefined reference to `CityHash64WithSeed(char const*, unsigned long, unsigned long)'
/usr/local/lib/libclickhouse-cpp-lib.a(compressed.cpp.o): In function `clickhouse::CompressedOutput::Compress(void const*, unsigned long)':
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/base/compressed.cpp:145: undefined reference to `LZ4_compress_default'
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/base/compressed.cpp:159: undefined reference to `CityHash128(char const*, unsigned long)'
/usr/local/lib/libclickhouse-cpp-lib.a(compressed.cpp.o): In function `clickhouse::CompressedOutput::PreallocateCompressBuffer(unsigned long)':
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/base/compressed.cpp:167: undefined reference to `LZ4_compressBound'
/usr/local/lib/libclickhouse-cpp-lib.a(compressed.cpp.o): In function `clickhouse::CompressedInput::Decompress()':
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/base/compressed.cpp:90: undefined reference to `CityHash128(char const*, unsigned long)'
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/base/compressed.cpp:97: undefined reference to `LZ4_decompress_safe'
/usr/local/lib/libclickhouse-cpp-lib.a(lowcardinality.cpp.o): In function `clickhouse::ColumnLowCardinality::computeHashKey(clickhouse::ItemView const&)':
/home/kousha.2/projects/release_inam/inam/clickhouse-cpp/clickhouse/columns/lowcardinality.cpp:225: undefined reference to `CityHash64(char const*, unsigned long)'
@Enmk
Copy link
Collaborator

Enmk commented Jan 12, 2024

Hi @pkoosha ! Could you please share your CMake-configure step options?

@pkoosha
Copy link
Author

pkoosha commented Jan 19, 2024

Here you are
cmake .. -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-std=c++17" -DCMAKE_CXX_COMPILER=/opt/gcc/7.5.0/bin/g++ -DCMAKE_C_COMPILER=/opt/gcc/7.5.0/bin/gcc -DCMAKE_EXE_LINKER_FLAGS="-L/opt/gcc/7.5.0/lib64" -DBUILD_SHARED_LIBS=OFF

@1261385937
Copy link
Contributor

@pkoosha
No probelm here.
With clickhouse-cpp static lib, you should link the extra static lib (absl cityhash lz4)

@Enmk Please close

@Enmk Enmk closed this as completed Mar 12, 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

3 participants