Skip to content
Commits on Source (3)
.git/
.idea/
bin/
build/
test/
cmake-build-debug/
cmake-build-release/
# Object files
*.o
*.ko
*.obj
*.elf
# Libraries
*.lib
*.a
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Build directory
/build
.*\.o
test_big
bin
lib
include
# Ubuntu 14.04 Trusty support
sudo: required
dist: trusty
addons:
apt:
packages:
- cmake
before_install:
- git submodule update --init --recursive
script:
- mkdir build
- cd build
- cmake .. && make
# - CTEST_OUTPUT_ON_FAILURE=TRUE make test
matrix:
include:
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- mpi-default-dev
env: CXX=g++-4.9
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- mpi-default-dev
env: CXX=g++-5
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
- mpi-default-dev
env: CXX=g++-6
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
packages:
- clang-3.6
- mpi-default-dev
env: CXX=clang++-3.6
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.7
packages:
- clang-3.7
- mpi-default-dev
env: CXX=clang++-3.7
- compiler: clang
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
packages:
- clang-3.8
- mpi-default-dev
env: CXX=clang++-3.8
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
SET(HAVE_MPI 1 CACHE BOOL "Have MPI")
project(ffindex C)
include_directories(src)
include_directories(src/ext)
add_subdirectory(src)
FROM alpine:latest as ffindex-builder
RUN apk add --no-cache gcc cmake musl-dev ninja
WORKDIR /opt/ffindex
ADD . .
WORKDIR build
RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
RUN ninja && ninja install
FROM alpine:latest
MAINTAINER Milot Mirdita <milot@mirdita.de>
RUN apk add --no-cache gawk bash grep libstdc++
COPY --from=ffindex-builder /opt/ffindex/build/bin /usr/local/bin/
AUTHOR
FFindex was designed and implemented by Andreas Hauser <andy@splashground.de>.
FFindex was designed and implemented by Andreas Hauser <hauser@genzentrum.lmu.de>.
Please add your name here if you distribute modified versions.
This file must be distributed with any source or binary distribution including
parts of this work, excempt ffutil.h and ffutil.c which are also available
under MIT license.
parts of this work.
SHORT SUMMARY OF THE LICENSE
FFindex is provided under the Create Commons license "Attribution-ShareAlike
Ffindex is provided under the Create Commons license "Attribution-ShareAlike
3.0", which basically captures the spirit of the Gnu Public License (GPL).
See:
......
all:
$(MAKE) -C src $@
%:
$(MAKE) -C src $@
release:
git archive HEAD --prefix "ffindex-`cat VERSION`/" -o "ffindex-`cat VERSION`.tar.gz"
relnotes:
git log --pretty=format:" - %s%n%b"
* Copyright
# FFindex - A database wrapped around mmap
FFindex is a very simple index/database for huge amounts of small files. The
files are stored concatenated in one big data file, seperated by '\0'. A second
file contains a plain text index, giving name, offset and length of of the
small files. The lookup is currently done with a binary search on an array made
from the index file. The attatched binaries (see Usage below) and their source
code shall give an impression of how to use the functions supported by the library in C/C++ code.
## Copyright
FFindex was written by Andreas Hauser <hauser@genzentrum.lmu.de>.
FFindex was written by Andreas Hauser <andy@splpashground.de>.
Please add your name here if you distribute modified versions.
* Martin Steinegger <martin.steinegger@mpibpc.mpg.de>
* Markus Meier <markus.meier@mpibpc.mpg.de>
FFindex is provided under the Create Commons license "Attribution-ShareAlike 3.0",
which basically captures the spirit of the Gnu Public License (GPL).
......@@ -9,85 +21,86 @@ which basically captures the spirit of the Gnu Public License (GPL).
See:
http://creativecommons.org/licenses/by-sa/3.0/
* Thanks
[ ![Codeship Status for soedinglab/ffindex](https://codeship.com/projects/6c26cd00-2247-0133-1269-52bb0fef976f/status?branch=master)](https://codeship.com/projects/96084)
[ ![Build Status](https://travis-ci.org/soedinglab/hh-suite.svg?branch=master)](https://travis-ci.org/soedinglab/ffindex_soedinglab)
## Thanks
Thanks to Laszlo Kajan for creating and maintaining Debian packages
and many suggestions to improve the build and user experience.
* Overview
FFindex is a very simple index/database for huge amounts of small files. The
files are stored concatenated in one big data file, seperated by '\0'. A second
file contains a plain text index, giving name, offset and length of of the
small files. The lookup is currently done with a binary search on an array made
from the index file.
* Installation
$ cd src
$ make
$ make test
## Installation
If you have MPI and want to compile ffindex_apply_mpi:
$ make HAVE_MPI=1
### Compilation
With the sourcecode ready, simply run cmake with the default settings and libraries should be auto-detected:
On OS X use for the first make line:
$ make -f Makefile.osx
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=${INSTALL_BASE_DIR} ..
make
make install
# Please use a sensible value for INSTALL_DIR, e.g. /usr/local or /opt/ffindex
# or $HOME/ffindex instead of "..".
$ make install INSTALL_DIR=..
and with MPI:
**Please use a sensible value for ${INSTALL_BASE_DIR}, e.g. /usr/local or /opt/ffindex or $HOME/ffindex**
$ make install INSTALL_DIR=.. HAVE_MPI=1
* Usage
### Setting environment variables
Please note that before querying or unlinking entries a ffindex must be
sorted, although you can add to it without. So either specify -s with
ffindex_build or sorted later with ffindex_modify -s.
Also the length of the entry names is restricted. See the usage output of
the ffindex_build program.
Setup environment:
$ export PATH="$INSTALL_DIR/bin:$PATH"
$ export LD_LIBRARY_PATH="$INSTALL_DIR/lib:$LD_LIBRARY_PATH"
export PATH="${INSTALL_BASE_DIR}/bin:${PATH}"
export LD_LIBRARY_PATH="${INSTALL_BASE_DIR}/lib:${LD_LIBRARY_PATH}"
On OS X set DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH.
## Usage
Build index from files in test/data and test/data2.
$ ffindex_build -s /tmp/test.data /tmp/test.ffindex test/data test/data2
ffindex_build -s /tmp/test.data /tmp/test.ffindex test/data test/data2
Retrieve three entries:
$ ffindex_get /tmp/test.data /tmp/test.ffindex a b foo
ffindex_get /tmp/test.data /tmp/test.ffindex a b foo
Unlink (Remove reference from index) an entry:
$ ffindex_modify -u /tmp/test.ffindex b
ffindex_modify -u /tmp/test.ffindex b
Retrieve three entries, "b" should now be missing:
$ ffindex_get /tmp/test.data /tmp/test.ffindex a b foo
ffindex_get /tmp/test.data /tmp/test.ffindex a b foo
Convert a Fasta file to ffindex, entry names are incerental IDs starting from 1:
$ ffindex_from_fasta -s fasta.ffdata fasta.ffindex NC_007779.ffn
ffindex_from_fasta -s fasta.ffdata fasta.ffindex NC_007779.ffn
Get first entry by name:
$ ffindex_get fasta.ffdata fasta.ffindex 1
ffindex_get fasta.ffdata fasta.ffindex 1
Get first and third entry by entry index, this a little faster:
$ ffindex_get fasta.ffdata fasta.ffindex -n 1 3
ffindex_get fasta.ffdata fasta.ffindex -n 1 3
Count the characters including header in each entry:
$ ffindex_apply fasta.ffdata fasta.ffindex wc -c
ffindex_apply fasta.ffdata fasta.ffindex wc -c
Count the number of characters in each sequence, without the header:
$ ffindex_apply fasta.ffdata fasta.ffindex perl -ne '$x += length unless(/^>/); END{print "$x\n"}'
ffindex_apply fasta.ffdata fasta.ffindex perl -ne '$x += length unless(/^>/); END{print "$x\n"}'
Parallel version for counting the characters including header in each entry:
$ mpirun -np 4 ffindex_apply_mpi fasta.ffdata fasta.ffindex -- wc -c
mpirun -np 4 ffindex_apply_mpi fasta.ffdata fasta.ffindex -- wc -c
Parallel version for counting the characters including header in each entry and
saving the output to a new ffindex:
$ mpirun -np 4 ffindex_apply_mpi fasta.ffdata fasta.ffindex -i out-wc.ffindex -d out-wc.ffdata -- wc -c
mpirun -np 4 ffindex_apply_mpi fasta.ffdata fasta.ffindex -i out-wc.ffindex -o out-wc.ffdata -- wc -c
0.9.9.6
- Fix OS X builds and integrate Makefile.osx
- Drop OpenMP from compiler flags
- Add ffindex_posix_search.o to make clean
- Avoid non-standard nested function, even so it's the cleanest solution,
since the posix twalk interface is broken. Factor out functions using posix
tree. Use TLS variables to stay threadsafe.
- Fix ffnchomp check
0.9.9.5
- Make use of our parse_long for higher startup performance.
- Add RELEASE_NOTES
- Roll our own parse_ulong instead strtol for speed reasons.
- Fix usage formatting
- Make more clear that tree is already sorted ffindex_modify.c
- Remove unused code in ffindex_modify.c
0.9.9.4 and before
- ffindex_apply is now ffindex_apply_mpi without MPI
- Add src/ffindex_apply_mpi_spawn.c, using spawn istead of fork & exec
- Fix example
- Add collect_data
- Add Markus Meier
- perl5/FFindex.pm: Add copyright. Fix entry reading. Add get_entry* methods.
- Add perl5/test.pl
- Add perl5
- Add each_data
- Return Qnil if not found
- Add method_ffindex_get_data_by_name
- Add first ruby wrapper.
- Add ffindex_db
- Add nginx server module
- Fix memory leak on error
- ffindex_get: Add -f FILE argument to let the keys to retrieve be specified by a file.
- Add ffindex_from_tsv to Makefile
- Add ffindex_from_tsv
- Update RPM spec
- bump version
- Update copyrigths and version.
- Set higher limits. Update version.
- Handle the case where filenames are actually longer than FFINDEX_MAX_ENTRY_NAME_LENTH. This was also security vulnerability.
- fix fprintf
- Add log_file option to ffindex_apply_mpi and rework error handling.
- fix getopt
- merge
- Add ffindex_optimize
- bumb version
- Add -q for quiet
- merge
- Better usage info.
- Make sort work independant from unlink.
- Add ffindex_insert_ffindex().
- Make use of ffindex_index_open in ffindex_from_fasta
- Add ffindex_index_open() and use it in ffindex_build.
- Add -D_GNU_SOURCE=1, probably better here than in source.
- Bump version
- Export FFINDEX_ENTRY_NAME and unlink() temporary ffindexes in ffindex_apply_mpi.
- Print entry and return status of ffindex_apply_mpi to stderr. This allows for further processing based on return status.
- Add MPI to README
- Don't assume string data, make binary data work too.
- Add get_entry_by_name as alias for bsearch
- Fix build for some compilers
- Ma
- Another fix for noncapture and cleanup
- Fix no capture mode
- First beta of apply_mpi output catching to another ffindex
- wip
- wip
- apply_mpi now works with capturing output to another ffindex, but I/O can block.
- Better error message
- More clever root Makefile contributed by Laszlo.
- Add thanks
- Reduce FFINDEX_MAX_ENTRY_NAME_LENTH from 56 to 32 so that by default the malloced space for the index is <2GB. Suggested by Laszlo.
- Add message to indicated number of failed bytes.
- Bump version to 0.980
- Add ffindex_unpack to install and spec and bump version to 0.9.8
- More improvements to usage info for ffindex_build.
- Add better usage info to ffindex_build, proposed by Johannes.
- remove modifies -t from usage
- merge
- merge
- wip ffindex_apply_mpi.c
- Add ffindex_unpack to unpack all entries/files from an ffindex
- Bump version to 0.97
- Check index out of bounds for ffindex_get_entry_by_index
- Add some more usage examples to README
- Add option -n to ffindex_get to use entry index instead of entry name
- Add ifndef wrapper as suggested by Markus.
- Add return check for 1 byte fwrite.
- Don't access index before NULL check. Reporter: Laszlo Karjan.
- Bump version
- Diy OSX build
- Bump version to 0.9.6
- Fix bug data vs. filedata.
- Use optimized interface
- Fix comment
- Conditionalize MPI
- Bump version to 0.9.5.
- Refactor to handle entry lookup outside of ffindex_apply.
- Handling of left over.
- Add first implementation of ffindex_apply_mpi.c.
- Handle EPIPE.
- Add a first version of ffindex_apply, that executes a program for each entry in the ffindex.
- Reflect ffindex_fopen rename.
- Rename ffindex_fopen to ffindex_fopen_by_name. Add ffindex_fopen_by_entry and ffindex_get_data_by_entry.
- Add hgignore
- Clean also .o
- Add it also to osx
- Add ffindex_from_fasta to clean
- Install ffindex_from_fasta
- Improve error handling, especially with empty Index file.
- Add ffindex_get_data_by_index. And rename other ffindex_get functions to be more uniform.
- Use ffindex_get() instead of ffindex_fopen() in ffindex_get program.
- Add ffindex_get to get entry as string.
- Raise FFINDEX_MAX_INDEX_ENTRIES_DEFAULT from 6 million to 40 million
- Make sure ">" is after newline. Better code.
- Add -O2.
- Complete implementation of ffindex_from_fasta.
- Bump version to 0.94
- Sart implementation of ffindex_from_fasta
- Add ffindex_insert_memory().
- Improve README
- Bump version to 0.9.3
- merge
- Better make chdir
- Make usage of tree default in ffindex_modify.
- Make OSX compile again.
- basename() is in libgen.h on BSD.
- Clean ffutil.o too.
- Add deinstall target
- Fix spec libdir
- Fix libdir creation
- bump version
- Fix spec
- Respect lib64
- nicer
- Add a SPEC file for building an RPM package.
- Rework build a little. Build a static library libffindex.a too.
- Add top-level Makefile.
- Fix remaining printf.
- Fix size_t printfs. Use length modifier z.
- Bump version.
- Move textfiles to top.
- Add inclusion clause to LICENSE.
- Add advertisement.
- Fix fclose with ffindex_add_filestream.
- ffindex_build now can incorporate (merge) other ffindexes.
- Add -t to ffindex_modify, which tells ffindex to speedup unlinking using a tree.
- unlink: walk to lists implmentation
- Fix message
- Fix unlink.
- Fix OS X build
- Fix test
- Remove more strnlen. Introduce ffnchomp in ffutil that was renamed from fferror.
- Use strlen instead of strnlen. Sae case and BSD/OS X do not always have strnlen.
- fix includes
- little things
- better documentation
- Add possibility to add single files not only directories. TODO: Decide what should be the name in the index, that is should the whole path be part of the entry name.
- Make INSTALL_DIR usable.
- Add
- Add ffindex_modify that oprates on an existing index. E.g. for unlinking.
- Guard against overwriting existing index or data file
- Add ffindex_unlink
- better tests
- Better error handling
- comment
- Better error handling
- nicer error handling
- nicer error handling
- spell
- Better error handling and messages, especially if malloc failes.
- ffindex_index_parse now takes a second argument specifying the maximum number of entries. A default is used if 0 is specified.
- Add -v for version. Add -f for list_files.
- Small code improvement.
- Add fmemopen for Mac OS X.
- fix warnings
- Add install target.
- - Add license. - Add append and sort.
- Faster parsing. ffindex_mmap interface changed.
- Convert index to struct. Implement bsearch.
- Rest of data type conversion. Ffindex_build now takes offset return value, which is needed e.g. for multiple directory indexing.
- Change *data to from type void* to char* to avoid problems with pointer arithmetics.
- Add test for multiple directory indexing
- Add second test dir.
- Make Makefile more robust.
- Add more functions to header.
- ffindex_get now support multiple entry retrieves.
- Remoove debug extra newlines from ffindex_get output.
- Remove debug print.
- Add clean.
- Add a program to retrieve data from index.
- Fix parameter mixup. Add length to index.
- Add test
- ffindex_fopen
- wip
- primitive ffindex_get_offset
- use read
- init
ffindex (0.9.9.7+soedinglab+git20180802-1) unstable; urgency=medium
* Team upload.
* New upstream source to help compile hhsuite 3
* Removed 'get-orig-source' debian/rules target
* Introduction of 'basename' does not apply and should go through
upstream - skipped
* Removed any notion of _tsv binary that do not seem
available upstream.
-- Steffen moeller <moeller@debian.org> Thu, 02 Aug 2018 18:45:59 +0200
ffindex (0.9.9.7-4) unstable; urgency=medium
* Team upload
......
......@@ -9,9 +9,9 @@ Build-Depends: debhelper (>= 10),
libopenmpi-dev,
openmpi-bin,
chrpath
Standards-Version: 4.0.0
Vcs-Browser: https://anonscm.debian.org/git/debian-med/ffindex.git
Vcs-Git: https://anonscm.debian.org/git/debian-med/ffindex.git
Standards-Version: 4.2.0
Vcs-Browser: https://salsa.debian.org/med-team/ffindex.git
Vcs-Git: https://salsa.debian.org/med-team/ffindex.git
Homepage: http://www.splashground.de/~andy/programs/FFindex/
Package: ffindex
......
usr/include/*
usr/lib/libffindex.a
usr/lib/libffindex.so
src/ffindex_posix_search.h usr/include
# not found
#src/ffindex_posix_search.h usr/include
Index: ffindex/src/CMakeLists.txt
===================================================================
--- ffindex.orig/src/CMakeLists.txt
+++ ffindex/src/CMakeLists.txt
@@ -1,17 +1,32 @@
+cmake_minimum_required(VERSION 3.11)
set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
# sets HAVE_FMEMOPEN
add_subdirectory(ext)
-add_library (ffindex ffindex.c ffutil.c)
+# Adapted from https://stackoverflow.com/questions/2152077/is-it-possible-to-get-cmake-to-build-both-a-static-and-shared-version-of-the-sam
-target_include_directories (ffindex PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+# this is the "object library" target: compiles the sources only once
+add_library(objlib OBJECT ffindex.c ffutil.c)
+target_include_directories (objlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+# shared libraries need PIC
+set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
+
+# shared and static libraries built from the same object files
+add_library(ffindex-static STATIC $<TARGET_OBJECTS:objlib>)
+add_library(ffindex-shared SHARED $<TARGET_OBJECTS:objlib>)
+
+set_target_properties(ffindex-static PROPERTIES OUTPUT_NAME ffindex)
+
+set_target_properties(ffindex-shared PROPERTIES VERSION 0.9.9.7
+ SOVERSION 0
+ OUTPUT_NAME ffindex)
-add_library (ffindex_shared SHARED ffindex.c ffutil.c)
if(NOT HAVE_FMEMOPEN)
- target_link_libraries(ffindex ext)
- target_link_libraries(ffindex_shared ext)
+# target_link_libraries(ffindex ext)
+ target_link_libraries(ffindex-shared ext)
endif()
@@ -19,7 +34,7 @@ endif()
add_executable(ffindex_apply
ffindex_apply_mpi.c
)
-target_link_libraries (ffindex_apply ffindex)
+target_link_libraries (ffindex_apply ffindex-shared)
set_property(TARGET ffindex_apply PROPERTY COMPILE_FLAGS "-UHAVE_MPI")
find_package(MPI)
@@ -27,7 +42,7 @@ if(MPI_C_FOUND AND HAVE_MPI)
add_executable(ffindex_apply_mpi
ffindex_apply_mpi.c
)
- target_link_libraries (ffindex_apply_mpi ffindex)
+ target_link_libraries (ffindex_apply_mpi ffindex-shared)
add_subdirectory(mpq)
set_property(TARGET ffindex_apply_mpi PROPERTY COMPILE_FLAGS "-DHAVE_MPI=1 ${MPI_C_COMPILE_FLAGS}")
@@ -45,48 +60,48 @@ endif()
add_executable(ffindex_reduce
ffindex_reduce.c
)
-target_link_libraries (ffindex_reduce ffindex)
+target_link_libraries (ffindex_reduce ffindex-shared)
add_executable(ffindex_build
ffindex_build.c
)
-target_link_libraries (ffindex_build ffindex)
+target_link_libraries (ffindex_build ffindex-shared)
add_executable(ffindex_from_fasta
ffindex_from_fasta.c
)
-target_link_libraries (ffindex_from_fasta ffindex)
+target_link_libraries (ffindex_from_fasta ffindex-shared)
add_executable(ffindex_get
ffindex_get.c
)
-target_link_libraries (ffindex_get ffindex)
+target_link_libraries (ffindex_get ffindex-shared)
add_executable(ffindex_modify
ffindex_modify.c
)
-target_link_libraries (ffindex_modify ffindex)
+target_link_libraries (ffindex_modify ffindex-shared)
add_executable(ffindex_unpack
ffindex_unpack.c
)
-target_link_libraries (ffindex_unpack ffindex)
+target_link_libraries (ffindex_unpack ffindex-shared)
add_executable(ffindex_order
ffindex_order.c
)
-target_link_libraries (ffindex_order ffindex)
+target_link_libraries (ffindex_order ffindex-shared)
add_executable(ffindex_from_fasta_with_split
ffindex_from_fasta_with_split.c
)
-target_link_libraries (ffindex_from_fasta_with_split ffindex)
+target_link_libraries (ffindex_from_fasta_with_split ffindex-shared)
install(PROGRAMS
@@ -95,15 +110,15 @@ install(PROGRAMS
DESTINATION include
)
-install(TARGETS ffindex
- LIBRARY DESTINATION lib64 COMPONENT libraries
- ARCHIVE DESTINATION lib64 COMPONENT libraries
+install(TARGETS ffindex-static
+ LIBRARY DESTINATION lib COMPONENT libraries
+ ARCHIVE DESTINATION lib COMPONENT libraries
)
-install(TARGETS ffindex_shared
- LIBRARY DESTINATION lib64 COMPONENT libraries
- ARCHIVE DESTINATION lib64 COMPONENT libraries
+install(TARGETS ffindex-shared
+ LIBRARY DESTINATION lib COMPONENT libraries
+ ARCHIVE DESTINATION lib COMPONENT libraries
)
Makefile.patch
basename.patch
#Makefile.patch
#basename.patch
BuildSharedLibraryWithSameSuffix.patch
......@@ -17,7 +17,8 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
FFMANPAGES = ffindex_apply.1 ffindex_build.1 ffindex_from_fasta.1 ffindex_get.1 ffindex_modify.1 ffindex_unpack.1 ffindex_apply_mpi.1 ffindex_from_tsv.1
FFMANPAGES = ffindex_apply.1 ffindex_build.1 ffindex_from_fasta.1 ffindex_get.1 ffindex_modify.1 ffindex_unpack.1
#FFMANPAGES += ffindex_from_tsv.1
ffmanpages: $(FFMANPAGES)
BINNAMES = \
ffindex_apply="apply a program to each FFindex entry";\
......@@ -26,18 +27,21 @@ BINNAMES = \
ffindex_get="retrieve entries from file index";\
ffindex_modify="modify file index entries";\
ffindex_unpack="unpack file index entries";\
ffindex_apply_mpi="apply a program to each FFindex entry (mpi enhanced)";\
ffindex_from_tsv="populate index from TSV file";
# MPI binaries built when openmpi headers+library installed
FFMANPAGES += ffindex_apply_mpi.1
BINNAMES += ffindex_apply_mpi="apply a program to each FFindex entry (mpi enhanced)";
override_dh_installman: $(FFMANPAGES)
dh_installman
$(FFMANPAGES): %.1 : debian/tmp/usr/bin/%
unset LD_PRELOAD && export LD_LIBRARY_PATH=debian/tmp/usr/lib && eval '$(BINNAMES)' && help2man --no-info --no-discard-stderr '--help-option= ' -n "$$$*" --version-option="-v" '$<' -o '$@' --include debian/man_notes.nroff
override_dh_clean:
rm -f $(FFMANPAGES)
dh_clean
override_dh_auto_clean:
dh_auto_clean
rm -rf $(FFMANPAGES) CMakeFiles ext CMakeCache.txt
override_dh_install:
dh_install
......@@ -48,10 +52,6 @@ override_dh_install:
override_dh_auto_test:
dh_auto_test -- FFINDEX_MAX_INDEX_ENTRIES=20000 check
get-orig-source:
mkdir -p ../tarballs
uscan --verbose --force-download --destdir=../tarballs
override_dh_installexamples:
dh_installexamples
cp -aR test $(sampledir)/;
......
version=3
version=4
# Homepage Pattern [Version [Action]]
http://www.splashground.de/~andy/programs/FFindex/ \
ffindex-([0-9][0-9.]*)\.tar\.[gzbl2]{2,3}
# Formerly, does not have ffsort_index
# # Homepage Pattern [Version [Action]]
# http://www.splashground.de/~andy/programs/FFindex/ \
# ffindex-([0-9][0-9.]*)\.tar\.[gzbl2]{2,3}
https://github.com/soedinglab/ffindex_soedinglab
# GitHub hosted projects
opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%ffindex-$1.tar.gz%" \
https://github.com/soedinglab/ffindex_soedinglab/tags \
(?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
#
# A simple perl native Module interfacing FFindex
# written by Andreas Hauser <andreas-source@creative-memory.de
#
package FFindex;
use Sys::Mmap;
sub new
{
my $class = shift;
my $self = {
ffdata_filename => shift,
ffindex_filename => shift,
mode => shift,
ffdata => undef,
ffdata_file => undef,
ffindex_file => undef,
ffindex => [],
ffindex_hash => {},
n_entries => []
};
bless $self, $class;
#new Sys::Mmap $self->{ffdata}, 0, $self->{ffdata_filename} or die $!;
open($self->{ffdata_file}, "<", $self->{ffdata_filename});
mmap($self->{ffdata}, 0, PROT_READ, MAP_SHARED, $self->{ffdata_file}) or die $!;
open($self->{ffindex_file}, "<", $self->{ffindex_filename});
my $fh = $self->{ffindex_file};
my $i = 0;
while( my $line = <$fh>)
{
chomp $line;
my ($name, $offset, $len) = split(/\t/, $line);
$self->{ffindex}[$i] = [$name, $offset, $len];
$self->{ffindex_hash}{$name} = $self->{ffindex}[$i];
$i++;
}
$self->{n_entries} = $i;
return $self;
}
sub get_num_entries()
{
my( $self ) = @_;
return $self->{n_entries};
}
sub get_entry_by_index()
{
my( $self, $index ) = @_;
return $self->{ffindex}[$index];
}
sub get_entry_by_name()
{
my( $self, $qname ) = @_;
return $self->{ffindex_hash}{$qname};
}
sub get_data_by_index()
{
my( $self, $index ) = @_;
my ($name, $offset, $len) = @{$self->{ffindex}[$index]};
return substr($self->{ffdata}, $offset, $len - 1);
}
sub get_data_by_name()
{
my( $self, $qname ) = @_;
my ($name, $offset, $len) = @{$self->{ffindex_hash}{$qname}};
return substr($self->{ffdata}, $offset, $len - 1);
}
sub DESTROY
{
close($self->{ffdata_file});
close($self->{ffindex_file});
$self->{ffindex} = undef;
}
1;