Linking to OpenMPI on Ubuntu 22.04

17 views
Skip to first unread message

Adrian Croucher

unread,
Jun 20, 2023, 1:24:10 AM6/20/23
to meson...@googlegroups.com
hi

I'm just setting up a new machine which has Ubuntu 22.04 on it, and OpenMPI.

If I try to use Meson to build even a trivial MPI Fortran program, I get
the error: "Cannot open module file 'mpi.mod' for reading at (1): No
such file or directory"

The same program builds and runs OK if I use mpif90 instead.

It looks like on this system the Fortran MPI module file mpi.mod is
present at /usr/lib/x86_64-linux-gnu/fortran/gfortran-mod-15/openmpi/,
but Meson is looking for it in /usr/lib/x86_64-linux-gnu/openmpi/lib/.
On my old Ubuntu 20.04 machine, it was present in both those locations,
but on 22.04 it isn't.

Any suggestions?

- Adrian

--
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.cro...@auckland.ac.nz
tel: +64 (0)9 923 4611

Volker Weißmann

unread,
Jul 28, 2023, 5:46:46 PM7/28/23
to meson...@googlegroups.com
Hello,

we have an example [1] on how to use mpi. This works fine on my ubuntu
22.04 machine after I ran

apt-get install libopenmpi-dev


https://github.com/mesonbuild/meson/tree/master/test%20cases/frameworks/17%20mpi
Reply all
Reply to author
Forward
0 new messages