Re: Using Expokit in a C++ program

376 views
Skip to first unread message
Message has been deleted

Roger B. Sidje

unread,
Sep 20, 2006, 7:34:36 AM9/20/06
to exp...@googlegroups.com
> linked the object files with "g++ -o ..." to my main program.

I am pretty sure that you need an extra compiler option when you mix
C/C++ and Fortran
Try using -lg2c -lm (either one of the tow or both).

See also: http://yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html
---
RBS

On 9/20/06, Johannes Blauert <joet...@gmx.net> wrote:
>
> Hello,
>
> I'd like to use the expokit routine DGEXPV in a C++ program. Its
> definition in fortran is
>
> subroutine DGEXPV( n, m, t, v, w, tol, anorm,
> . wsp,lwsp, iwsp,liwsp, matvec, itrace,iflag )
>
> implicit none
> integer n, m, lwsp, liwsp, itrace, iflag, iwsp(liwsp)
> double precision t, tol, anorm, v(n), w(n), wsp(lwsp)
> external matvec
>
> In my C++ program I used the following definition
>
> extern "C" void dgexpv_ ( int* n, int* m, double* t, double* v,
> double* w, double* tol, double*
> anorm, double* wsp, int* lwsp, int*
> iwsp, int* liwsp,
> void (*matvec) ( double*, double*),
> int* itrace, int* iflag);
>
> I compiled the files expokit.f, blas.f, lapack.f and mataid.f with "f77
> -c filename.f" and linked the object files with "g++ -o ..." to my main
> program. Unfortunately I get the errour, that various symbols are
> undefined. But whenever I link additional object files, for example
> sample_g.o , the errors disappear, but instead I get the error message
> that some symbols are multiply defined. Can anone please help me which
> files I have to compile and to include in order to use the routine
> DGEXPV ?
>
> Thanks in advance,
>
> Johannes Blauert
>
>
> >
>

Reply all
Reply to author
Forward
0 new messages