Skip to content

Commit 79f0bf0

Browse files
committed
[misc] deactivate BIFM by default
1 parent 35e7204 commit 79f0bf0

File tree

8 files changed

+63
-19
lines changed

8 files changed

+63
-19
lines changed

.github/workflows/ci_linux.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24+
- name: "gcc12 bifm"
25+
install: "g++-12"
26+
cxx: "g++-12"
27+
cmake_flags: "-DLAMBDA_WITH_BIFM=1"
28+
cc: "gcc-12"
29+
build_type: Release
30+
2431
- name: "gcc12"
2532
install: "g++-12"
2633
cxx: "g++-12"
@@ -94,7 +101,7 @@ jobs:
94101
run: |
95102
mkdir build
96103
cd build
97-
cmake ../lambda -DLAMBDA_COMPILE_THREADS=2 -DLAMBDA_NATIVE_BUILD=OFF -DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
104+
cmake ../lambda -DLAMBDA_COMPILE_THREADS=2 -DLAMBDA_NATIVE_BUILD=OFF ${{ matrix.cmake_flags }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
98105
99106
- name: Build tests
100107
if: matrix.name != 'clang_format'

CMakeLists.txt

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ if (NOT CMAKE_BUILD_TYPE)
2222
FORCE)
2323
endif ()
2424

25+
# ----------------------------------------------------------------------------
26+
# Options
27+
# ----------------------------------------------------------------------------
28+
29+
option (LAMBDA_WITH_BIFM "Include codepaths for bidirectional indexes." OFF)
30+
31+
if (LAMBDA_WITH_BIFM)
32+
add_definitions (-DLAMBDA_WITH_BIFM=1)
33+
endif ()
34+
2535
# ----------------------------------------------------------------------------
2636
# Begin of dependency detection
2737
# ----------------------------------------------------------------------------

src/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ message ("\n${ColourBold}Build configuration${ColourReset}")
3030
message (STATUS "LAMBDA version is: ${SEQAN_APP_VERSION}")
3131

3232
option (LAMBDA_STATIC_BUILD "Include all libraries in the binaries." OFF)
33+
option (LAMBDA_WITH_BIFM "Include codepaths for bidirectional indexes." OFF)
3334

3435
if (LAMBDA_STATIC_BUILD)
3536
add_definitions (-DLAMBDA_STATIC_BUILD=1)
@@ -47,9 +48,13 @@ if (LAMBDA_STATIC_BUILD)
4748
endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
4849
endif (LAMBDA_STATIC_BUILD)
4950

51+
if (LAMBDA_WITH_BIFM)
52+
add_definitions (-DLAMBDA_WITH_BIFM=1)
53+
endif ()
5054

5155
message(STATUS "The following options are selected for the build:")
5256
message( " LAMBDA_STATIC_BUILD ${LAMBDA_STATIC_BUILD}")
57+
message( " LAMBDA_WITH_BIFM ${LAMBDA_WITH_BIFM}")
5358
message(STATUS "Run 'cmake -LH' to get a comment on each option.")
5459
message(STATUS "Remove CMakeCache.txt and re-run cmake with -DOPTIONNAME=ON|OFF to change an option.")
5560

src/mkindex.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ void argConv0(LambdaIndexerOptions & options)
103103
case DbIndexType::FM_INDEX:
104104
return argConv1<DbIndexType::FM_INDEX>(options);
105105
case DbIndexType::BI_FM_INDEX:
106+
#if LAMBDA_WITH_BIFM
106107
return argConv1<DbIndexType::BI_FM_INDEX>(options);
108+
#else
109+
throw std::runtime_error{
110+
"To create bidirectional indexes, you need to rebuild lambda with LAMBDA_WITH_BIFM=1 ."};
111+
#endif
107112
default:
108113
throw 42;
109114
}

src/search.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ void argConv0(LambdaOptions & options)
248248
case DbIndexType::FM_INDEX:
249249
return argConv1<DbIndexType::FM_INDEX>(options);
250250
case DbIndexType::BI_FM_INDEX:
251+
#if LAMBDA_WITH_BIFM
251252
return argConv1<DbIndexType::BI_FM_INDEX>(options);
253+
#else
254+
throw std::runtime_error{
255+
"To open bidirectional indexes, you need to rebuild lambda with LAMBDA_WITH_BIFM=1 ."};
256+
#endif
252257
default:
253258
throw 52;
254259
}

src/shared_definitions.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
#include "view_duplicate.hpp"
5252
#include "view_reduce_to_bisulfite.hpp"
5353

54+
#ifndef LAMBDA_WITH_BIFM
55+
# define LAMBDA_WITH_BIFM 0
56+
#endif
57+
5458
// ==========================================================================
5559
// DbIndexType
5660
// ==========================================================================

test/cli/index_test.cpp

+22-18
Original file line numberDiff line numberDiff line change
@@ -135,44 +135,48 @@ TEST_F(index_test, nucl_fm)
135135
run_index_test("mkindexn", "db_nucl.fasta.gz", "db_nucl_fm_test.fasta.gz.lba", "fm", "", "db_nucl_fm.fasta.gz.lba");
136136
}
137137

138-
TEST_F(index_test, nucl_bifm)
139-
{
140-
run_index_test("mkindexn", "db_nucl.fasta.gz", "db_nucl_bifm_test.fasta.gz.lba", "bifm", "",
141-
"db_nucl_bifm.fasta.gz.lba");
142-
}
143-
144138
TEST_F(index_test, nucl_bs_fm)
145139
{
146140
run_index_test("mkindexbs", "db_nucl_bs.fasta.gz", "db_nucl_bs_fm_test.fasta.gz.lba", "fm", "",
147141
"db_nucl_bs_fm.fasta.gz.lba");
148142
}
149143

150-
TEST_F(index_test, nucl_bs_bifm)
151-
{
152-
run_index_test("mkindexbs", "db_nucl_bs.fasta.gz", "db_nucl_bs_bifm_test.fasta.gz.lba", "bifm", "",
153-
"db_nucl_bs_bifm.fasta.gz.lba");
154-
}
155-
156144
TEST_F(index_test, prot_fm)
157145
{
158146
run_index_test("mkindexp", "db_prot.fasta.gz", "db_prot_fm_test.fasta.gz.lba", "fm", "li10",
159147
"db_prot_fm.fasta.gz.lba");
160148
}
161149

162-
TEST_F(index_test, prot_bifm)
163-
{
164-
run_index_test("mkindexp", "db_prot.fasta.gz", "db_prot_bifm_test.fasta.gz.lba", "bifm", "li10",
165-
"db_prot_bifm.fasta.gz.lba");
166-
}
167-
168150
TEST_F(index_test, trans_fm)
169151
{
170152
run_index_test("mkindexp", "db_nucl.fasta.gz", "db_trans_fm_test.fasta.gz.lba", "fm", "li10",
171153
"db_trans_fm.fasta.gz.lba");
172154
}
173155

156+
#if LAMBDA_WITH_BIFM
157+
158+
TEST_F(index_test, nucl_bifm)
159+
{
160+
run_index_test("mkindexn", "db_nucl.fasta.gz", "db_nucl_bifm_test.fasta.gz.lba", "bifm", "",
161+
"db_nucl_bifm.fasta.gz.lba");
162+
}
163+
164+
TEST_F(index_test, nucl_bs_bifm)
165+
{
166+
run_index_test("mkindexbs", "db_nucl_bs.fasta.gz", "db_nucl_bs_bifm_test.fasta.gz.lba", "bifm", "",
167+
"db_nucl_bs_bifm.fasta.gz.lba");
168+
}
169+
170+
TEST_F(index_test, prot_bifm)
171+
{
172+
run_index_test("mkindexp", "db_prot.fasta.gz", "db_prot_bifm_test.fasta.gz.lba", "bifm", "li10",
173+
"db_prot_bifm.fasta.gz.lba");
174+
}
175+
174176
TEST_F(index_test, trans_bifm)
175177
{
176178
run_index_test("mkindexp", "db_nucl.fasta.gz", "db_trans_bifm_test.fasta.gz.lba", "bifm", "li10",
177179
"db_trans_bifm.fasta.gz.lba");
178180
}
181+
182+
#endif

test/cli/search_test.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ TEST_F(search_test, tblastx_fm_bam)
395395

396396
// Search with bi-directional index
397397

398+
#if LAMBDA_WITH_BIFM
399+
398400
// TEST_F(search_test, blastn_bifm_m8)
399401
// {
400402
// run_search_test("mkindexn", "db_nucl.fasta.gz", "db_nucl_bifm.fasta.gz.lba", "bifm", "", "searchn",
@@ -467,6 +469,8 @@ TEST_F(search_test, tblastx_bifm_sam)
467469
"queries_nucl.fasta.gz", "none", "output_tblastx_bifm_test.sam", "sam", "output_tblastx_fm.sam");
468470
}
469471

472+
#endif
473+
470474
// Fast mode
471475

472476
TEST_F(search_test, blastn_fm_fast_m8)

0 commit comments

Comments
 (0)