[Insight-users] Using netlib routines in ITK application

Reinhard Hameeteman reinhard.afstuderen at gmail.com
Tue Jul 11 17:42:44 EDT 2006


Hi all,

I hope some can help me on the following. It may not be specifically
ITK, but because there are netlib routines integrated in some ITK
classes there should be someone who know more about this topic.

The problem is as follows. I made an ITK application to remove the
divergence from a vector field. To do this I use the fast poisson
solver pois3d from netlib. More specifically I use the with f2c
converted C version pois3d.c
In the ITK program I declare this function as
extern "C" {
  int pois3d_( int    *lperod, int    *l,      double *c1,
               int    *mperod, int    *m,      double *c2,
               int    *nperod, int    *n,
               double *a,      double *b,      double*c,
               int    *ldimf,  int    *mdimf,
               double *f,      int    *ierror, double*w);
}

and I call the function with

  pois3d_( &Lperod, &numberOfXUnknowns, &C1,
           &Mperod, &numberOfYUnknowns, &C2,
           &Nperod, &numberOfZUnknowns,  C3, C4, C3,
           &XDimensionF, &YDimensionF,   F, &ierror, W);

Under windows I link the program with f2c.lib using the cmake command
TARGET_LINK_LIBRARIES and under linux I link it with f2c and m like
stated in the converted routines.

This is all going fine using MSVC, but when I use gcc the parameters
are not rightly passed to pois3d_ which of course results in errors.

Does anyone have a clue what's going on or where I can find info on this?

Thanks

Reinhard


More information about the Insight-users mailing list