Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update htscodecs for new SIMD code + gcc-12 fixes #1438

Merged
merged 6 commits into from
May 23, 2022

Conversation

daviesrob
Copy link
Member

Updates the htscodecs submodule and adds changes necessary to make HTSlib build the new SIMD codec implementations. Also includes a somewhat unrelated gcc-12 fix in vcf.c needed to make the tests work.

configure.ac gets new checks for the various options needed to generate SIMD code.

Makefile rules are updated to make the new object files, and add SIMD options to only the ones that need them. The rules that run the compiler get an extra TARGET_FLAGS variable so flags can be adjusted on a per-target basis even if the user sets CFLAGS on the command line (which stops the Makefile from overriding it).

A small script is added to probe compiler options on non-configure builds, allowing them to enable the SIMD code. The compiler tests are the same as for configure and have been written so that they don't generate warnings and work even if the user sets -Werror in CFLAGS.

gcc-12.1 produced a warning that NULL could be passed to
strcmp() via str_class.  I'm not sure if that can actually
happen, but just in case add a check.
Update htscodecs to bring in the rANS 32x16 codecs

Add new htscodecs source files and dependencies into htslib
makefiles.  Some htscodecs functions have changed name slightly
so a couple of cram source files are updated to reflect that.

These changes are enough to build the non-SIMD versions of
the new codecs, but don't enable the accelerated versions yet.
Adds the checks necessary to detect x86_64 SIMD support and
turn it on the htscodecs if it's available.

As ssse3, popcnt and sse4.1 are used together, they're tested
for as a group.
For the benefit of htslib embeds that don't want to create and run
a configure script.  Adds a small script that does a similar
job by probing a few compiler options and then outputs makefile
lines to set variables if they succeed.  These lines are added
to the default 'htscodecs.mk' file that gets built if configure
hasn't already made one.  Adding them here means the probing
will be remembered until the next "make distclean".

The script fragment that builds the default 'config.h' checks
to see if the variables have been set, and if so adds the
appropriate 'HAVE_' lines for the feature.
Mainly to ensure that the fuzzer build doesn't start complaining
about unaligned access.
@jkbonfield jkbonfield merged commit 958e6fa into samtools:develop May 23, 2022
@daviesrob daviesrob deleted the htscodecs_unroll32 branch May 23, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants