compiling with mpif90 and pgf90

I am new to cuda fortran.I have some files which I compile with mpif90 and rest with pgf90.Is there some library I need, to link the object files.Can you please give me an example of a makefile

Hi Vaibhaw Kumar,

To compile and link CUDA Fortran files, add the flag “-Mcuda”.

  • Mat

Thanks a lot for your reply.
I am trying to create a hybrid application with cuda fortran and mpi.I have fortran source files with MPI lines and sources files with cuda fortran lines.Can you give me some hint how to compile the entire application?

When I compile the way you have told me it says cannot find -lfmpich,even if I am adding the flag -Mmpi

Hi Vaibhaw,

Which PGI version are you using? Which MPI version?

PGI 2010, includes versions of MPICH, MVAPICH, and MPICH2 which would be installed in the “$PGI/linux86-64/2010” directory (by default $PGI is /opt/pgi but is user defined so could be elsewhere). The command “pgf90 -Mmpi” tells the compiler to use the PGI build MPICH version. Though at installation time, user can opt out of installing these libraries, so please make sure they are installed.

If you are using your own MPI build, then the missing “fmpich” library indicates that you did not build MPI with Fortran support. You will most likely need to rebuild you MPI with Fortran support enabled.

  • Mat