From c0005f8213d2ce3f549c5745005d9044182b1225 Mon Sep 17 00:00:00 2001 From: MichaelJGilroy Date: Thu, 27 Jul 2017 01:07:16 -0600 Subject: added mpi_foreach_implementation --- eclass/mpi-select.eclass | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/eclass/mpi-select.eclass b/eclass/mpi-select.eclass index 918fe71..dda7d59 100644 --- a/eclass/mpi-select.eclass +++ b/eclass/mpi-select.eclass @@ -92,6 +92,46 @@ mpi_root echo "/usr/$(get_libdir)/mpi/${PF}" } +# @FUNCTION: mpi_foreach_implementation +# @DESCRIPTION: +# Iterates through each implementation and executes src_* commands +mpi_foreach_implementation() +{ + debug-print-function ${FUNCNAME} "${@}" + + # [[ -z "${INSTALLED_IMPLEMENTATIONS}" ]] \ + # die "No mpi implementations detected" + + local status=0 + + for implementation in "${MPI_TARGETS}" + do + # iterate through implementations, repeat same commands for each variant + if [[ "${IMPLEMENTATION_LIST}" ~= *"${implementation}"* ]] + local BUILD_DIR="${WORKDIR}/build" + + # modeling after multibuild for testing & learning + _mpi_run() + { + local i=1 + while [[ ${!1} == _* ]];do + i+=1 + done + + [[ ${i} -le ${#} ]] + einfo ${@} + echo ${@} + } + else + die "invalid implementation!" + fi + + + done + + echo "${status}" +} + # @FUNCTION: _mpi_do # @DESCRIPTION: # mpi-sepecific build functions to be called from mpi pkg ebuilds -- cgit v1.2.3-65-gdbad