fhormoz / caviar

52 stars 25 forks source link

install error 'data' is ambigous #33

Closed seyoun209 closed 7 months ago

seyoun209 commented 7 months ago

I am getting errors installing. I think 'data' from util is causing problems but I don't know what to do. here is the error message below:
g++ caviar.cpp PostCal.cpp Util.cpp TopKSNP.cpp -I /work/users/s/e/seyoun/07.Doug_thesis/09.cqtl_hic/oa_tissue/RNAPIPE-Splice/tool/caviar/CAVIAR-C++/armadillo/include/ -DARMA_DONT_USE_WRAPPER -llapack -lblas -lgslcblas -lgsl -o CAVIAR In file included from caviar.cpp:8: Util.h:22:29: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/string:54, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/locale_classes.h:40, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/ios_base.h:41, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ios:42, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ostream:38, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/iostream:39, from caviar.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from caviar.cpp:8: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:29: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h:22:47: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/string:54, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/locale_classes.h:40, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/ios_base.h:41, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ios:42, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ostream:38, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/iostream:39, from caviar.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from caviar.cpp:8: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:47: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h: In member function ‘bool by_number::operator()(const int&, const int&)’: Util.h:23:33: error: request for member ‘number’ in ‘left’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ Util.h:23:53: error: request for member ‘number’ in ‘right’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ In file included from PostCal.cpp:8: Util.h:22:29: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/vector:69, from PostCal.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from PostCal.cpp:8: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:29: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h:22:47: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/vector:69, from PostCal.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from PostCal.cpp:8: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:47: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h: In member function ‘bool by_number::operator()(const int&, const int&)’: Util.h:23:33: error: request for member ‘number’ in ‘left’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ Util.h:23:53: error: request for member ‘number’ in ‘right’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ PostCal.cpp: In member function ‘double PostCal::fracdmvnorm(arma::mat, arma::mat, arma::mat, arma::mat, double)’: PostCal.cpp:37:58: error: call of overloaded ‘size(arma::mat&)’ is ambiguous 37 | mat res1 = trans(ZcenterMean) * solve(R, eye(size(R))) * (ZcenterMean); | ~~~~^~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/vector:69, from PostCal.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:245:5: note: candidate: ‘constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = arma::Mat<double>; decltype (__cont.size()) = long long unsigned int]’ 245 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ In file included from /work/users/s/e/seyoun/07.Doug_thesis/09.cqtl_hic/oa_tissue/RNAPIPE-Splice/tool/caviar/CAVIAR-C++/armadillo/include/armadillo:468, from PostCal.cpp:5: /work/users/s/e/seyoun/07.Doug_thesis/09.cqtl_hic/oa_tissue/RNAPIPE-Splice/tool/caviar/CAVIAR-C++/armadillo/include/armadillo_bits/fn_size.hpp:30:1: note: candidate: ‘typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::SizeMat>::result arma::size(const T1&) [with T1 = arma::Mat<double>; typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::SizeMat>::result = const arma::SizeMat]’ 30 | size(const T1& X) | ^~~~ PostCal.cpp:38:61: error: call of overloaded ‘size(arma::mat&)’ is ambiguous 38 | mat res2 = trans(ZcenterMean) * solve(newR, eye(size(newR))) * (ZcenterMean); | ~~~~^~~~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/vector:69, from PostCal.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:245:5: note: candidate: ‘constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = arma::Mat<double>; decltype (__cont.size()) = long long unsigned int]’ 245 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ In file included from /work/users/s/e/seyoun/07.Doug_thesis/09.cqtl_hic/oa_tissue/RNAPIPE-Splice/tool/caviar/CAVIAR-C++/armadillo/include/armadillo:468, from PostCal.cpp:5: /work/users/s/e/seyoun/07.Doug_thesis/09.cqtl_hic/oa_tissue/RNAPIPE-Splice/tool/caviar/CAVIAR-C++/armadillo/include/armadillo_bits/fn_size.hpp:30:1: note: candidate: ‘typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::SizeMat>::result arma::size(const T1&) [with T1 = arma::Mat<double>; typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::SizeMat>::result = const arma::SizeMat]’ 30 | size(const T1& X) | ^~~~ PostCal.cpp: In member function ‘double PostCal::findOptimalSetGreedy(double*, double, char*, int*, double, std::string)’: PostCal.cpp:325:25: error: template argument 1 is invalid 325 | std::vector<data> items; | ^ PostCal.cpp:325:25: error: template argument 2 is invalid PostCal.cpp:330:20: error: request for member ‘push_back’ in ‘items’, which is of non-class type ‘int’ 330 | items.push_back(data(exp(postValues[i]-total_post), i, 0)); | ^~~~~~~~~ PostCal.cpp:330:30: error: reference to ‘data’ is ambiguous 330 | items.push_back(data(exp(postValues[i]-total_post), i, 0)); | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/vector:69, from PostCal.cpp:1: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from PostCal.cpp:8: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ PostCal.cpp:333:25: error: request for member ‘begin’ in ‘items’, which is of non-class type ‘int’ 333 | std::sort(items.begin(), items.end(), by_number()); | ^~~~~ PostCal.cpp:333:40: error: request for member ‘end’ in ‘items’, which is of non-class type ‘int’ 333 | std::sort(items.begin(), items.end(), by_number()); | ^~~ PostCal.cpp:335:32: error: invalid types ‘int[int]’ for array subscript 335 | rank[i] = items[i].index1; | ^ In file included from TopKSNP.cpp:5: Util.h:22:29: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/string:54, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/locale_classes.h:40, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/ios_base.h:41, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ios:42, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ostream:38, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/iostream:39, from TopKSNP.cpp:2: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from TopKSNP.cpp:5: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:29: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h:22:47: error: reference to ‘data’ is ambiguous 22 | bool operator()(data const &left, data const &right) { | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/string:54, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/locale_classes.h:40, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/ios_base.h:41, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ios:42, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ostream:38, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/iostream:39, from TopKSNP.cpp:2: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from TopKSNP.cpp:5: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ Util.h:22:47: error: ‘data’ has not been declared 22 | bool operator()(data const &left, data const &right) { | ^~~~ Util.h: In member function ‘bool by_number::operator()(const int&, const int&)’: Util.h:23:33: error: request for member ‘number’ in ‘left’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ Util.h:23:53: error: request for member ‘number’ in ‘right’, which is of non-class type ‘const int’ 23 | return abs(left.number) > abs(right.number); | ^~~~~~ TopKSNP.cpp: In member function ‘void TopKSNP::findCausal(int*)’: TopKSNP.cpp:10:25: error: template argument 1 is invalid 10 | std::vector<data> items; | ^ TopKSNP.cpp:10:25: error: template argument 2 is invalid TopKSNP.cpp:15:23: error: request for member ‘push_back’ in ‘items’, which is of non-class type ‘int’ 15 | items.push_back(data(stat[i], i, i)); | ^~~~~~~~~ TopKSNP.cpp:15:33: error: reference to ‘data’ is ambiguous 15 | items.push_back(data(stat[i], i, i)); | ^~~~ In file included from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/string:54, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/locale_classes.h:40, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/ios_base.h:41, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ios:42, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/ostream:38, from /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/iostream:39, from TopKSNP.cpp:2: /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:319:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’ 319 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:310:5: note: ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’ 310 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:300:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’ 300 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /nas/longleaf/rhel8/apps/gcc/11.2.0/include/c++/11.2.0/bits/range_access.h:290:5: note: ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’ 290 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ In file included from TopKSNP.cpp:5: Util.h:10:16: note: ‘struct data’ 10 | struct data { | ^~~~ TopKSNP.cpp:17:25: error: request for member ‘begin’ in ‘items’, which is of non-class type ‘int’ 17 | std::sort(items.begin(), items.end(), by_number()); | ^~~~~ TopKSNP.cpp:17:40: error: request for member ‘end’ in ‘items’, which is of non-class type ‘int’ 17 | std::sort(items.begin(), items.end(), by_number()); | ^~~ TopKSNP.cpp:20:39: error: invalid types ‘int[int]’ for array subscript 20 | printf("%f %d ", items[i].number, items[i].index1); | ^ TopKSNP.cpp:20:56: error: invalid types ‘int[int]’ for array subscript 20 | printf("%f %d ", items[i].number, items[i].index1); | ^ TopKSNP.cpp:21:41: error: invalid types ‘int[int]’ for array subscript 21 | topKConfigure[i] = items[i].index1; | ^ make: *** [Makefile:17: CAVIAR] Error 1