Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
build-linux-x8664:
name: Linux x86_64
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]

steps:
- name: Checkout ksw2
uses: actions/checkout@v4

- name: Compile with ${{ matrix.compiler }}
run: |
make CC=${{ matrix.compiler }}
file ksw2-test | grep x86-64

build-linux-aarch64:
name: Linux aarch64
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc]

steps:
- name: Checkout ksw2
uses: actions/checkout@v4

- name: Compile with ${{ matrix.compiler }}
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu22.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/ksw2"
install: |
apt-get update -q -y
apt-get install -q -y make ${{ matrix.compiler }} zlib1g-dev file
run: |
cd /ksw2
make CC=${{ matrix.compiler }} arm_neon=1 aarch64=1 -j
file ksw2-test | grep aarch64

build-mac-arm64:
name: Mac ARM64
runs-on: macos-14
strategy:
matrix:
compiler: [clang]

steps:
- name: Checkout ksw2
uses: actions/checkout@v4

- name: Compile with ${{ matrix.compiler }}
run: |
make CC=${{ matrix.compiler }} arm_neon=1 aarch64=1 -j
file ksw2-test | grep arm64

26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
CC= gcc
CFLAGS= -g -Wall -Wextra -Wc++-compat -O2
CPPFLAGS= -DHAVE_KALLOC
CPPFLAGS= -DHAVE_KALLOC -DKSW_SSE2_ONLY -D__SSE2__
INCLUDES= -I.
OBJS= ksw2_gg.o ksw2_gg2.o ksw2_gg2_sse.o ksw2_extz.o ksw2_extz2_sse.o \
ksw2_extd.o ksw2_extd2_sse.o ksw2_extf2_sse.o ksw2_exts2_sse.o
PROG= ksw2-test
LIBS= -lz

ifneq ($(aarch64),)
arm_neon=1
endif

ifneq ($(arm_neon),) # if arm_neon is not defined
INCLUDES+=-Isse2neon
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

ifneq ($(asan),)
CFLAGS+=-fsanitize=address
LIBS+=-fsanitize=address -ldl
endif

ifneq ($(tsan),)
CFLAGS+=-fsanitize=thread
LIBS+=-fsanitize=thread -ldl
endif


ifneq ($(gaba),) # gaba source code directory
CPPFLAGS += -DHAVE_GABA
INCLUDES += -I$(gaba)
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ documentations. TeX file [ksw2.tex](tex/ksw2.tex) gives brief derivation.

To compile the test program `ksw-test`, just type `make`. It takes the
advantage of SSE4.1 when available. To compile with SSE2 only, use `make
sse2=1` instead. If you have installed [parasail][para], use `make
sse2=1` instead, which will make minimap2 slightly slower.

`ksw2` also works with ARM CPUs supporting the NEON instruction sets. To
compile for 32 bit ARM architectures (such as ARMv7), use `make arm_neon=1`. To
compile for for 64 bit ARM architectures (such as ARMv8), use `make arm_neon=1
aarch64=1`.

If you have installed [parasail][para], use `make
parasail=prefix`, where `prefix` points to the parasail install directory (e.g.
`/usr/local`).

Expand Down
Loading