ralna / spral

Sparse Parallel Robust Algorithms Library
https://ralna.github.io/spral/
Other
102 stars 27 forks source link

Unable to compile tests_ssids_kernels_ldlt_app.cxx on musl platforms #188

Closed amontoison closed 5 months ago

amontoison commented 6 months ago

When I updated SPRAL_jll.jl with Yggdrasil, I forgot to not compile the examples and the tests. I remarked that some compilers where unable to compile tests_ssids_kernels_ldlt_app.cxx with this error:

[21:12:07] FAILED: kernelst_cpp.p/tests_ssids_kernels_ldlt_app.cxx.o
[21:12:07] /opt/bin/x86_64-linux-musl-libgfortran5-cxx11/x86_64-linux-musl-g++ -Ikernelst_cpp.p -I. -I.. -Iinclude -I../include -Isrc -I../src -I/workspace/destdir/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -std=c++11 -O3 -DHAVE_HWLOC -DHAVE_SCHED_GETCPU -fopenmp -MD -MQ kernelst_cpp.p/tests_ssids_kernels_ldlt_app.cxx.o -MF kernelst_cpp.p/tests_ssids_kernels_ldlt_app.cxx.o.d -o kernelst_cpp.p/tests_ssids_kernels_ldlt_app.cxx.o -c ../tests/ssids/kernels/ldlt_app.cxx
[21:12:07] In file included from /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/include/limits.h:8,
[21:12:07]                  from /opt/x86_64-linux-musl/x86_64-linux-musl/include/c++/9.1.0/climits:42,
[21:12:07]                  from ../src/ssids/cpu/kernels/ldlt_app.cxx:9,
[21:12:07]                  from ../tests/ssids/kernels/ldlt_app.cxx:18:
[21:12:07] ../tests/ssids/kernels/ldlt_app.cxx: In function ‘int ldlt_test(T, T, bool, bool, bool, int, int, int, int, int)’:
[21:12:07] ../tests/ssids/kernels/ldlt_app.cxx:322:14: error: expected unqualified-id before numeric constant
[21:12:07]   322 |    const int PAGE_SIZE = 8*1024*1024; // 8 MB

Failing builds: https://buildkite.com/julialang/yggdrasil/builds/7838#_

Maybe the macro PAGE_SIZE is already defined on musl architectures?

jfowkes commented 6 months ago

@amontoison I mean musl is super niche, the chances of anyone wanting SPRAL on Alpine are minimal, but yes musl libc does indeed define PAGE_SIZE macro: https://musl.openwall.narkive.com/tO8vrHdP/why-define-page-size I would just drop the musl builds, but if you really want to support musl feel free to open a PR that fixes this...

amontoison commented 6 months ago

@jfowkes I don't compile the tests when I cross-compile SPRAL with Yggdrasil so we don't need to drop the musl builds or fix the issue.

However, it should not take long to replace PAGE_SIZE by SPRAL_PAGE_SIZE with a sed command. I will fix the error next time that I do modifications in SPRAL.

jfowkes commented 6 months ago

I would use SSIDS_PAGE_SIZE but yes.