LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: adammaro_at_[hidden]
Date: 2010-07-14 21:44:49


For whom it may concern

I am a student, my name is Antonio D'Ammaro and I am experiencing some problems with MPI.

I adapted a fortran code in parallel computing.

Now I have to link it with a C++ code for an optimisation, which calls the fortran and evaluates some data and make the optimisation.

I am using intel 11.1 and the commands are:
mpif77 -c example.f
mpicc -o example ecample.cc example.o -L/usr/local/commercial/intel/fce/11.1/lib/intel64/ -lifcore

it gives me this error:
/tmp/iccNEJDne.o(.text+0x8b): In function `main':
: undefined reference to `LBM_'

The c++ code is:

#include <iostream.h>
#include <stream.h>

extern "C"
{
    void LBM_(int*,double*,int*,double*,double*);
}
int main()
{
    int r_small=7,s=26;
    double Reynolds=100,vor,pr_diff;
    cout << "The Reynolds is" << Reynolds<< endl;
    LBM_(&r_small,&Reynolds,&s,&pr_diff,&vor);
    cout << "The vorticity is" << vor<< endl;
    cout << "The pressure difference is" << pr_diff<< endl;
    cout << "Made pijo" << endl;
    return 0;
}

whereas the starting of the fortran is:

subroutine LBM(r_small,Reynolds,s,pr_diff,vor)
      implicit none
      include 'mpif.h'

.........................

return
end

Both the code alone compile with no problem, it's when I compile them together that they make problem.

I tried to compile a non MPI C++ and fortran code and it works

Have you got any idea about the failure of the merging.

Thank you very much for your attention or any adivice you will be able to give me.

Yours faithfully

Antonio D'Ammaro