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

Make SIMD configure tests work for MacOS multiarch builds #1587

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

daviesrob
Copy link
Member

MacOS multiarch binaries compile source code for each architecture and then join them together using 'lipo'. This means architecture specific code both in the actual source and configure tests need to be compilable on both architectures.

This pulls in htscodecs changes needed, and makes changes to HTSlib's Makefile, configure and hts_probe_cc.sh scripts so that multiarch compilation works. It also makes the MacOS CI tests build a multiarch library.

See also samtools/htscodecs#76 and samtools/htscodecs#78.

MacOS multiarch binaries compile source code for each architecture
and then join them together using 'lipo'.  This means architecture
specific code both in the actual source and configure tests need
to be compilable on both architectures.

Switch the configure tests and hts_probe_cc.sh so that they check
if a given flag is needed to compile the test code instead of
just testing to see if the flag works.  By adding #ifdef __x86_64__
guards around the test code, compilation will work on non-x86_64
returning the result that no special compiler flag is needed.
Similar #ifdef guards are added to the source files so that the
SIMD-specific code only gets compiled for x86_64.  The
htscodecs submodule is updated to pull in these source file
changes.

The SIMD parts of built-in htscodecs are now compiled
unconditionally.  Tests for NEON have also been removed as they
weren't really doing anything.

The configure and hts_probe_cc.sh are adjusted to exactly match
those used by htscodecs' configure, for ease of maintenance.
@daviesrob
Copy link
Member Author

MacOS CI tests have been updated to add the -arch options to LDFLAGS. This seems to be necessary to ensure you've really made a multiarch library / executable.

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