Building MPI application
Hello, I'm trying to package https://github.com/stephaneguindon/phyml (special biological SW) with MPI support, to submit it into my OBS project (home:vojtaeus), and later possibly into science repo. When I try it without MPI as https://paste.opensuse.org/95718086 it builds perfectly. When I try to add MPI support https://paste.opensuse.org/13410182 it crashes saying [ 19s] + cd phyml-3.3.20200621 [ 19s] + '%{_openmpi_load}' [ 19s] /var/tmp/rpm-tmp.7yP9Zd: line 33: fg: no job control [ 19s] error: Bad exit status from /var/tmp/rpm-tmp.7yP9Zd (%build) I wasn't able to find any good working example, only some old projects for CentOS, which failed. How to package with MPI, please? I tried few more SW using MPI, mostly I failed. Once it builds, but I'm not sure if it's really working well... ;-) Thanks, V. -- Vojtěch Zeisek https://trapa.cz/ Komunita openSUSE GNU/Linuxu Community of the openSUSE GNU/Linux https://www.opensuse.org/
Am 11.05.21 um 15:49 schrieb Vojtěch Zeisek:
Hello, I'm trying to package https://github.com/stephaneguindon/phyml (special biological SW) with MPI support, to submit it into my OBS project (home:vojtaeus), and later possibly into science repo. When I try it without MPI as https://paste.opensuse.org/95718086 it builds perfectly. When I try to add MPI support https://paste.opensuse.org/13410182 it crashes saying [ 19s] + cd phyml-3.3.20200621 [ 19s] + '%{_openmpi_load}' [ 19s] /var/tmp/rpm-tmp.7yP9Zd: line 33: fg: no job control [ 19s] error: Bad exit status from /var/tmp/rpm-tmp.7yP9Zd (%build) I wasn't able to find any good working example, only some old projects for CentOS, which failed. How to package with MPI, please? I tried few more SW using MPI, mostly I failed. Once it builds, but I'm not sure if it's really working well... ;-) Thanks, V.
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 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]. kind regards, Christian [1] https://build.opensuse.org/package/view_file/science/openfoam2012 -- Christian Goll CGoll@suse.de SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nürnberg Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer
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
Dne úterý 11. května 2021 16:16:18 CEST, Dominique Leuenberger / DimStar napsal(a):
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
So there is nothing like Requires: openmpi ?
… %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)
Thank You, like this https://paste.opensuse.org/79731623 it builds well locally. :-) It wasn't that hard as I expected. :-)
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 -- Vojtěch Zeisek https://trapa.cz/
Komunita openSUSE GNU/Linuxu Community of the openSUSE GNU/Linux https://www.opensuse.org/
On Tue, 2021-05-11 at 16:32 +0200, Vojtěch Zeisek wrote:
Have a look at libcircle for example. The main parts will be:
BuildRequires: openmpi-macros-devel
So there is nothing like Requires: openmpi ?
Should not be needed: your program has been linked against openmpi4, RPM should have detected symbols in the form of libmpi.so.40()(64bit) and added to the binary package. This in turn would be provided by openmpi4-libs. Cheers, Dominique
participants (3)
-
Christian Goll
-
Dominique Leuenberger / DimStar
-
Vojtěch Zeisek