CoffeeIsLife
CoffeeIsLife

Reputation: 233

Is it possible to compile pgplot with mpif90?

I am trying to compile pgplot with mpif90 in a Linux. I am able to compile pgplot with gfortran and g77. However, I need it to be compatible with another program that was compiled with mpif90. Unfortunately, it is not possible for me to reinstall the other program (not pgplot) with gfortran. Is there a way to compile pgplot with mpif90?

Edit: I used mpif90 -v to check the compiler. It is pgf90. I wasn't aware that mpif90 was a wrapper...sorry. I will try to compile it with pgf90.

Upvotes: 0

Views: 133

Answers (1)

d_1999
d_1999

Reputation: 854

The mpif90 (and mpifort) compilers are actually just wrappers which invoke "standard" compilers with a set of extra flags that ensure the correct mpi libraries etc. are automatically linked. You can usually run mpif90 -show in order to see what command is actually being used. For example running this on a local machine I see

> mpif90 -show
/usr/bin/gfortran -I/path/to/openmpi/include -fexceptions -pthread -I/path/to/openmpi/lib64 \
    -Wl,-rpath -Wl,/path/to/openmpi/lib64 -Wl,--enable-new-dtags -L/path/to/openmpi/lib64 -lmpi_usempi -lmpi_mpifh -lmpi

which indicates mpif90 is using the system gfortran compiler "under-the-hood".

To explicitly answer your question, as long as you can compile pgplot with the compiler that mpif90 uses "under-the-hood" then you should generally be able to compile pgplot with mpif90 as well. However as long as the compiler that mpif90 wraps matches what you have used to build pgplot already then you probably don't need to explicitly compile pgplot again with mpif90.

To actually build pgplot with mpif90 will require looking into the pgplot build system and how you set the compiler. From a quick look it seems that you need to set the FCOMPL variable that appears inside the sys_<type>/*.conf files. (If this is actually the main point of your question then you may wish to edit it to make this clear)

Upvotes: 2

Related Questions