CODARcode / MGARD

MGARD: MultiGrid Adaptive Reduction of Data
Apache License 2.0
37 stars 25 forks source link

Build errors with `musl` library #232

Closed eschnett closed 4 weeks ago

eschnett commented 1 month ago

I see compile errors when building with musl instead of glibc. The errors look like

In file included from /workspace/srcdir/MGARD/src/mgardx/ExternalCompressionLowLevel/ZFP/shared.cpp:9:
/workspace/srcdir/MGARD/include/mgard-x/ExternalCompressionLowLevel/ZFP/shared.h:95:22: error: ‘uint’ has not been declared
template <class Int, uint s> MGARDX_EXEC static void inv_lift(Int *p) {

I don't think the identifier uint is declared there.

The full build log is here https://buildkite.com/organizations/julialang/pipelines/yggdrasil/builds/13815/jobs/01926d8f-a990-4ade-80bb-96f30a50bc10/download.txt .

JieyangChen7 commented 1 month ago

Thanks for pointing out the issue. We have fixed the issue in this PR #233, however we do not have a testing machine that has musl. Could you help us try out the PR to see if it works on your system?

eschnett commented 1 month ago

@JieyangChen7 When trying to build the PR I encounter the problem that zstd isn't found. (This used to work find.) zstd is installed, but it was installed it via meson, not via cmake. I assume that this is the reason there is no file zstdConfig.cmake. As far as I can see, cmake requires this file to be present since MGARD calls find_package.

It's likely that others also install zstd without generating a cmake config file. zstd supports several different build systems (make, cmake, and meson). As a work-around you could provide a fallback zstdConfig.cmake that uses pkgconfig. A file libzstd.pc exists.

JieyangChen7 commented 4 weeks ago

@eschnett Thanks for the advice. I have updated MGARD to make finding zest more adaptive. It first try to find zstdConfig.cmake if fails it automatically fallback to find libzstd.pc. I have verified with both installation methods for zstd. Please let me know if there is any issues on your side.

eschnett commented 4 weeks ago

Thanks! musl is now building fine.