Illumina / manta

Structural variant and indel caller for mapped sequencing data
GNU General Public License v3.0
404 stars 154 forks source link

fail to build on centos 7 #187

Closed jmercier-lbi closed 5 years ago

jmercier-lbi commented 5 years ago

Dear,

I am trying to build manta from source but I have a wall of error such as:

ERROR   manta-1.5.0: manta-1.5.0/src/c++/lib/applications/GenerateSVCandidates/SVFinder.cpp:630:1: error: style:The scope of the variable 'readSuppBp' can be reduced. Warning: Be careful when fixing this message, especially when there are inner loops. Here is an example where cppcheck will write that the scope for 'i' can be reduced:
FINE    manta-1.5.0: void f(int x)
FINE    manta-1.5.0: {
FINE    manta-1.5.0: int i = 0;
FINE    manta-1.5.0: if (x) {
FINE    manta-1.5.0: // it's safe to move 'int i = 0;' here
FINE    manta-1.5.0: for (int n = 0; n < 10; ++n) {
FINE    manta-1.5.0: // it is possible but not safe to move 'int i = 0;' here
FINE    manta-1.5.0: do_something(&i);
FINE    manta-1.5.0: }
FINE    manta-1.5.0: }
FINE    manta-1.5.0: }
FINE    manta-1.5.0: When you see this message it is always safe to reduce the variable scope 1 level.
ERROR   manta-1.5.0: manta-1.5.0/src/c++/lib/applications/GenerateSVCandidates/SVScorer.cpp:81:1: error: style:Consider using std::count_if algorithm instead of a raw loop.
ERROR   manta-1.5.0: manta-1.5.0/src/c++/lib/applications/GenerateSVCandidates/test/EdgeRetrieverBinTest.cpp:29:1: error: error:There is an unknown macro here somewhere. Configuration is required. If BOOST_AUTO_TEST_SUITE is a macro then please configure it.

I tried to fix the second error with BOOST_AUTO_TEST_SUITE applying boost guideline as follow:

for testFile in $(find src/c++ -type f -name '*Test.cpp' ); do
    testFileBasename=$(basename "${testFile}" .cpp)
    sed -i "/\"boost\/test\/unit_test.hpp\"/c\#define BOOST_TEST_MODULE ${testFileBasename}\n#include <boost/test/included/unit_test.hpp>" "${testFile}"
done

Which gave as example for src/c++/lib/alignment/test/AlignmentUtilTest.cpp:

#define BOOST_TEST_MODULE AlignmentUtilTest
#include <boost/test/included/unit_test.hpp>

But that do not fix this error

Anyway it would be welcome to be able to build manta offline and used our already built samtools release maybe for this purpose commenting add_subdirectory (redist) line from CMakeLists.txt is enough

sed -i 's/add_subdirectory (redist)/# &/' CMakeLists.txt

Thanks for your help best regards

ctsa commented 5 years ago

These are issues form newer versions of cppcheck. You can hide cppcheck from the build process or set DEVELOPER_MODE to false in the build system.