Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/simde"]
path = lib/simde
url = https://github.com/nemequ/simde.git
38 changes: 28 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra
CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary difference. 1 space here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the space in the following commit.

CPPFLAGS= -DHAVE_KALLOC
INCLUDES=
OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o chain.o align.o hit.o map.o format.o pe.o esterr.o splitidx.o ksw2_ll_sse.o
INCLUDES= -Ilib/simde/simde
Copy link
Contributor

@junaruga junaruga Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be -Ilib/simde rather than -Ilib/simde/simde, modifying the loaded header paths. Because for example #include <simde/x86/sse2.h> is the right call by the simde system library (such as libsimde-dev in Debian) or simde-devel in Fedora and EPEL (CentOS).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed to this in the following commit.

OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o chain.o align.o hit.o map.o format.o pe.o esterr.o splitidx.o
PROG= minimap2
PROG_EXTRA= sdust minimap2-lite
LIBS= -lm -lz -lpthread

ifeq ($(no_simd),) # if no_simd is not defined
ifeq ($(arm_neon),) # if arm_neon is not defined
OBJS+=ksw2_ll_sse.o
ifeq ($(sse2only),) # if sse2only is not defined
OBJS+=ksw2_extz2_sse41.o ksw2_extd2_sse41.o ksw2_exts2_sse41.o ksw2_extz2_sse2.o ksw2_extd2_sse2.o ksw2_exts2_sse2.o ksw2_dispatch.o
else # if sse2only is defined
OBJS+=ksw2_extz2_sse.o ksw2_extd2_sse.o ksw2_exts2_sse.o
endif
else # if arm_neon is defined
OBJS+=ksw2_extz2_neon.o ksw2_extd2_neon.o ksw2_exts2_neon.o
INCLUDES+=-Isse2neon
OBJS+=ksw2_ll_sse.o ksw2_extz2_neon.o ksw2_extd2_neon.o ksw2_exts2_neon.o
ifeq ($(aarch64),) #if aarch64 is not defined
CFLAGS+=-D_FILE_OFFSET_BITS=64 -mfpu=neon -fsigned-char
else #if aarch64 is defined
CFLAGS+=-D_FILE_OFFSET_BITS=64 -fsigned-char
endif
endif
else
OBJS+=ksw2_ll_nosimd.o ksw2_extz2_nosimd.o ksw2_extd2_nosimd.o ksw2_exts2_nosimd.o
endif

ifneq ($(asan),)
CFLAGS+=-fsanitize=address
Expand Down Expand Up @@ -56,10 +60,8 @@ sdust:sdust.c kalloc.o kalloc.h kdq.h kvec.h kseq.h ketopt.h sdust.h

# SSE-specific targets on x86/x86_64

ifeq ($(arm_neon),) # if arm_neon is defined, compile this target with the default setting (i.e. no -msse2)
ksw2_ll_sse.o:ksw2_ll_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) -msse2 $(CPPFLAGS) $(INCLUDES) $< -o $@
endif

ksw2_extz2_sse41.o:ksw2_extz2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@
Expand All @@ -83,15 +85,31 @@ ksw2_dispatch.o:ksw2_dispatch.c ksw2.h
$(CC) -c $(CFLAGS) -msse4.1 $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@

# NEON-specific targets on ARM
ksw2_ll_neon.o:ksw2_ll_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) -DSIMDE_ENABLE_NATIVE_ALIASES $(CPPFLAGS) $(INCLUDES) $< -o $@

ksw2_extz2_neon.o:ksw2_extz2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES $(INCLUDES) $< -o $@

ksw2_extd2_neon.o:ksw2_extd2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES $(INCLUDES) $< -o $@

ksw2_exts2_neon.o:ksw2_exts2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ $(INCLUDES) $< -o $@
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES $(INCLUDES) $< -o $@

# no-SIMD version

ksw2_ll_nosimd.o:ksw2_ll_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DSIMDE_ENABLE_NATIVE_ALIASES -DSIMDE_NO_NATIVE $(INCLUDES) $< -o $@

ksw2_extz2_nosimd.o:ksw2_extz2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES -DSIMDE_NO_NATIVE $(INCLUDES) $< -o $@

ksw2_extd2_nosimd.o:ksw2_extd2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES -DSIMDE_NO_NATIVE $(INCLUDES) $< -o $@

ksw2_exts2_nosimd.o:ksw2_exts2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_SSE2_ONLY -D__SSE2__ -DSIMDE_ENABLE_NATIVE_ALIASES -DSIMDE_NO_NATIVE $(INCLUDES) $< -o $@

# other non-file targets

Expand Down
6 changes: 4 additions & 2 deletions ksw2_extd2_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
#include "ksw2.h"

#ifdef __SSE2__
#include <emmintrin.h>
//#include <emmintrin.h>
#include <x86/sse2.h>

#ifdef KSW_SSE2_ONLY
#undef __SSE4_1__
#endif

#ifdef __SSE4_1__
#include <smmintrin.h>
//#include <smmintrin.h>
#include <x86/sse4.1.h>
#endif

#ifdef KSW_CPU_DISPATCH
Expand Down
7 changes: 4 additions & 3 deletions ksw2_exts2_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#include "ksw2.h"

#ifdef __SSE2__
#include <emmintrin.h>

//#include <emmintrin.h>
#include <x86/sse2.h>
#ifdef KSW_SSE2_ONLY
#undef __SSE4_1__
#endif

#ifdef __SSE4_1__
#include <smmintrin.h>
//#include <smmintrin.h>
#include <x86/sse4.1.h>
#endif

#ifdef KSW_CPU_DISPATCH
Expand Down
6 changes: 4 additions & 2 deletions ksw2_extz2_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
#include "ksw2.h"

#ifdef __SSE2__
#include <emmintrin.h>
//#include <emmintrin.h>
#include <x86/sse2.h>

#ifdef KSW_SSE2_ONLY
#undef __SSE4_1__
#endif

#ifdef __SSE4_1__
#include <smmintrin.h>
//#include <smmintrin.h>
#include <x86/sse4.1.h>
#endif

#ifdef KSW_CPU_DISPATCH
Expand Down
3 changes: 2 additions & 1 deletion ksw2_ll_sse.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <emmintrin.h>
//#include <emmintrin.h>
#include <x86/sse2.h>
#include "ksw2.h"

#ifdef __GNUC__
Expand Down
1 change: 1 addition & 0 deletions lib/simde
Submodule simde added at b30129