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.

回答(1 个)

Steven Lord
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?
  1 个评论
Valentin Lange
Valentin Lange 2020-10-20
Hello Steven. Unfortunately the built in ilu function does not support the ILU(k) variant with level of fill.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by