OHDSI Home | Forums | Wiki | Github

CohortMethod Install Problem

I’m getting a problem installing CohortMethod, seems to be a problem compiling Match.h. Does anyone have any suggestions?

install_github(“ohdsi/CohortMethod”)
Downloading GitHub repo ohdsi/CohortMethod@master
from URL https://api.github.com/repos/ohdsi/CohortMethod/zipball/master
Installing CohortMethod
“C:/PROGRA~1/R/R-32~1.3/bin/x64/R” --no-site-file --no-environ --no-save --no-restore --quiet
CMD INSTALL
“D:/Users/msuchard/AppData/Local/Temp/1/RtmpoL7rQF/devtools3ee875e4352f/OHDSI-CohortMethod-09e3ce4”
–library=“D:/Users/msuchard/Documents/R/win-library/3.2” --install-tests

  • installing source package ‘CohortMethod’ …
    ** libs
    g++ -m64 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"D:/Users/msuchard/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local323/include" -O2 -Wall -mtune=core2 -c AdjustedKm.cpp -o AdjustedKm.o
    g++ -m64 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"D:/Users/msuchard/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local323/include" -O2 -Wall -mtune=core2 -c Auc.cpp -o Auc.o
    g++ -m64 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"D:/Users/msuchard/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local323/include" -O2 -Wall -mtune=core2 -c BySum.cpp -o BySum.o
    g++ -m64 -std=c++0x -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"D:/Users/msuchard/Documents/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local323/include" -O2 -Wall -mtune=core2 -c Match.cpp -o Match.o
    In file included from Match.cpp:33:0:
    Match.h:54:11: error: expected nested-name-specifier before ‘PriorityQueue’
    Match.h:54:11: error: using-declaration for non-member at class scope
    Match.h:54:25: error: expected ‘;’ before ‘=’ token
    Match.h:54:25: error: expected unqualified-id before ‘=’ token
    Match.h:65:62: error: ‘PriorityQueue’ has not been declared
    Match.h:69:4: error: ‘PriorityQueue’ does not name a type
    Match.h:73:34: error: ‘PriorityQueue’ has not been declared
    Match.cpp:70:1: error: ‘PriorityQueue’ in ‘struct ohdsi::cohortMethod::Match’ does not name a type
    Match.cpp:98:31: error: ‘PriorityQueue’ has not been declared
    Match.cpp: In member function ‘void ohdsi::cohortMethod::Match::findNewComparator(ohdsi::cohortMethod::MatchPair&, int&)’:
    Match.cpp:104:10: error: request for member ‘push’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:107:10: error: request for member ‘push’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:112:12: error: request for member ‘push’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:114:12: error: request for member ‘push’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp: At global scope:
    Match.cpp:129:22: error: ‘PriorityQueue’ has not been declared
    Match.cpp: In member function ‘unsigned int ohdsi::cohortMethod::Match::matchOnePerTarget(unsigned int, int&)’:
    Match.cpp:131:27: error: request for member ‘top’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:132:10: error: request for member ‘pop’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:156:17: error: request for member ‘empty’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:157:21: error: request for member ‘top’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp:158:14: error: request for member ‘pop’ in ‘heap’, which is of non-class type ‘int’
    Match.cpp: In member function ‘std::vector ohdsi::cohortMethod::Match::match()’:
    Match.cpp:166:134: error: ‘initializeHeap’ was not declared in this scope
    Match.cpp:171:67: error: no matching function for call to ‘ohdsi::cohortMethod::Match::matchOnePerTarget(unsigned int&, std::priority_queue<ohdsi::cohortMethod::MatchPair, std::vectorohdsi::cohortMethod::MatchPair, ohdsi::cohortMethod::ComparePair>&)’
    Match.cpp:171:67: note: candidate is:
    Match.cpp:128:14: note: unsigned int ohdsi::cohortMethod::Match::matchOnePerTarget(unsigned int, int&)
    Match.cpp:128:14: note: no known conversion for argument 2 from ‘std::priority_queue<ohdsi::cohortMethod::MatchPair, std::vectorohdsi::cohortMethod::MatchPair, ohdsi::cohortMethod::ComparePair>’ to ‘int&’
    Match.cpp:171:67: error: unable to deduce ‘auto’ from ‘’
    make: *** [Match.o] Error 1
    Warning: running command ‘make -f “Makevars.win” -f “C:/PROGRA~1/R/R-32~1.3/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-32~1.3/share/make/winshlib.mk” CXX=’$(CXX1X) $(CXX1XSTD)’ CXXFLAGS=’$(CXX1XFLAGS)’ CXXPICFLAGS=’$(CXX1XPICFLAGS)’ SHLIB_LDFLAGS=’$(SHLIB_CXX1XLDFLAGS)’ SHLIB_LD=’$(SHLIB_CXX1XLD)’ SHLIB=“CohortMethod.dll” WIN=64 TCLBIN=64 OBJECTS=“AdjustedKm.o Auc.o BySum.o Match.o RcppExports.o RcppWrapper.o”’ had status 2
    ERROR: compilation failed for package ‘CohortMethod’
  • removing ‘D:/Users/msuchard/Documents/R/win-library/3.2/CohortMethod’
    Error: Command failed (1)

Hmmm, what versions of R and RTools are you running?

I was using a really old R version. Problem went away when I updated.

Just curious: what version of R was causing the problem?

t