gabyx / ApproxMVBB

Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.
Mozilla Public License 2.0
441 stars 93 forks source link

openmp issue #39

Closed jean59 closed 4 years ago

jean59 commented 4 years ago

hello

there's something strange...

i'm discovering your library and test your example with the simple code of the readme: ApproxMVBB::Matrix3Dyn points(3,3000); points.setRandom(); ApproxMVBB::OOBB oobb = ApproxMVBB::approximateMVBB(points,0.001,1000,5,0,5); oobb.expandToMinExtentRelative(0.2);

if openmp is not activated... no problem.

if openmp is activated then i've this error, following...

error: no member named 'approximateMVBB' in namespace 'ApproxMVBB'

i think i missed the compilation somewhere

jean59 commented 4 years ago

ApproxMVBB_OPENMP_USE_OPENMP=On

gabyx commented 4 years ago

Could be that there is a Macro error where this functionality is defined... Could you try to insert a programming error before ApproxMVBB::approximateMVBB to see if this function is really compiled?

jean59 commented 4 years ago

for the moment i'm completely lost...

i re-compiled your library with this cmake command:

cmake -DApproxMVBB_BUILD_LIBRARY=ON -DApproxMVBB_BUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX="/usr/local/" -DApproxMVBB_OPENMP_USE_OPENMP=ON -DApproxMVBB_OPENMP_USE_NTHREADS=ON -DApproxMVBB_OPENMP_USE_NTHREADS=8

all the compiled tests work very faster now... and about the simple code, the environnement of compilation (Qtcreator on Ubuntu) still warms about :

erreur : no member named 'approximateMVBB' in namespace 'ApproxMVBB'

but now accepts to compile despite this, and the result works like a charm at the execution, and really faster also. the output is the following...

p1: -0.915805 -0.96436 0.988027 p2: 0.814425 0.965205 -0.878088 l: 3.19364 estimated 3d diameter: -1.73023 -1.92957 1.86612 eps: 0.001 p1: 1.28981 -0.780146 p2: -1.23334 0.902865 l: 3.03296 gridSearch: new volume: 12.6624 for dir: 1.93447 5.31128 -1.02377 gridSearch: new volume: 17.4343 for dir: -3.23682 6.28181 4.00772 gridSearch: new volume: 8.07324 for dir: 0.190436 5.38159 -0.0473419 gridSearch: new volume: 13.5461 for dir: -3.29763 5.5222 1.90551 gridSearch: new volume: 15.2769 for dir: -1.49279 6.21151 3.03129 gridSearch: new volume: 12.2591 for dir: -4.63606 5.19512 1.58672 gridSearch: new volume: 8.45815 for dir: -3.35844 4.76258 -0.196702 (etc...)

the problem is when i incorporate the same simple code as a separate class in my little program, i also the same warm

erreur : no member named 'approximateMVBB' in namespace 'ApproxMVBB'

but the output is the following...

p1: -0.915805 -0.96436 0.988027 p2: 0.814425 0.965205 -0.878088 l: 3.19364 estimated 3d diameter: -1.73023 -1.92957 1.86612 eps: 0.001 p1: 1.28981 -0.780146 p2: -1.23334 0.902865 l: 3.03296 double free or corruption (out) Abandon (core dumped)

i just forgot something, somewhere...don't lose your time with this...the library works fine

jean59 commented 4 years ago

ok i found the error...my bad...