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

centrifuge: add linux-aarch64 build #48450

Merged
merged 2 commits into from
Jun 14, 2024
Merged
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
15 changes: 14 additions & 1 deletion recipes/centrifuge/build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
#!/bin/bash

set -xe

export LDFLAGS="-L$PREFIX/lib"
export CPATH=${PREFIX}/include

mkdir -p $PREFIX/bin

make CXX=$CXX RELEASE_FLAGS="$CXXFLAGS"
case $(uname -m) in
aarch64)
CXXFLAGS="${CXXFLAGS} -fsigned-char"
ARCH_OPTS="SSE_FLAG= POPCNT_CAPABILITY=0"
;;
*)
ARCH_OPTS=""
;;
esac

make -j ${CPU_COUNT} CXX=$CXX RELEASE_FLAGS="$CXXFLAGS" ${ARCH_OPTS}
make install prefix=$PREFIX

cp evaluation/{centrifuge_evaluate.py,centrifuge_simulate_reads.py} $PREFIX/bin
51 changes: 51 additions & 0 deletions recipes/centrifuge/centrifuge-linux-aarch64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git i/Makefile w/Makefile
index 10e42f5..42cb38d 100644
--- i/Makefile
+++ w/Makefile
@@ -142,24 +142,25 @@ GIT_VERSION = $(VERSION)

# Convert BITS=?? to a -m flag
BITS=32
+BITS_FLAG =
ifeq (x86_64,$(shell uname -m))
BITS=64
+BITS_FLAG = -m64
+else ifeq (aarch64,$(shell uname -m))
+BITS=64
endif
# msys will always be 32 bit so look at the cpu arch instead.
ifneq (,$(findstring AMD64,$(PROCESSOR_ARCHITEW6432)))
ifeq (1,$(MINGW))
BITS=64
+ BITS_FLAG = -m64
endif
endif
-BITS_FLAG =

ifeq (32,$(BITS))
BITS_FLAG = -m32
endif

-ifeq (64,$(BITS))
- BITS_FLAG = -m64
-endif
SSE_FLAG=-msse2

DEBUG_FLAGS = -O0 -g3 $(BIToS_FLAG) $(SSE_FLAG) -std=c++11
diff --git i/third_party/cpuid.h w/third_party/cpuid.h
index 6a9688f..7c935c9 100644
--- i/third_party/cpuid.h
+++ w/third_party/cpuid.h
@@ -21,6 +21,7 @@
* <http://www.gnu.org/licenses/>.
*/

+#ifndef __ARM_NEON
/* %ecx */
#define bit_SSE3 (1 << 0)
#define bit_PCLMUL (1 << 1)
@@ -185,3 +186,4 @@ __get_cpuid (unsigned int __level,
__cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);
return 1;
}
+#endif // not __ARM_NEON
11 changes: 8 additions & 3 deletions recipes/centrifuge/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ package:
version: {{ version }}

build:
number: 1
number: 2
skip: true # [osx]
run_exports:
- {{ pin_subpackage("centrifuge", max_pin="x.x") }}

source:
url: https://github.com/DaehwanKimLab/centrifuge/archive/refs/tags/v{{ version }}.tar.gz
sha256: 638cc6701688bfdf81173d65fa95332139e11b215b2d25c030f8ae873c34e5cc
patches:
- centrifuge-linux-aarch64.patch # [linux and aarch64]

requirements:
build:
Expand All @@ -26,19 +28,22 @@ requirements:
- perl
- wget
- tar
- python <3
- python

test:
commands:
- centrifuge --help

about:
home: https://github.com/DaehwanKimLab/centrifuge
license: GPL3
license: GPL-3.0-only
license_file: LICENSE
license_family: GPL3
summary: 'Classifier for metagenomic sequences. Supports classifier scripts'

extra:
additional-platforms:
- linux-aarch64
identifiers:
- biotools:Centrifuge
- doi:10.1101/gr.210641.116