This is a proposal/discussion on how to improve the MPI packaging guidelines to simplify the spec files.
So far we have found a few tricks to simplify the script:
%global _vpath_builddir %{_vendor}-%{_target_os}-build${MPI_SUFFIX:-_serial}
for
for mpi in '' mpich %{?with_openmpi:openmpi}; do if [ -n "$mpi" ]; then module load mpi/${mpi}-%{_arch} cmake_mpi_args=( "-DCMAKE_INSTALL_PREFIX:PATH=${MPI_HOME}" "-DCMAKE_INSTALL_LIBDIR:PATH=lib" "-DUSE_MPI:BOOL=ON" ) else cmake_mpi_args=( "-DUSE_MPI:BOOL=OFF" ) fi %cmake ${cmake_mpi_args[@]} %cmake_build done
module load
%_openmpi_load
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
%mpi_load
shell
%global _vpath_builddir
%pyproject
(Build)Requires
openmpi
mpich
intel
copr
packit
spec
Tagging some people who participated in the previous issue @davidsch @ngompa @gotmax23 @james @rathann
Another approach that would be interesting to explore are defining BuildSystem. This depends on how inheritable and expandable that is.
BuildSystem
It will be some time before we are able to use that in guidelines. RPM 4.20 won't be in until Fedora 41, so we need to wait until, at the earliest, we are starting to think about F40 going EOL.
Indeed, but it would be nice to experiment and see if the implementation in RPM 4.20 is sufficient for this so that we can suggest some improvements without waiting for F40 EOL
You're completely welcome to experiment, but until there's a concrete proposal then there's not much for the committee to look at. I'm sure there are plenty of interesting things in newer RPM versions that could be used to make some of this stuff easier, so go for it. The sad fact, though, is that FPC doesn't have much experience with MPI; I probably have the most as I support computational mathematicians. In any case, please make sure to state explicitly when it's time for us to have a look at something.
In the meantime while BuildSystem is being developed, I think we can still consider how to simplify the shell approach in the top-most comment.
I think one approach is to standardize a shell variable name to be used in generic %mpi_load
%mpi_load %{expand:\\\ if [ "${MPI_VARIANT,,}" == "openmpi" ]; then %_openmpi_load elif [ "${MPI_VARIANT,,}" == "mpich" ]; then %_mpichi_load ... fi }
I think this one is worth for FPC to consider right now?
Also there is #1335, that FPC could discuss upon.
Another item to add to the list. The module load and equivalent macro should account for the change of folders due to %{buildroot}. Right now I am doing this workaround:
%{buildroot}
if [ -n "$mpi" ]; then bindir=${MPI_BIN} libdir=${MPI_LIB} else bindir=%{_bindir} libdir=%{_libdir} fi # Run packaged do_regtest.sh with appropriate buildroot runpaths env CP2K_BUILDROOTPATH=%{buildroot} \ PATH=%{buildroot}${bindir}:${PATH} \ LD_LIBRARY_PATH=%{buildroot}${libdir} \ CP2K_VARIANT=${mpi:-serial} run_tests.sh
Log in to comment on this ticket.