samtools / htslib

C library for high-throughput sequencing data formats
Other
784 stars 447 forks source link

Make compiler flag detection work with zig cc #1687

Closed daviesrob closed 7 months ago

daviesrob commented 7 months ago

Zig cc defaults to the equivalent of -march=native, but setting platform options like -maxv2 disables features that haven't been explicitly selected. The result is that you have to test for and enable both -maxv2 and -mpopcnt to get the avx2 code in htscodecs to build (and similarly for the other SIMD variants that it supports). Some minor quoting adjustments are also needed to make everything work correctly.

Also fixes up an incorrect comment describing usage in m4/hts_check_compile_flags_needed.m4