libmaus2 2.0.800 ftbfs on non-x86 platforms
Good day,
When pushing the latest libmaus2 2.0.800 in Debian Sid, the buildd build servers caught failures to build from source on non-x86 platforms, such as arm64 and ppc64el. You can find the full build log on buildd status page for libmaus2 in Debian Sid. The relevant part follows:
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++17 -pthread -fopenmp -W -Wall -Wnon-virtual-dtor -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++17 -pthread -fopenmp -c libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp -fPIC -DPIC -o libmaus2/lcs/.libs/simd_align_256_la-AlignmentOneAgainstManyAVX2.o
g++ -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -W -Wall -Wnon-virtual-dtor -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -O3 -std=c++17 -pthread -fopenmp -c -o test/testThreadPoolRead-testThreadPoolRead.o `test -f 'test/testThreadPoolRead.cpp' || echo './'`test/testThreadPoolRead.cpp
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp: In constructor ‘libmaus2::lcs::AlignmentOneAgainstManyAVX2::AlignmentOneAgainstManyAVX2()’:
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:15: error: ‘AlignmentOneAgainstManyAVX2Context’ does not name a type; did you mean ‘AlignmentOneAgainstManyAVX2’?
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| AlignmentOneAgainstManyAVX2
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp: In lambda function:
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:85: error: ‘AlignmentOneAgainstManyAVX2Context’ does not name a type; did you mean ‘AlignmentOneAgainstManyAVX2’?
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| AlignmentOneAgainstManyAVX2
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:120: error: expected ‘>’ before ‘*’ token
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:120: error: expected ‘(’ before ‘*’ token
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^
| (
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:121: error: expected primary-expression before ‘>’ token
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^
libmaus2/lcs/AlignmentOneAgainstManyAVX2.cpp:318:125: error: expected ‘)’ before ‘;’ token
318 | : context(new AlignmentOneAgainstManyAVX2Context,[](auto p){delete reinterpret_cast<AlignmentOneAgainstManyAVX2Context *>(p);})
| ^
| )
The problem occurred in a lambda function which seems architecture specific (I believe AVX2 extensions are only available on x86 platforms), so I slightly shifted the #endif matching a control on the availability of the extension to below the lambda function. You can find the corresponding patch on Debian Salsa. I'm not too sure whether this is an appropriate fix or a work around, but the test suite executed properly after succesful build on arm64.
In hope this helps,
Have a nice day, :)
Étienne.