jessieren / VirFinder

VirFinder: a novel k-mer based tool for identifying viral sequences from assembled metagenomic data
Other
130 stars 24 forks source link

Bit of trouble installing #1

Closed nmb85 closed 7 years ago

nmb85 commented 7 years ago

All pre-reqs installed. Here is where the trouble begins: VF_cppfunction.cpp:16:1: error: reference to ‘unordered_map’ is ambiguous unordered_map<unsigned long,unsigned long> HashTable; ^~~~~ In file included from /usr/include/c++/6.3.1/unordered_map:48:0, from /usr/lib64/R/library/Rcpp/include/Rcpp/platform/compiler.h:153, from /usr/lib64/R/library/Rcpp/include/Rcpp/r/headers.h:48, from /usr/lib64/R/library/Rcpp/include/RcppCommon.h:29, from /usr/lib64/R/library/Rcpp/include/Rcpp.h:27, from VF_cppfunction.cpp:1: /usr/include/c++/6.3.1/bits/unordered_map.h:98:11: note: candidates are: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::unordered_map class unordered_map ^~~~~ In file included from /usr/include/c++/6.3.1/tr1/unordered_map:42:0, from VF_cppfunction.cpp:2: /usr/include/c++/6.3.1/tr1/unordered_map.h:180:11: note: template<class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> class std::tr1::unordered_map class unordered_map ^~~~~ VF_cppfunction.cpp: In function ‘std::vector reverseFour(std::vector)’: VF_cppfunction.cpp:72:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int revPos = 0; revPos < Four.size(); revPos++)


VF_cppfunction.cpp: In function ‘long unsigned int SeqKmerCountSingle(Rcpp::CharacterVector, int, long unsigned int)’:
VF_cppfunction.cpp:107:4: error: ‘HashTable’ was not declared in this scope
    HashTable[index]++;
    ^~~~~~~~~
VF_cppfunction.cpp: In function ‘void loadToVector(int, long unsigned int, std::vector<double>&)’:
VF_cppfunction.cpp:145:25: error: ‘HashTable’ was not declared in this scope
    kmerCount.push_back((HashTable[currentKmerTen] + HashTable[currentKmerRevTen])/double(2 * total));
                         ^~~~~~~~~
VF_cppfunction.cpp: In function ‘Rcpp::List countSeqFeatureCpp(Rcpp::CharacterVector, int)’:
VF_cppfunction.cpp:174:2: error: ‘HashTable’ was not declared in this scope
  HashTable.clear();
  ^~~~~~~~~
/usr/lib64/R/etc/Makeconf:166: recipe for target 'VF_cppfunction.o' failed
make: *** [VF_cppfunction.o] Error 1
ERROR: compilation failed for package ‘VirFinder’
* removing ‘/usr/lib64/R/library/VirFinder’
Warning message:
In install.packages("/home/fetz/genome/VirFinder/linux/VirFinder_1.1.tar.gz",  :
  installation of package ‘/home/fetz/genome/VirFinder/linux/VirFinder_1.1.tar.gz’ had non-zero exit status
jessieren commented 7 years ago

Hi Nathan,

First, thank you for your interest in VirFinder!

In order to better understand the error, could you please let me know what operating system did you use? I guess it was on a Linux system, is that correct? Did you install the package using the file corresponding to the operating system?

From the error messages, it seems that the problem was caused by the different c++ compiler & library between your and my system. My c++ compiler probably is older than yours, so the unordered_map is under tr1 (the experimental draft) for my system. While in your system, the unordered_map has been already added to the standard library. If it is the case, I can specify the exact compiler & library to remove the ambiguity.

So I made a new version for the installation on Linux, where I forced the compiler to use c++11 by adding the option "-std=c++11". Please download this new file "VirFinder_1.1.tar.gz" under the directory of /linux and try to install again. Let me know if there are additional errors occur.

If you were not using the Linux system or the installation fails again, I will consider other possible reasons.

Thank you for reporting the problem.

Jessie

nmb85 commented 7 years ago

Hi Jessie,

You were absolutely right and it solved my installation problem! It installed perfectly and ran just fine! Thanks very much for your diligent help and the fantastic software!

Gratefully, Nathan

jessieren commented 7 years ago

Glad to know. Thank you, Nathan :)