stack-of-tasks / sot-core

Hierarchical task solver plug-in for dynamic-graph
BSD 2-Clause "Simplified" License
19 stars 32 forks source link

ca8473 compile error #5

Closed duongdang closed 12 years ago

duongdang commented 13 years ago

Hi,

The HEAD won't compile anymore on my system. I have boost 1.41 installed on a Fedora 12.

Best,

Here's the error:

[ 71%] Building CXX object src/CMakeFiles/sot-qr.dir/sot/sot-qr.cpp.o cd /home/nddang/src/sot2/sot-core/build/src && /usr/lib/ccache/c++ -Dsot_qr_EXPORTS -pedantic -Wno-long-long -Wall -Wextra -Wcast-align -Wcast-qual -Wformat -Wwrite-strings -Wconversion -fPIC -I/home/nddang/src/sot2/sot-core/build -I/home/nddang/src/sot2/sot-core/build/include -I/home/nddang/src/sot2/sot-core/include -I/local/nddang/profiles/sot2/install/unstable/include -I/local/nddang/profiles/sot2/install/stable/include -pthread -I/local/nddang/profiles/sot2/install/unstable/include -I/local/nddang/profiles/sot2/install/stable/include -I/local/nddang/profiles/sot2/install/unstable/include -I/local/nddang/profiles/sot2/install/stable/include -o CMakeFiles/sot-qr.dir/sot/sot-qr.cpp.o -c /home/nddang/src/sot2/sot-core/src/sot/sot-qr.cpp /home/nddang/src/sot2/sot-core/src/sot/sot-qr.cpp: In function ‘int boost::numeric::bindings::lapack::geqp(boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_column_major<unsigned int, int>, boost::numeric::ublas::unbounded_array<double, std::allocator > >&, boost::numeric::ublas::vector<int, boost::numeric::ublas::unbounded_array<int, std::allocator > >&, bubVector&)’: /home/nddang/src/sot2/sot-core/src/sot/sot-qr.cpp:306: error: ‘m’ was not declared in this scope

duongdang commented 13 years ago

Here's what causes it, should the assert line be inside #ifdef DEBUG? otherwise sot-core won't compile without DEBUG flag

sot-qr.cpp:300

#ifdef DEBUG
const int m = A.size1();
#endif
const int n = A.size2();
::boost::numeric::ublas::vector<double> work(std::max(1, n*32));

assert (std::min(m,n) <= tau.size());
gergondet commented 13 years ago

Hi,

My bad, I introduced this bug when fixing the warnings in sot-core, at that time I mistakenly assumed that assert where ignored when compiling without -DDEBUG

Actually, the assert are ignored when passing -DNDEBUG at compilation time (at least with gcc).

But yes, in this case puting the assert in the perimeter of the #ifdef DEBUG will fix your problem (also, passing -DNDEBUG at compilation time)

Thanks for the report