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

Support Linux aarch64 #264

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Build on Linux x86_64
runs-on: ubuntu-latest

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

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y file

- name: Build
run: |
make -j all
file wtdbg2 | grep x86-64

build-aarch64:
name: Build on Linux aarch64
runs-on: ubuntu-latest

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

- name: Build
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/wtdbg2"
install: |
apt-get update -q -y
apt-get install -q -y make gcc file zlib1g-dev
run: |
cd /wtdbg2
make -j all
file wtdbg2 | grep aarch64
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ ifeq (0, ${MAKELEVEL})
TIMESTAMP=$(shell date)
endif

ARCH := $(shell uname -m)
ifeq ($(ARCH), x86_64)
ARCH_CFLAGS=-mpopcnt -msse4.2
else ifeq ($(ARCH), aarch64)
ARCH_CFLAGS=
endif

ifeq (1, ${DEBUG})
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O0 -DDEBUG=1 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -mpopcnt -msse4.2
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O0 -DDEBUG=1 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(ARCH_CFLAGS)
else
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O4 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -mpopcnt -msse4.2
CFLAGS=-g3 -W -Wall -Wno-unused-but-set-variable -O4 -DVERSION="$(VERSION)" -DRELEASE="$(RELEASE)" -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(ARCH_CFLAGS)
endif

GLIBS=-lm -lrt -lpthread -lz
Expand Down
7 changes: 6 additions & 1 deletion ksw.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@

#include <stdlib.h>
#include <stdint.h>
#include <emmintrin.h>
#include "ksw.h"

#ifdef __x86_64__
#include <emmintrin.h>
#elif __aarch64__
#include "sse2neon.h"
#endif

#ifdef USE_MALLOC_WRAPPERS
# include "malloc_wrap.h"
#endif
Expand Down
5 changes: 5 additions & 0 deletions poacns.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@
#include "chararray.h"
#include "list.h"
#include "hashset.h"

#ifdef __x86_64__
#include <emmintrin.h>
#include <tmmintrin.h>
#elif __aarch64__
#include "sse2neon.h"
#endif

#if __BYTE_ORDER == 1234
//#pragma message(" ** " __FILE__ " has been tested in LITTLE_ENDIAN **\n")
Expand Down
Loading