I’m pulling down igraph as a dependency in one of my CMake projects (with
FetchContent, though that’s not really relevant) and compiling it with clang 13.0.0, and I’m getting errors such as:
[ 5%] Building C object _deps/igraph-build/vendor/cs/CMakeFiles/cxsparse_vendored.dir/cs_qr.c.o /home/luna/Code/JSscran/wasm/build/_deps/igraph-src/vendor/cs/cs_qr.c:7:21: error: variable 'm' set but not used [-Werror,-Wunused-but-set-variable] CS_INT i, k, p, m, n, vnz, p1, top, m2, len, col, rnz, *s, *leftmost, *Ap, *Ai, ^ 1 error generated.
cs_qr.c in the current igraph master indicates that, indeed,
m is set and assigned to but never used. There’s a few similar warnings-promoted-to-errors elsewhere in the code base that I won’t list here for the sake of brevity. I eventually worked around this by adding this to my CMakeLists:
set(IGRAPH_WARNINGS_AS_ERRORS OFF CACHE BOOL "" FORCE)
It seems that
IGRAPH_WARNINGS_AS_ERRORS should default to OFF in the release tarball (I’m using the 0.9.4 release) to avoid these build problems. However, if downstream projects expected to set this themselves, then it should be listed in the installation instructions somewhere.