Skip to content

Commit c149d4f

Browse files
committed
Fix sts without beagle
1 parent 5484c16 commit c149d4f

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ IF(USE_BEAGLE)
7272
link_directories(${HMS_BEAGLE_LIBRARY_DIRS})
7373
ELSE(USE_BEAGLE)
7474
SET(NO_BEAGLE "1")
75+
add_definitions("-DNO_BEAGLE")
7576
ENDIF(USE_BEAGLE)
7677

7778
# Bio++

src/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ configure_file (
66
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/online")
77
file(GLOB STS_CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/online/*.cc)
88

9+
IF(NO_BEAGLE)
10+
list(REMOVE_ITEM STS_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/online/beagle_flexible_tree_likelihood.cc")
11+
list(REMOVE_ITEM STS_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/online/beagle_tree_likelihood.cc")
12+
ENDIF(NO_BEAGLE)
13+
914
add_library(sts-static STATIC ${STS_CPP_FILES})
1015

1116
set(STS_PHYLO_LIBS

src/online/util.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
///
44
#include "util.h"
55

6+
#ifndef NO_BEAGLE
67
#include "libhmsbeagle/beagle.h"
8+
#endif
79

810
#include <Bpp/Phyl/PatternTools.h>
911
#include <Bpp/Seq/Container/SequenceContainer.h>
@@ -87,7 +89,7 @@ bpp::SiteContainer* unique_sites(const bpp::SiteContainer& sites, bool verbose)
8789
return compressed;
8890
}
8991

90-
92+
#ifndef NO_BEAGLE
9193
std::string beagle_errstring(const int beagle_error_code)
9294
{
9395
switch(beagle_error_code) {
@@ -109,7 +111,7 @@ void beagle_check(int return_code)
109111
if(return_code != BEAGLE_SUCCESS)
110112
throw std::runtime_error(sts::util::beagle_errstring(return_code));
111113
}
112-
114+
#endif
113115

114116
double effectiveSampleSize(const std::vector<double>& logWeights)
115117
{

test/test_sts_flexible_tree_likelihood.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ void testAttachmentLikelihoodDeriv(const std::string& tree_path, const std::stri
376376
ASSERT_FALSE(tree->isMultifurcating());
377377

378378
std::vector<string> names = aln->getSequencesNames();
379+
tree->getRootNode()->getSon(0)->setDistanceToFather(tree->getRootNode()->getSon(0)->getDistanceToFather()+tree->getRootNode()->getSon(1)->getDistanceToFather());
380+
tree->getRootNode()->getSon(1)->setDistanceToFather(1e-6);
379381

380382
for(const string& leafName : tree->getLeavesNames()) {
381383
bpp::TreeTemplate<Node> tmpTree(*tree);

0 commit comments

Comments
 (0)