Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to mex on mesh_boolean #127

Open
Polofes opened this issue Dec 20, 2021 · 3 comments
Open

how to mex on mesh_boolean #127

Polofes opened this issue Dec 20, 2021 · 3 comments

Comments

@Polofes
Copy link

Polofes commented Dec 20, 2021

I have build and compiled the library with CMAKE and Visual studio 17. But I can not mex the mesh_boolean in MATLAB. mex is asking for the addresses of different libraries which I provide by -I option but after some steps it is asking for a config.h file that I do not have.

There are different mesh_boolean.cpp files and I am using the one that is in the gptoolbox/mex folder.

this is the message:

mex('-v','C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean.cpp',ipath1,ipath2,ipath3,ipath4)
Verbose mode is on.
... Looking for compiler 'MinGW64 Compiler (C++)' ...
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\Dev\MinGW646.3.0\mingw64').
... Looking for file 'C:\Dev\MinGW646.3.0\mingw64\bin\g++.exe' ...Yes.
... Looking for folder 'C:\Dev\MinGW646.3.0\mingw64' ...Yes.
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\Dev\MinGW646.3.0\mingw64').
... Executing command 'C:\Dev\MinGW646.3.0\mingw64\bin\g++ -dumpmachine' ...Yes ('x86_64-w64-mingw32').
... Looking for environment variable 'MW_MINGW64_LOC' ...Yes ('C:\Dev\MinGW646.3.0\mingw64').
... Executing command 'C:\Dev\MinGW646.3.0\mingw64\bin\g++ -dumpversion' ...Yes ('6.3.0').
Found installed compiler 'MinGW64 Compiler (C++)'.
Set PATH = C:\Dev\MinGW646.3.0\mingw64\bin;C:\Program Files\MATLAB\R2020B\extern\include\win64;C:\Program Files\MATLAB\R2020B\extern\include;C:\Program Files\MATLAB\R2020B\simulink\include;C:\Program Files\MATLAB\R2020B\lib\win64;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\release\;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\;C:\Program Files (x86)\Intel\oneAPI\mpi\latest\libfabric\bin\utils\;C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\intel64\vc_mt\;C:\Program Files (x86)\Intel\oneAPI\tbb\latest\redist\ia32\vc_mt\;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler;C:\Program Files (x86)\Intel\oneAPI\compiler\latest\windows\redist\ia32_win\compiler;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\PROGRA~1\MATLAB\R2020B\runtime\win64;C:\PROGRA~1\MATLAB\R2020B\bin;C:\Program Files\MATLAB\R2020B\runtime\win64;C:\Program Files\MATLAB\R2020B\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\ITK-SNAP 3.8\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Majid\SSM\Code\Matlab Code\boost_1_78_0;C:\Majid\SSM\Code\Matlab Code\cgal-master;C:\Program Files (x86)\OpenBLAS;C:\Program Files (x86)\BLAS;C:\Majid\SSM\Code\Matlab Code\BLAS-3.10.0\Build\Debug;C:\Majid\SSM\Code\Matlab Code\BLAS-3.10.0;C:\Majid\SSM\Code\Matlab Code\lapack-3.9.1;C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0\;C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0\Eigen;C:\Program Files\CMake\bin;C:\Users\p70077839\AppData\Local\Microsoft\WindowsApps;C:\Users\p70077839\.dotnet\tools
Set INCLUDE = C:\Dev\MinGW646.3.0\mingw64\include;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\backward;C:\Dev\MinGW646.3.0\mingw64\x86_64-w64-mingw32\include;C:\Dev\MinGW646.3.0\mingw64\include;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\x86_64-w64-mingw32;C:\Dev\MinGW646.3.0\mingw64\lib\gcc\x86_64-w64-mingw32\6.3.0\include\c++\backward;C:\Dev\MinGW646.3.0\mingw64\x86_64-w64-mingw32\include;
Set LIB = C:\Dev\MinGW646.3.0\mingw64\lib;;C:\Dev\MinGW646.3.0\mingw64\lib;;
Set MW_TARGET_ARCH = win64;win64;
Set LIBPATH = C:\Program Files\MATLAB\R2020B\extern\lib\win64;C:\Program Files\MATLAB\R2020B\extern\lib\win64;
Options file details

Compiler location: C:\Dev\MinGW646.3.0\mingw64
Options file: C:\Users\p70077839\AppData\Roaming\MathWorks\MATLAB\R2020b\mex_C++_win64.xml
CMDLINE2 : C:\Dev\MinGW646.3.0\mingw64\bin\g++ -m64 -Wl,--no-undefined -shared -static -s -Wl,"C:\Program Files\MATLAB\R2020B/extern/lib/win64/mingw64/exportsmexfileversion.def" C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.obj C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\cpp_mexapi_version.obj   -L"C:\Program Files\MATLAB\R2020B\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -llibMatlabDataArray -llibMatlabEngine -o mesh_boolean.mexw64
CXX : C:\Dev\MinGW646.3.0\mingw64\bin\g++
COMPILER : C:\Dev\MinGW646.3.0\mingw64\bin\g++
DEFINES : -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE 
MATLABMEX : -DMATLAB_MEX_FILE 
CFLAGS : -fexceptions -fno-omit-frame-pointer
CXXFLAGS : -fexceptions -fno-omit-frame-pointer -std=c++11
INCLUDE : -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\include" -I"C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include"  -I"C:\Program Files\MATLAB\R2020B/extern/include" -I"C:\Program Files\MATLAB\R2020B/simulink/include"
CXXOPTIMFLAGS : -O2 -fwrapv -DNDEBUG
CXXDEBUGFLAGS : -g
LDXX : C:\Dev\MinGW646.3.0\mingw64\bin\g++
LINKER : C:\Dev\MinGW646.3.0\mingw64\bin\g++
LDFLAGS : -m64 -Wl,--no-undefined
LDTYPE : -shared -static
LINKEXPORT : -Wl,"C:\Program Files\MATLAB\R2020B/extern/lib/win64/mingw64/mexFunction.def"
LINKEXPORTVER : -Wl,"C:\Program Files\MATLAB\R2020B/extern/lib/win64/mingw64/exportsmexfileversion.def"
LIBLOC : C:\Program Files\MATLAB\R2020B\extern\lib\win64\mingw64
LINKLIBS : -L"C:\Program Files\MATLAB\R2020B\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -llibMatlabDataArray -llibMatlabEngine
LDOPTIMFLAGS : -s
LDDEBUGFLAGS : -g
OBJEXT : .obj
LDEXT : .mexw64
SETENV : set COMPILER=C:\Dev\MinGW646.3.0\mingw64\bin\gcc
            set CXXCOMPILER=C:\Dev\MinGW646.3.0\mingw64\bin\g++
            set COMPFLAGS=-c -fexceptions -fno-omit-frame-pointer -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE  -DMATLAB_MEX_FILE 
            set CXXCOMPFLAGS=-c -fexceptions -fno-omit-frame-pointer -std=c++11 -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE  -DMATLAB_MEX_FILE 
            set OPTIMFLAGS=-O2 -fwrapv -DNDEBUG
            set DEBUGFLAGS=-g
            set LINKER=C:\Dev\MinGW646.3.0\mingw64\bin\gcc
            set CXXLINKER=C:\Dev\MinGW646.3.0\mingw64\bin\g++
            set LINKFLAGS=-m64 -Wl,--no-undefined -shared -static -L"C:\Program Files\MATLAB\R2020B\extern\lib\win64\mingw64" -llibmx -llibmex -llibmat -lm -llibmwlapack -llibmwblas -llibMatlabDataArray -llibMatlabEngine -Wl,"C:\Program Files\MATLAB\R2020B/extern/lib/win64/mingw64/mexFunction.def"
            set LINKDEBUGFLAGS=-g
            set NAME_OUTPUT= -o "%OUTDIR%%MEX_NAME%%MEX_EXT%"
MINGWROOT : C:\Dev\MinGW646.3.0\mingw64
MINGWTARGET : x86_64-w64-mingw32
VERSION : 6.3.0
MATLABROOT : C:\Program Files\MATLAB\R2020B
ARCH : win64
SRC : "C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean.cpp";"C:\Program Files\MATLAB\R2020B\extern\version\cpp_mexapi_version.cpp"
OBJ : C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.obj;C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\cpp_mexapi_version.obj
OBJS : C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.obj C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\cpp_mexapi_version.obj 
SRCROOT : C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean
DEF : C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.def
EXP : "mesh_boolean.exp"
LIB : "mesh_boolean.lib"
EXE : mesh_boolean.mexw64
ILK : "mesh_boolean.ilk"
MANIFEST : "mesh_boolean.mexw64.manifest"
TEMPNAME : mesh_boolean
EXEDIR : 
EXENAME : mesh_boolean
OPTIM : -O2 -fwrapv -DNDEBUG
LINKOPTIM : -s
CMDLINE1_0 : C:\Dev\MinGW646.3.0\mingw64\bin\g++ -c -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE  -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\include" -I"C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include"  -I"C:\Program Files\MATLAB\R2020B/extern/include" -I"C:\Program Files\MATLAB\R2020B/simulink/include" -fexceptions -fno-omit-frame-pointer -std=c++11 -O2 -fwrapv -DNDEBUG "C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean.cpp" -o C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.obj
CMDLINE1_1 : C:\Dev\MinGW646.3.0\mingw64\bin\g++ -c -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE  -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\include" -I"C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include"  -I"C:\Program Files\MATLAB\R2020B/extern/include" -I"C:\Program Files\MATLAB\R2020B/simulink/include" -fexceptions -fno-omit-frame-pointer -std=c++11 -O2 -fwrapv -DNDEBUG "C:\Program Files\MATLAB\R2020B\extern\version\cpp_mexapi_version.cpp" -o C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\cpp_mexapi_version.obj

Building with 'MinGW64 Compiler (C++)'.
C:\Dev\MinGW646.3.0\mingw64\bin\g++ -c -DMATLAB_DEFAULT_RELEASE=R2017b  -DUSE_MEX_CMD   -m64 -DMATLAB_MEX_FILE  -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\include" -I"C:\Majid\SSM\Code\Matlab Code\eigen-3.4.0" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include" -I"C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include"  -I"C:\Program Files\MATLAB\R2020B/extern/include" -I"C:\Program Files\MATLAB\R2020B/simulink/include" -fexceptions -fno-omit-frame-pointer -std=c++11 -O2 -fwrapv -DNDEBUG "C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean.cpp" -o C:\Users\P70077~1\AppData\Local\Temp\mex_86155766170588_18648\mesh_boolean.obj
Error using mex
In file included from C:\Majid\SSM\Code\Matlab
Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include/CGAL/Cartesian/Cartesian_base.h:29:0,
				 from C:\Majid\SSM\Code\Matlab
				 Code\gptoolbox\mex\external\libigl\external\cgal\Cartesian_kernel\include/CGAL/Simple_cartesian.h:29,
				 from C:\Majid\SSM\Code\Matlab
				 Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include/CGAL/Exact_predicates_exact_constructions_kernel.h:29,
								  from C:\Majid\SSM\Code\Matlab
				 Code\gptoolbox\mex\external\libigl\include/igl/copyleft/cgal/assign.h:12,
				 from C:\Majid\SSM\Code\Matlab
				 Code\gptoolbox\mex\external\libigl\include/igl/copyleft/cgal/mesh_boolean.cpp:11,
				 from C:\Majid\SSM\Code\Matlab
				 Code\gptoolbox\mex\external\libigl\include/igl/copyleft/cgal/mesh_boolean.h:226,
				 from C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\mesh_boolean.cpp:1:
C:\Majid\SSM\Code\Matlab Code\gptoolbox\mex\external\libigl\external\cgal\Kernel_23\include/CGAL/basic.h:30:25: fatal error:
CGAL/config.h: No such file or directory
 #include <CGAL/config.h>
						 ^
compilation terminated.

How can I fix this?!

@alecjacobson
Copy link
Owner

libigl is supposed to be grabbing cgal for you. Are you able to successfully build libigl (outside of gptoolbox)?

@Polofes
Copy link
Author

Polofes commented Dec 21, 2021

I have downloaded CGAL and Libigl as header only and seperately outside gptoolbox, but when mex is built another libigle is inside gptoolbox.

Now I built the libigl outside gptoolbox with CGAL, using CMAKE and VS19 and it was successful as in here:

103>------ Build started: Project: ALL_BUILD, Configuration: Debug x64 ------
103>Building Custom Rule C:/Majid/SSM/Code/Matlab Code/libigl/CMakeLists.txt
========== Build: 103 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Still mex is giving me the same issue.

I have also Blas, Boost, Eigen, and Lapack independently before building gptoolbox. Should I get rid of everything and let CMAKE download them while building the gptoolbox?

@Polofes
Copy link
Author

Polofes commented Jan 4, 2022

@alecjacobson any hint for me? I am stuck here. any general hint is also of great help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants