On Tue, 2021-05-11 at 16:01 +0200, Christian Goll wrote:
Hello Vojtěch, the opempi package does not define the macro '%{_openmpi_load}', so oyu have to source the openmpi variables with:
%define mpi_ext 3 %define mpi_prefix %{_libdir}/mpi/gcc/openmpi%{?mpi_ext} source %{mpi_prefix}/bin/mpivars.sh
Have a look at libcircle for example. The main parts will be: BuildRequires: openmpi-macros-devel … %build %setup_openmpi # now configure/build as usual e.g. %configure make %install %make_install %check %setup_openmpi make check %files … The BuildRequires already takes care of pulling in the default openmpi implementation (on TW< currently openmpi4)
I have taken this example from the openfaom2012 [1] package and just hardcoded it to opempi2. In TW you can also use openmpi[234] on leap we have openmpi[23].
Plase, no hard-coding of openmpi versions: the distro has a declared default (that changed from 2 to 4 just recently) and there is metadata (openmpi) in place to have your packages follow such moves in the future. There are very few exceptions where this would not be appropriate. Cheers, Dominique