Skip to content

Commit

Permalink
Add FMSI (#51277)
Browse files Browse the repository at this point in the history
* Initial version of adding FMSI to bioconda.

* Corrected LICENSE.

* FMSI recipe: do not build SDSL but have it as dependency.

* clean up recipe

* clean up recipe

* clean up recipe

* try patching makefile

* add patches section

* edit chmod command

* do not build on aarch64/arm64

* add D_LIBCPP_DISABLE_AVAILABILITY

* linux-aarch64 build

---------

Co-authored-by: mencian <[email protected]>
Co-authored-by: Joshua Zhuang <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 5026036 commit a4d30f9
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 0 deletions.
29 changes: 29 additions & 0 deletions recipes/fmsi/0001-Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/Makefile b/src/Makefile
index 6272ad5..473407a 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,10 +1,10 @@
.PHONY: all clean
-CXX= g++
-CXXFLAGS= -g -Wall -Wno-unused-function -std=c++17 -O2
-PROG= ../fmsi
-INCLUDES-PATH?=.
+CXX= ${CXX}
+CXXFLAGS= -g -Wall -Wno-unused-function -std=c++17 -O3
+PROG= ${PREFIX}/bin/fmsi
+INCLUDES-PATH?= ${PREFIX}
INCLUDES= -I$(INCLUDES-PATH)/include -L$(INCLUDES-PATH)/lib
-LIBS= -lz -lsdsl -ldivsufsort -ldivsufsort64
+LIBS+= -lz -lsdsl -ldivsufsort -ldivsufsort64 -L${PREFIX}/lib

all:$(PROG)

@@ -14,7 +14,7 @@ include/sdsl/suffix_arrays.hpp: sdsl-lite/build/Makefile
$(MAKE) -C sdsl-lite/build install

sdsl-lite/build/Makefile:
- cd sdsl-lite/build && cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../.. ..
+ cd sdsl-lite/build && cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=${PREFIX} ..


$(PROG): $(wildcard *.cpp *.c *.h) ./include/sdsl/suffix_arrays.hpp version.h
7 changes: 7 additions & 0 deletions recipes/fmsi/0002-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
diff --git a/src/version b/src/version
index ee1372d..abd4105 100644
--- a/src/version
+++ b/src/version
@@ -1 +1 @@
-0.2.2
+${PKG_VERSION}
20 changes: 20 additions & 0 deletions recipes/fmsi/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

mkdir -p ${PREFIX}/bin

export INCLUDES="-I${PREFIX}/include"
export LIBPATH="-L${PREFIX}/lib"
export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include"

if [[ `uname` == "Darwin" ]]; then
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
else
export CXXFLAGS="${CXXFLAGS}"
fi

make CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \
-j"${CPU_COUNT}"

chmod 0755 ${PREFIX}/bin/fmsi
49 changes: 49 additions & 0 deletions recipes/fmsi/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% set version = "0.2.4" %}
{% set sha256 = "67c930b8bad30e786fb7a59cc8592e1a7231024debc95af7e2c203bb7022b0b3" %}

package:
name: fmsi
version: {{ version }}

source:
url: https://github.com/OndrejSladky/fmsi/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- 0001-Makefile.patch
- 0002-version.patch

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

requirements:
build:
- make
- cmake
- {{ compiler('cxx') }}
host:
- zlib
- sdsl-lite
run:
- sdsl-lite

test:
commands:
- fmsi -h 2>&1 | grep "FMSI"

about:
home: "https://github.com/OndrejSladky/fmsi"
license: MIT
license_family: MIT
license_file: LICENSE
summary: "FMSI - memory efficient k-mer set index based on masked superstrings and Burrows-Wheeler transform."
dev_url: "https://github.com/OndrejSladky/fmsi"
doc_url: "https://github.com/OndrejSladky/fmsi/blob/v{{ version }}/README.md"

extra:
identifiers:
- doi:10.1101/2024.03.06.583483
- doi:10.1101/2023.02.01.526717
additional-platforms:
- linux-aarch64

0 comments on commit a4d30f9

Please sign in to comment.