2021-05-25 18:30:56 |
Jonas L. B. |
description |
It seems that the pkg-config file for openmpi fortran (`ompi-fort.pc`) does not contain the correct include path for `mpi.mod`. It is installed at `/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/openmpi/mpi.mod` but this path is apparently not in the pc file.
Basically the following program should be compilable with `gfortran $(pkg-config ompi-fort --libs --cflags) helloworld.F90`:
```
program helloworld
use mpi
integer ierr, rank
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
write(*,*) rank, "Hello world"
call MPI_FINALIZE(ierr)
```
It works on my fedora machine where the paths are correct in the pc file, but on Ubuntu, `mpi.mod` cannot be found, because it is not included in `ompi-fort.pc`. |
It seems that the pkg-config file for openmpi fortran (`ompi-fort.pc`) does not contain the correct include path for `mpi.mod`. It is installed at `/usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/openmpi/mpi.mod` but this path is apparently not in the pc file.
Basically the following program should be compilable with `gfortran $(pkg-config ompi-fort --libs --cflags) helloworld.F90`:
```
program helloworld
use mpi
integer ierr, rank
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
write(*,*) rank, "Hello world"
call MPI_FINALIZE(ierr)
end program
```
It works on my fedora machine where the paths are correct in the pc file, but on Ubuntu, `mpi.mod` cannot be found, because it is not included in `ompi-fort.pc`. |
|