Skip to content

Commit 34db067

Browse files
committed
[FEATURE] warn user on execution if binary was not built in release mode
1 parent 8508a7e commit 34db067

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ add_definitions (-DSEQAN_VERSION_STRING="${SEQAN_VERSION_STRING}")
111111
add_definitions (-DSEQAN_REVISION="${SEQAN_REVISION}")
112112
add_definitions (-DSEQAN_DATE="${SEQAN_DATE}")
113113
add_definitions (-DSEQAN_APP_VERSION="${SEQAN_APP_VERSION}")
114+
add_definitions (-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
114115

115116
# Update the list of file names below if you add source files to your application.
116117
add_executable (lambda lambda.cpp

src/lambda.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,11 @@ int main(int argc, char const ** argv)
155155
// // << "\ntrivially_copy: " << std::is_trivially_copyable<Match>::value
156156
// << "\n";
157157

158+
if (std::string(CMAKE_BUILD_TYPE) != "Release")
159+
std::cerr << "WARNING: This binary is not built in release mode and will be much slower than it should be!\n";
158160
return argConv0(options);
159161
}
160162

161-
162163
// CONVERT Run-time options to compile-time Format-Type
163164
inline int
164165
argConv0(LambdaOptions const & options)

src/lambda_indexer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ int main(int argc, char const ** argv)
8787
if (res != seqan::ArgumentParser::PARSE_OK)
8888
return res == seqan::ArgumentParser::PARSE_ERROR;
8989

90+
if (std::string(CMAKE_BUILD_TYPE) != "Release")
91+
std::cerr << "WARNING: This binary is not built in release mode and will be much slower than it should be!\n";
9092
return argConv0(options);
9193
}
9294

src/options.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ parseCommandLine(LambdaIndexerOptions & options, int argc, char const ** argv)
894894
ArgParseArgument::STRING,
895895
"STR"));
896896
setValidValues(parser, "algorithm", "mergesort quicksortbuckets quicksort radixsort skew7ext");
897-
setDefaultValue(parser, "algorithm", "mergesort");
897+
setDefaultValue(parser, "algorithm", "radixsort");
898898
setAdvanced(parser, "algorithm");
899899

900900
#ifdef _OPENMP
@@ -1188,7 +1188,8 @@ printOptions(LambdaOptions const & options)
11881188
<< " EXTENSION\n"
11891189
<< " x-drop: " << options.xDropOff << "\n"
11901190
<< " band: " << bandStr << "\n"
1191-
<< " BUILD FLAGS:\n"
1191+
<< " BUILD OPTIONS:\n"
1192+
<< " cmake_build_type: " << std::string(CMAKE_BUILD_TYPE) << "\n"
11921193
<< " fastbuild: "
11931194
#if defined(FASTBUILD)
11941195
<< "on\n"
@@ -1207,7 +1208,7 @@ printOptions(LambdaOptions const & options)
12071208
#else
12081209
<< "off\n"
12091210
#endif
1210-
<< " mmapped_strings: "
1211+
<< " mmapped_db: "
12111212
#if defined(LAMBDA_MMAPPED_DB)
12121213
<< "on\n"
12131214
#else

0 commit comments

Comments
 (0)