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

Update subread to v2.0.8 and enable arm64 build #52718

Merged
merged 2 commits into from
Dec 11, 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
13 changes: 13 additions & 0 deletions recipes/subread/0001-macOS-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Makefile.MacOS b/src/Makefile.MacOS
index 7620450..7b9f74d 100644
--- a/src/Makefile.MacOS
+++ b/src/Makefile.MacOS
@@ -3,7 +3,7 @@ include makefile.version

CCFLAGS = ${MACOS} -O9 -w -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64 ${WARNING_LEVEL}
LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST
-CC = gcc ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0
+CC = $(C) ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -ffast-math -funroll-loops -fmessage-length=0


ALL_LIBS= core core-junction core-indel sambam-file sublog gene-algorithms hashtable input-files sorted-hashtable gene-value-index exon-algorithms HelperFunctions interval_merge core-bigtable seek-zlib input-blc
10 changes: 10 additions & 0 deletions recipes/subread/0002-longread-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/src/longread-one/Makefile b/src/longread-one/Makefile
index 06ee3e6..2643584 100644
--- a/src/longread-one/Makefile
+++ b/src/longread-one/Makefile
@@ -1,4 +1,4 @@
-CC_EXEC = gcc
+CC_EXEC = $(C)
OPT_LEVEL = 3

include ../makefile.version
13 changes: 13 additions & 0 deletions recipes/subread/0003-Linux-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Makefile.Linux b/src/Makefile.Linux
index b76172c..f2ebd4b 100644
--- a/src/Makefile.Linux
+++ b/src/Makefile.Linux
@@ -1,7 +1,7 @@
#MACOS = -D MACOS


-CC_EXEC = gcc
+CC_EXEC = $(C)
OPT_LEVEL = 3

include makefile.version
13 changes: 13 additions & 0 deletions recipes/subread/0004-macOS-sse.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Makefile.MacOS b/src/Makefile.MacOS
index 5c96c75..e33aa51 100644
--- a/src/Makefile.MacOS
+++ b/src/Makefile.MacOS
@@ -3,7 +3,7 @@ include makefile.version

CCFLAGS = ${MACOS} -O9 -w -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64 ${WARNING_LEVEL}
LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST
-CC = $(C) ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -ffast-math -funroll-loops -fmessage-length=0
+CC = $(C) ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -mmmx -msse -msse2 -msse3 -ffast-math -funroll-loops -fmessage-length=0


ALL_LIBS= core core-junction core-indel sambam-file sublog gene-algorithms hashtable input-files sorted-hashtable gene-value-index exon-algorithms HelperFunctions interval_merge core-bigtable seek-zlib input-blc
41 changes: 26 additions & 15 deletions recipes/subread/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,36 @@ mkdir -p "${PREFIX}/bin"
mkdir -p "${PREFIX}/annotation"

cd src
MAKEFILE=Makefile.Linux
if [ `uname` = "Darwin" ];
then
MAKEFILE=Makefile.MacOS
if [[ `uname` = "Darwin" ]]; then
MAKEFILE=Makefile.MacOS
else
MAKEFILE=Makefile.Linux
fi

if [ $(uname -m) == "aarch64" ]; then
sed -i.bak 's/-mtune=core2//' ${MAKEFILE}
sed -i.bak 's/-mtune=core2//' ./longread-one/Makefile
if [[ $(uname -m) == "aarch64" ]]; then
sed -i.bak 's/-mtune=core2//' ${MAKEFILE}
sed -i.bak 's/-mtune=core2//' ./longread-one/Makefile
rm -rf ./*.bak
rm -rf ./longread-one/*.bak
fi

export C_INCLUDE_PATH=${PREFIX}/include
export LIBRARY_PATH=${PREFIX}/lib
make -f $MAKEFILE CC_EXEC="$CC -L$PREFIX/lib -fcommon" -j ${CPU_COUNT}
export C_INCLUDE_PATH="${PREFIX}/include"
export LIBRARY_PATH="${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export C="${CC}"

make -f $MAKEFILE CC_EXEC="$C -L$PREFIX/lib -fcommon" -j"${CPU_COUNT}"

cd ..
cp bin/utilities/* $PREFIX/bin
rm -r bin/utilities
cp bin/* $PREFIX/bin
cp annotation/* $PREFIX/annotation
install -v -m 0755 bin/utilities/flattenGTF bin/utilities/genRandomReads \
bin/utilities/propmapped bin/utilities/qualityScores \
bin/utilities/removeDup bin/utilities/repair \
bin/utilities/subread-fullscan "${PREFIX}/bin"
rm -rf bin/utilities

install -v -m 0755 bin/exactSNP bin/featureCounts bin/subindel bin/subjunc \
bin/sublong bin/subread-align bin/subread-buildindex "${PREFIX}/bin"
cp -rf annotation/* $PREFIX/annotation

# add read permissions to LICENSE
chmod a+r LICENSE
chmod a+r LICENSE
27 changes: 17 additions & 10 deletions recipes/subread/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set name = "subread" %}
{% set version = "2.0.6" %}
{% set sha256 = "f0fdda6b98634d2946028948c220253e10a0f27c7fa5f24913b65b3ac6cbb045" %}
{% set version = "2.0.8" %}
{% set sha256 = "cb5dadf71c850f128a8347223fe0ce19e1c17e3959e9f3eba90e8090671f8570" %}

package:
name: {{ name|lower }}
Expand All @@ -11,10 +11,15 @@ source:
sha256: {{ sha256 }}
patches:
- unsignedchar.patch
- 0001-macOS-Makefile.patch # [osx]
- 0002-longread-Makefile.patch
- 0003-Linux-Makefile.patch # [linux]
- 0004-macOS-sse.patch # [osx and x86_64]

build:
number: 2
run_exports: '{{ pin_subpackage(name, max_pin="x") }}'
number: 0
run_exports:
- {{ pin_subpackage(name, max_pin="x") }}

requirements:
build:
Expand All @@ -32,20 +37,22 @@ test:
- subjunc || [[ $? == 1 ]]
- subindel || [[ $? = 255 ]]
- repair -h
- txUnique || [[ $? == 1 ]]
- qualityScores
- subread-fullscan || [[ $? == 255 ]]

about:
home: http://subread.sourceforge.net/
license: GPL-3.0-only
summary: High-performance read alignment, quantification, and mutation discovery
license_file:
- LICENSE
home: "https://subread.sourceforge.net"
license: "GPL-3.0-only"
license_family: GPL3
summary: "High-performance read alignment, quantification, and mutation discovery."
doc_url: "https://subread.sourceforge.net/SubreadUsersGuide.pdf"
dev_url: "https://sourceforge.net/projects/subread"
license_file: LICENSE

extra:
additional-platforms:
- linux-aarch64
- osx-arm64
identifiers:
- biotools:subread
- usegalaxy-eu:featurecounts
Expand Down