Loading C files in matlab with mex

2 visualizzazioni (ultimi 30 giorni)
Valentin Lange
Valentin Lange il 20 Ott 2020
Modificato: Valentin Lange il 21 Ott 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.

Risposte (1)

Steven Lord
Steven Lord il 20 Ott 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 Commento
Valentin Lange
Valentin Lange il 20 Ott 2020
Hello Steven. Unfortunately the built in ilu function does not support the ILU(k) variant with level of fill.

Accedi per commentare.

Categorie

Scopri di più su C Shared Library Integration in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by