Loading C files in matlab with mex

2 Ansichten (letzte 30 Tage)
Valentin Lange
Valentin Lange am 20 Okt. 2020
Bearbeitet: Valentin Lange am 21 Okt. 2020
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.

Antworten (1)

Steven Lord
Steven Lord am 20 Okt. 2020
I'm not familiar with that package but I'm curious if the ilu function in MATLAB would be suitable for your needs?
  1 Kommentar
Valentin Lange
Valentin Lange am 20 Okt. 2020
Hello Steven. Unfortunately the built in ilu function does not support the ILU(k) variant with level of fill.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu C Shared Library Integration finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by