diamond icon indicating copy to clipboard operation
diamond copied to clipboard

Build failure with latest version of blast+ and cmake

Open kbipinkumar opened this issue 6 months ago • 3 comments

while packaging 2.1.12 version of diamond for arch Linux we encountered build failures.

First one being, the build fails with ncbi-tools++ headers bundled with most recent version of blast+ (2.16.0) installed.

[ 55%] Building CXX object CMakeFiles/diamond.dir/src/tools/benchmark_io.cpp.o
In file included from /usr/include/ncbi-tools++/util/bitset/ncbi_bitset.hpp:38,
                 from /usr/include/ncbi-tools++/serial/serialbase.hpp:46,
                 from /usr/include/ncbi-tools++/objects/seqloc/Seq_id_.hpp:43,
                 from /usr/include/ncbi-tools++/objects/seqloc/Seq_id.hpp:42,
                 from /usr/include/ncbi-tools++/objtools/blast/seqdb_reader/seqdbcommon.hpp:43,
                 from /usr/include/ncbi-tools++/objtools/blast/seqdb_reader/seqdb.hpp:43,
                 from /usr/include/ncbi-tools++/objtools/blast/seqdb_reader/seqdbexpert.hpp:41,
                 from /build/diamond/src/diamond-2.1.12/src/data/blastdb/blastdb.h:2,
                 from /build/diamond/src/diamond-2.1.12/src/tools/benchmark_io.cpp:24:
/usr/include/ncbi-tools++/util/bitset/bm.h: In member function ‘bm::bvector<A>::bulk_insert_iterator& bm::bvector<A>::bulk_insert_iterator::operator=(const bm::bvector<A>::bulk_insert_iterator&)’:
/usr/include/ncbi-tools++/util/bitset/bm.h:526:32: error: ‘bm::bvector<A>::bulk_insert_iterator::bvector_type’ has no member named ‘allocate_tempblock’ [-Wtemplate-body]
  526 |                 buf_ = bvect_->allocate_tempblock();
      |                                ^~~~~~~~~~~~~~~~~~
/usr/include/ncbi-tools++/util/bitset/bm.h: In member function ‘bm::bvector<A>::bulk_insert_iterator& bm::bvector<A>::bulk_insert_iterator::operator=(bm::bvector<A>::bulk_insert_iterator&&)’:
/usr/include/ncbi-tools++/util/bitset/bm.h:537:25: error: ‘bm::bvector<A>::bulk_insert_iterator::bvector_type’ has no member named ‘free_tempblock’ [-Wtemplate-body]
  537 |                 bvect_->free_tempblock(buf_);
      |                         ^~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
make[2]: *** [CMakeFiles/diamond.dir/build.make:1129: CMakeFiles/diamond.dir/src/tools/benchmark_io.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:194: CMakeFiles/diamond.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

complete log is attached here. any help in troubleshooting the same is appreciated

in addition, build process also fails to start with cmake version 4.0 and above

==> Extracting sources...
  -> Extracting diamond-2.1.12.tar.gz with bsdtar
==> Starting build()...
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

we were able to overcome this error by changing cmake_minimum_required (VERSION 2.6) to cmake_minimum_required (VERSION 3.5) CMakeLists.txt before invoking cmake.

kbipinkumar avatar Jun 02 '25 19:06 kbipinkumar

Looks like an error in the NCBI code, that has been fixed now. I managed to compile it using this procedure: https://github.com/bbuchfink/diamond/blob/master/Dockerfile

bbuchfink avatar Jun 03 '25 07:06 bbuchfink

thanks for the suggestions. i was attempting to build against libraries supplied with blast+ code as suggested here in the wiki instead of ncbi c++ toolkit.

Earlier versions of diamond used to compile with blast+ source but not the current the release.

kbipinkumar avatar Jun 25 '25 07:06 kbipinkumar

I got the same error compiling BLAST 2.16 itself using GCC 15. It needs to be fixed by NCBI, or you can use the ncbi-toolkit method.

bbuchfink avatar Jul 04 '25 11:07 bbuchfink