alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 169 forks source link

mex doesn't support custom boost versions #54

Open MogicianWu opened 6 years ago

MogicianWu commented 6 years ago

Hi Alec:

I'm trying to use this code to preprocess some meshes from the Thingi10k database.

I tried to compile the gptoolbox code on ubuntu 16.04 by running gptoolbox/mex/compile_gptoolbox_mex.m, with the following methods:

'ambient_occlusion', ... 'bone_visible', ... 'bone_visible_embree', ... 'collapse_small_triangles', ... 'decimate_cgal', ... 'fit_rotations_mex', ... 'in_element_aabb', ... 'decimate_libigl', ... 'ray_mesh_intersect', ... 'reorient_facets', ... 'segment_graph', ... 'signed_distance', ... 'simplify_polyhedron', ... 'slim', ... 'solid_angle', ... 'winding_number', ...
'intersect_other', ... 'point_mesh_squared_distance', ... 'read_mesh_from_xml', ... 'selfintersect', ... 'signed_distance_isosurface', ... 'trim_with_solid', ...

and specifying libboost version 1.65, mex refuses to use my version of downloaded boost and just used boost from /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0.

In fact, in gptoolbox/mex/gptoolbox_mexopts.m, even if I passed in garbage value for variable BOOST_INC and BOOST_LIB, the code will still compile and link to version 1.58. Is there a way around this problem?

alecjacobson commented 6 years ago

Hi Bruce, I'm trying to switch the compilation to cmake. Could you try the method described in mex/README.md ? -Alec

MogicianWu commented 6 years ago

Hi Alec:

Thanks for the quick response. The new method compiled fine.

BTW, I tried to use function /home/mogicianwu/Downloads/gptoolbox/mesh/statistics.m for my mesh and it gives me the following error:

Undefined function or variable 'normrow'.

Error in internalangles (line 14) s12 = normrow(V(i2,:) - V(i1,:));

Error in statistics (line 186) S.num_small_angles = sum(sum(internalangles(V,F)<min_angle));

Error in run_meshes (line 6) statistics(V,F)

Is this because I did something else wrong during the make process?