From: Florian O. <flo...@gm...> - 2016-01-11 13:22:16
|
thanks guys. i get the following. just linking the library doesn't change the result, i.e. g++ -DBZ_DEBUG -I/usr/local/include outof1.cpp -o out -L/usr/local/lib -lblitz throws the same error as before. however, i just noted that my clang is configured with --with-gxx-include-dir=/usr/include/c++/4.2.1. Is that too old? In fact, I have homebrew gcc5.2, so doing g++-5 -DBZ_DEBUG -I/usr/local/include outof1.cpp -o out -L/usr/local/lib -lblitz works fine, and also nicely reports an out of bounds error that I included. So: any idea what's wrong with my clang compiler? thanks again. florian > > On 11 January 2016 at 14:10, Brian Helenbrook <bhe...@cl...> wrote: >> >> Hi Florian, >> >> That works with and without BZ_DEBUG on my machine which is pretty similar to yours. I have to link in the libblitz library as Mario said: >> >> c++ -DBZ_DEBUG -I${HOME}/Packages/include test.cpp -L${HOME}/Packages/lib -lblitz >> >> c++ --version >> Apple LLVM version 7.0.2 (clang-700.1.81) >> Target: x86_64-apple-darwin15.2.0 >> Thread model: posix >> >> >> >> Brian Helenbrook >> Paynter-Krigman Endowed Professor in Engineering Science Simulation >> Mechanical and Aeronautical Engineering Department >> 357 CAMP >> Clarkson University >> Potsdam, NY 13699-5725 >> >> work: 315-268-2204 >> fax: 315-268-6695 >> >> >> >> On Jan 11, 2016, at 7:56 AM, Florian Oswald <flo...@gm...> wrote: >> >> >> hi all, >> >> i can't get the debug option to work properly. I have this example program: >> >> //outof1.cpp >> >> #include <blitz/array.h> >> >> >> using namespace blitz; >> >> >> int main(){ >> >> >> Array<double,2> A(6,6); >> >> A(Range(0,2),Range(0,2)) = 5; >> >> cout << "A = " << A << endl; >> >> >> return 0; >> >> >> } >> >> >> compiled with >> g++ outof1.cpp -o out >> this returns >> >> A = (0,5) x (0,5) >> >> [ 5 5 5 0 0 0 >> >> 5 5 5 0 0 0 >> >> 5 5 5 0 0 0 >> >> 0 0 0 0 0 0 >> >> 0 0 0 0 0 0 >> >> 0 0 0 0 0 0 ] >> >> >> as it should. However, switching on the debug mode produces errors (see below). just for info, the compiler here is >> >> ➜ basics git:(master) ✗ g++ --version >> >> Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 >> >> Apple LLVM version 7.0.2 (clang-700.1.81) >> >> Target: x86_64-apple-darwin14.5.0 >> >> Thread model: posix >> >> >> any help much appreciated! >> >> Florian >> >> >> g++ outof1.cpp -DBZ_DEBUG -o out >> >> ./out >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:111:26: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> typedef _bz_typename T_expr::T_numtype T_numtype; >> >> ^ >> >> /usr/local/include/blitz/array/asexpr.h:223:25: note: in instantiation of template class 'blitz::_bz_ArrayExpr<blitz::FastTV2Iterator<int, 2> >' >> >> requested here >> >> typename asExpr<O2>::T_expr::T_optype >> >> ^ >> >> /usr/local/include/blitz/array/ops.h:113:1: note: in instantiation of template class 'blitz::BzBinaryExprResult<ShiftLeft, char, >> >> blitz::TinyVector<int, 2> >' requested here >> >> BZ_DECLARE_ARRAY_ET_SCALAR_OPS(char) >> >> ^ >> >> /usr/local/include/blitz/array/ops.h:100:71: note: expanded from macro 'BZ_DECLARE_ARRAY_ET_SCALAR_OPS' >> >> BZ_DECLARE_ARRAY_ET_BINARY_SCALAR(operator>>, ShiftRight, sca) \ >> >> ^ >> >> /usr/local/include/blitz/array/newet-macros.h:113:25: note: expanded from macro '\ >> >> BZ_DECLARE_ARRAY_ET_BINARY_SCALAR' >> >> typename BZ_BLITZ_SCOPE(BzBinaryExprResult)<applic,sca,T>::T_result \ >> >> ^ >> >> /usr/local/include/blitz/compiler.h:160:36: note: expanded from macro 'BZ_BLITZ_SCOPE' >> >> #define BZ_BLITZ_SCOPE(x) blitz::x >> >> ^ >> >> /usr/local/include/blitz/tinymat2.h:220:72: note: while substituting deduced template arguments into function template 'operator<<' >> >> [with T = blitz::TinyVector<int, 2>] >> >> BZPRECHECK(isInRange(index), "TinyMatrix index out of range: " << index >> >> ^ >> >> /usr/local/include/blitz/bzdebug.h:155:19: note: expanded from macro 'BZPRECHECK' >> >> << Y << BZ_STD_SCOPE(endl); \ >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:113:38: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> typedef typename unwrapET<typename T_expr::T_result>::T_unwrapped test; >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:114:38: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> typedef typename selectET<typename T_expr::T_typeprop, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:119:20: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> typedef typename T_expr::T_optype T_optype; >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:122:38: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> typedef _bz_ArrayExpr<_bz_typename P_expr::T_range_result> T_range_result; >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:125:28: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> numArrayOperands = T_expr::numArrayOperands, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:126:25: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> numTVOperands = T_expr::numTVOperands, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:127:25: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> numTMOperands = T_expr::numTMOperands, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:128:32: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> numIndexPlaceholders = T_expr::numIndexPlaceholders, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:129:18: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> minWidth = T_expr::minWidth, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:130:18: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> maxWidth = T_expr::maxWidth, >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:131:17: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> rank_ = T_expr::rank_; >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:495:12: error: implicit instantiation of undefined template 'blitz::FastTV2Iterator<int, 2>' >> >> T_expr iter_; >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.h:60:7: note: template is declared here >> >> class FastTV2Iterator; >> >> ^ >> >> In file included from outof1.cpp:1: >> >> In file included from /usr/local/include/blitz/array.h:37: >> >> In file included from /usr/local/include/blitz/array-impl.h:2559: >> >> In file included from /usr/local/include/blitz/array.cc:9: >> >> In file included from /usr/local/include/blitz/array/asexpr.cc:38: >> >> /usr/local/include/blitz/array/expr.h:141:11: error: no matching constructor for initialization of 'ETBase<_bz_ArrayExpr<blitz::FastTV2Iterator<int, >> >> 2> > >' >> >> : ETBase< _bz_ArrayExpr<T_expr> >(a), iter_(a.iter_) >> >> ^ ~ >> >> /usr/local/include/blitz/array/expr.h:246:5: note: in instantiation of member function 'blitz::_bz_ArrayExpr<blitz::FastTV2Iterator<int, 2> >> >> >::_bz_ArrayExpr' requested here >> >> { return iter_.template fastRead_tv<N>(i); } >> >> ^ >> >> /usr/local/include/blitz/globeval.cc:303:30: note: in instantiation of function template specialization >> >> 'blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >::fastRead_tv<2>' requested here >> >> (data+i, expr.template fastRead_tv<N>(i), T_update()); >> >> ^ >> >> /usr/local/include/blitz/globeval.cc:339:4: note: in instantiation of member function 'blitz::chunked_updater<int, >> >> blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int>, 2>::unaligned_update' requested here >> >> unaligned_update(data, expr, pos); >> >> ^ >> >> /usr/local/include/blitz/globeval.cc:342:35: note: in instantiation of function template specialization >> >> 'blitz::_bz_meta_binaryAssign<1>::assign<int, blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int> >' requested here >> >> _bz_meta_binaryAssign<I-1>::assign(data, expr, ubound, pos, T_update()); >> >> ^ >> >> /usr/local/include/blitz/globeval.cc:342:35: note: in instantiation of function template specialization >> >> 'blitz::_bz_meta_binaryAssign<2>::assign<int, blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int> >' requested here >> >> _bz_meta_binaryAssign<I-1>::assign(data, expr, ubound, pos, T_update()); >> >> ^ >> >> /usr/local/include/blitz/globeval.cc:342:35: note: (skipping 7 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) >> >> /usr/local/include/blitz/tvevaluate.h:135:5: note: in instantiation of function template specialization 'blitz::_bz_evaluate<blitz::TinyVector<int, >> >> 1>, blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int> >' requested here >> >> _bz_evaluate(dest, expr, T_update()); >> >> ^ >> >> /usr/local/include/blitz/tvevaluate.h:179:40: note: in instantiation of function template specialization 'blitz::_tv_evaluator<true, >> >> 1>::select_evaluation<int, blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int> >' requested here >> >> _tv_evaluator<mixed_expr, N_length>::select_evaluation(*this, expr, T_update()); >> >> ^ >> >> /usr/local/include/blitz/tinyvec2.cc:86:3: note: in instantiation of function template specialization 'blitz::TinyVector<int, >> >> 1>::_tv_evaluate<blitz::_bz_ArrayExpr<blitz::IndexPlaceholder<0> >, blitz::_bz_update<int, int> >' requested here >> >> _tv_evaluate(_bz_typename asExpr<T_expr>::T_expr(expr.unwrap()), >> >> ^ >> >> /usr/local/include/blitz/array/storage.h:412:17: note: in instantiation of function template specialization 'blitz::TinyVector<int, >> >> 1>::operator=<blitz::IndexPlaceholder<0> >' requested here >> >> ordering_ = tensor::i;//Range(0, N_rank - 1); >> >> ^ >> >> /usr/local/include/blitz/array/storage.h:430:14: note: in instantiation of member function 'blitz::ColumnMajorArray<1>::ColumnMajorArray' requested >> >> here >> >> { return ColumnMajorArray<1>(); } >> >> ^ >> >> /usr/local/include/blitz/etbase.h:45:5: note: candidate constructor not viable: no known conversion from 'const _bz_ArrayExpr<T_expr>' to 'const >> >> ETBase<blitz::_bz_ArrayExpr<blitz::FastTV2Iterator<int, 2> > >' for 1st argument >> >> ETBase(const ETBase<T>&) >> >> ^ >> >> /usr/local/include/blitz/etbase.h:42:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided >> >> ETBase() >> >> ^ >> >> 14 errors generated. >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Site24x7 APM Insight: Get Deep Visibility into Application Performance >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month >> Monitor end-to-end web transactions and take corrective actions now >> Troubleshoot faster and improve end-user experience. Signup Now! >> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ >> Blitz-support mailing list >> Bli...@li... >> https://lists.sourceforge.net/lists/listinfo/blitz-support >> >> > |