hh-suite icon indicating copy to clipboard operation
hh-suite copied to clipboard

Please update embedded copy of ffindex to v0.9.9.9 from v0.9.8.0

Open mr-c opened this issue 3 years ago • 4 comments

For the Debian package of hhsuite we used the Debian package of ffindex version 0.9.9.9, but this leads to a build error:

[ 66%] Building CXX object src/CMakeFiles/HH_OBJECTS.dir/ffindexdatabase.cpp.o
cd /build/hhsuite-3.3.0/mybuild/src && /usr/lib/ccache/c++ -DOPENMP -I/build/hhsuite-3.3.0/mybuild/generated -I/build/hhsuite-3.3.0/src -I/build/hhsuite-3.3.0/lib/simde -I/build/hhsuite-3.3.0/lib/simd -I/build/hhsuite-3.3.0/mybuild/src -I/build/hhsuite-3.3.0/src/cs -g -O2 -fdebug-prefix-map=/build/hhsuite-3.3.0=. -fstack-protector-strong -Wformat -Werror=format-security -include stdlib.h -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++0x -fsigned-char -mfpmath=sse -fopenmp -fno-strict-aliasing -o CMakeFiles/HH_OBJECTS.dir/ffindexdatabase.cpp.o -c /build/hhsuite-3.3.0/src/ffindexdatabase.cpp
/build/hhsuite-3.3.0/src/ffindexdatabase.cpp: In destructor 'virtual FFindexDatabase::~FFindexDatabase()':
/build/hhsuite-3.3.0/src/ffindexdatabase.cpp:37:5: error: 'ffindex_index_free' was not declared in this scope; did you mean 'ffindex_index_parse'?
   37 |     ffindex_index_free(db_index);
      |     ^~~~~~~~~~~~~~~~~~
      |     ffindex_index_parse

mr-c avatar Aug 31 '20 08:08 mr-c

We only support using the bundled ffindex and treat it as the same project now.

milot-mirdita avatar Aug 31 '20 09:08 milot-mirdita

@milot-mirdita That is unfortunate. Here is a patch I developed which appears to fix the build issue:

From: Michael R. Crusoe <[email protected]>
Subject: Enable compatibility with recent ffindex versions

In ffindex v0.9.9.9 (and possibly earlier) it appears that the db_index is
automatically freed. Additionally, the function ffindex_index_free does not
exist in the upstream codebase.

--- hhsuite.orig/src/ffindexdatabase.cpp
+++ hhsuite/src/ffindexdatabase.cpp
@@ -34,7 +34,6 @@
 
 FFindexDatabase::~FFindexDatabase() {
     free(data_filename);
-    ffindex_index_free(db_index);
     munmap(db_data, data_size);
     fclose(db_data_fh);
 }

mr-c avatar Aug 31 '20 09:08 mr-c

Previously it was just leaking this memory. Usually it's not a problem since it's leaking it just before finishing.

I would still recommend to either build the ffindex binaries from the HH-suite codebase or ship everything as one package together.

milot-mirdita avatar Aug 31 '20 10:08 milot-mirdita

Especially since we are occasionally still doing some development: https://github.com/soedinglab/hh-suite/commits/master/lib/ffindex

milot-mirdita avatar Aug 31 '20 10:08 milot-mirdita