How to call the APIs of hMETIS in an application?
How can I use the static library in my application?
There is no header file, and defining an external
function prototype according to the function
specification of the manual, doesn't work.
Thx a lot for any comment,
marc
Submitted by Anonymous on Thu, 2006-11-02 10:55
»
- Login to post comments
RE: I presume that you are using
I presume that you are using C++. You need to declare the functions as extern "C".
Anyway, here is what you need to do:
---------------------------------------------------------------
#if !defined(__cdecl)
#define __cdecl
#endif
#ifdef __cplusplus
extern "C" {
#endif
void __cdecl
HMETIS_PartRecursive(int ncells, int nnets, int *cellwgt, int *netptr,
int *netind, int *netwgt, int nparts, int ufactor, int *options,
int *part, int *edgecut);
void __cdecl
HMETIS_PartKway(int ncells, int nnets, int *cellwgt, int *netptr,
int *netind, int *netwgt, int nparts, int ufactor, int *options,
int *part, int *edgecut);
#ifdef __cplusplus
}
#endif
---------------------------------------------------------------
RE: Compiling works, but API call ends up in segfault
thank your very much for the API call.
compling and linking now works, but when i try to call the API, it immediately ends up in a segmentation fault. debugging doesn't help. I have checked my memory allocation and the assignment to netind and netptr, and for me everything seems to be OK.
i've also implemented a version to call HMetis externally, and i use exactly the same hypergraph data, and this version is working.
the segmentation fault is occuring in function CreateIncidentHGraph__(), that's all my debugger can tell :-(
any hints how i could get rid off this fault?
thx in advance,
best regards,
marc
RE: it still can't work it seems
it still can't work
it seems a .h file is needed
RE: i have solved the problem
i have solved the problem ,thank you very much!