Builds without support for OpenMP failed with the old code. Fix this:
* Add OPENMP_CXXFLAGS for ccmain.
* Replace unconditional -fopenmp by OPENMP_CXXFLAGS for lstm.
* Always use _OPENMP for conditional compilation.
* Remove OPENMP as there is already _OPENMP.
* Include omp.h conditionally.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366441 (#1 of 1): Division or modulo by float zero (DIVIDE_BY_ZERO)
5. divide_by_zero: In expression
static_cast<double>(char_errors) / truth_size, division by expression
truth_size which may be zero has undefined behavior.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366443 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
3. var_deref_model: Passing null pointer this->sub_trainer_ to
training_iteration, which dereferences it.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366448 (#1 of 1): Big parameter passed by value (PASS_BY_VALUE)
pass_by_value: Passing parameter recoder of type
tesseract::UnicharCompress const (size 240 bytes) by value.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366450 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
4. uninit_member: Non-static class member beam_size_ is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Coverity report:
CID 1366452 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)
18. uninit_member: Non-static class member input_width_ is not initialized
in this constructor nor in any functions that it calls.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
gcc report:
lstm/lstmrecognizer.cpp:608:47: error: 'isnan' was not declared in this scope
ASSERT_HOST(!isnan(output.f(t)[null_char_]));
Signed-off-by: Stefan Weil <sw@weilnetz.de>