alecjacobson / gptoolbox

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

compile point_mesh_square_distance #72

Open gelareh20 opened 6 years ago

gelareh20 commented 6 years ago

could you give me a guide. I am new with MATLAB, I want to use the Hausdorff function but I can not compile '"point_square_distance.cpp"> I have downloaded the newest stable versions of eigen and libigl: http://eigen.tuxfamily.org/index.php?title=Main_Page https://github.com/libigl/libigl and I set the path with MATLAB. but when I run this code clearvars

eigen_version='26667be4f70b'; path_to_eigen=['C:\dev\eigen-eigen-' eigen_version];

path_to_libigl='C:\dev\libigl';

MEXOPTS={'-v','-largeArrayDims','-DMEX'};

EIGEN_INC= ['-I' path_to_eigen];

LIBIGL_INC=['-I' path_to_libigl '\include']; LIBIGL_FLAGS='-DIGL_SKIP'; LIBIGL_LIB={'-DIGL_SKIP'}; LIBIGL_LIBMATLAB='-DIGL_SKIP'; LIBIGL_LIBCGAL='-DIGL_SKIP'; LIBIGL_LIBCORK='-DIGL_NO_CORK'; LIBIGL_BASE={LIBIGL_INC, LIBIGL_FLAGS,LIBIGL_LIB{:}, LIBIGL_LIBMATLAB};

mex( ... MEXOPTS{:}, ... LIBIGL_BASE{:},EIGEN_INC, ... 'point_mesh_squared_distance.cpp');

I have got this error: Error using mex C:\Users\user\Desktop\PhD_thesis\matlab\downloaded_futions\alecjacobson\mex\point_mesh_squared_distance.cpp:5:34: fatal error: igl/matlab/MexStream.h: No such file or directory compilation terminated. but the file is on the directory. please help me. Thank you very much indeed for your prompt reply. Bests

oqilipo commented 6 years ago

Do you have cloned "https://github.com/libigl/libigl" to "C:\dev" using Git or TortoiseGit?

oqilipo commented 6 years ago

What windows version and compiler in MATLAB are you using?

gelareh20 commented 6 years ago

@oqilipo I have downloaded the libigl and extract it to desktop and then set the path to the MATLAB. I am using "MATLAB === 2017b" and "windows === 7" and "MinGW64 compiler".

oqilipo commented 6 years ago

How many MB has the libigl folder?

gelareh20 commented 6 years ago

@oqilipo size=160 MB size on disk=164 MB

oqilipo commented 6 years ago

The external libaries are missing. You should use Git or TortoiseGit and clone from "https://github.com/libigl/libigl".

gelareh20 commented 6 years ago

@oqilipo would you help me please? I cloned by Git from "https://github.com/libigl/libigl" as you said. then I set the path to MATLAB. and set the "current folder" to the gptoolbox/mesh , but when I evaluate this code: clearvars

eigen_version='26667be4f70b'; path_to_eigen=['C:\dev\eigen-eigen-' eigen_version];

path_to_libigl='C:\dev\libigl';

MEXOPTS={'-v','-largeArrayDims','-DMEX'};

EIGEN_INC= ['-I' path_to_eigen];

LIBIGL_INC=['-I' path_to_libigl '\include']; LIBIGL_FLAGS='-DIGL_SKIP'; LIBIGL_LIB={'-DIGL_SKIP'}; LIBIGL_LIBMATLAB='-DIGL_SKIP'; LIBIGL_LIBCGAL='-DIGL_SKIP'; LIBIGL_LIBCORK='-DIGL_NO_CORK'; LIBIGL_BASE={LIBIGL_INC, LIBIGL_FLAGS,LIBIGL_LIB{:}, LIBIGL_LIBMATLAB};

mex( ... MEXOPTS{:}, ... LIBIGL_BASE{:},EIGEN_INC, ... 'point_mesh_squared_distance.cpp');

again this give me the following error: Error using mex C:\Users\user\Desktop\PhD_thesis\matlab\downloaded_futions\alecjacobson\mesh\point_mesh_squared_distance.cpp not found; check that you are in the correct current folder, and check the spelling of 'C:\Users\user\Desktop\PhD_thesis\matlab\downloaded_futions\alecjacobson\mesh\point_mesh_squared_distance.cpp'.

please guide me. Thank you very much indeed for your prompt reply.