Loading C files in matlab with mex
3 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
I want to use the ilupack toolbox for MATLAB, to create ILUT preconditioners with level of fill. As I have no real experience with coding C++, I am having trouble to install it.
I am following the getting started guide on this page, but am struggling on the first step: "After compiling the mex interface drivers from the ILUPACK directory,... ". I found out that to use C++ files in matlab, I have to use the mex function. I did the mex setup and also managed to add the include files into the commmand. The ilupack folder is inside my working directory and I tried
mex ./ilupack/matlab/DGNLilupackinit.c -I./ilupack/include/
but now I am getting the error
Error using mex
Bibliothek "DGNLilupackinit.lib" und Objekt "DGNLilupackinit.exp" werden
erstellt.
DGNLilupackinit.obj : error LNK2019: Verweis auf nicht aufgel”stes externes Symbol
"DGNLAMGinit" in Funktion "mexFunction".
DGNLilupackinit.mexw64 : fatal error LNK1120: 1 nicht aufgel”ste Externe
In english:
Error using mex
Bibliothek "DGNLilupackinit.lib" and Object "DGNLilupackinit.exp" are being created.
DGNLilupackinit.obj : error LNK2019: Reference to to unresolved external symbol
"DGNLAMGinit" in Function "mexFunction".
DGNLilupackinit.mexw64 : fatal error LNK1120: 1 unresolved external
What steps am I missing? Also there are multiple *.c files in the matlab folder. How do I mex those efficiently without typing each one?
Unfortunately the realm of C++ programm is quite hard to get into for people unfamiliar with the concepts. Especially because there are rarely videos or tutorial on these kind of special situations.
I hope you can help me.
0 个评论
回答(1 个)
Steven Lord
2020-10-20
I'm not familiar with that package but I'm curious if the ilu function in MATLAB would be suitable for your needs?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C Shared Library Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!