Compilers for LAM-MPI

Can LAM-MPI be compiled with the combination of PG Fortran and the Gnu C, C++ compilers? My platform is 64-bit Linux. This is for a system on which I have installed the PG Fortran but have not purchased the PG C compiler.

It should be fine since you can use gcc for the C portions of the code. Granted, I haven’t compiled LAM-MPI since it was merged into OpenMPI. While dated, we do have some information about building LAM-MPI athttp://www.pgroup.com/resources/lam/lam714_pgi71.htm

  • Mat

I decided to try OpenMPI. It appears to compile fine with PG Fortran and gcc.

Actually, my last posting was incorrect. I have been having problems compiling OpenMPI with the combination of PGI Fortran and gcc. However, it seems that OpenMPI can be compiled with gcc and g77 and will still work with the PGI Fortran compilers. I easily compiled OpenMPI with gcc and g77 without errors.

I found a suggestion on the web that one just has to set the environment variables:
OMPI_MPIF77=“pgf77 -g77libs”
OMPI_MPIFC=“pgf90 -g77libs”
This way mpif77 and mpif90 call up the PG Fortran compilers, not g77 or gfortran.
I got an error: “Error - unknown switch -pthread”
when compiling a program with mpif90
I then edited the file {OpenMPI-install-dir}/share/openmpi/mpif90-wrapper-data.txt to get rid of the -pthread, and it seems to work now. I probably need to do something similar for mpif77, but I haven’t tested it yet.

However, it seems that OpenMPI can be compiled with gcc and g77 and will still work with the PGI Fortran compilers.

Yes this should work provided that you’re not using the F90 MPI modules and the Fortran symbol naming matches PGI’s. Though, it’s recommended to compile the Fortran portions of OpenMPI with the same Fortran compiler as the one you intend to use with you’re production code.

I got an error: “Error - unknown switch -pthread”

This is a GNU flag and is not recognized by PGI. It’s fine to remove it but you may need to add it to your command line if you ever use g77.

  • Mat