diff options
author | 2017-07-10 18:18:34 +0000 | |
---|---|---|
committer | 2017-07-10 18:18:34 +0000 | |
commit | 6b12395b436dc29e9e2e5e164e0db6fc4250c603 (patch) | |
tree | 88371e392a118424b33e7f4ba20ab877e3edb28d | |
parent | manifest changes for repoman (diff) | |
download | gentoo-mpi-6b12395b436dc29e9e2e5e164e0db6fc4250c603.tar.gz gentoo-mpi-6b12395b436dc29e9e2e5e164e0db6fc4250c603.tar.bz2 gentoo-mpi-6b12395b436dc29e9e2e5e164e0db6fc4250c603.zip |
removed incorrect src_* settings, removed multilib emulation in favor of multilib inheritence
-rw-r--r-- | eclass/mpi-select-r1.eclass | 212 | ||||
-rw-r--r-- | eclass/mpi-select.eclass | 145 |
2 files changed, 70 insertions, 287 deletions
diff --git a/eclass/mpi-select-r1.eclass b/eclass/mpi-select-r1.eclass deleted file mode 100644 index 078dbc2..0000000 --- a/eclass/mpi-select-r1.eclass +++ /dev/null @@ -1,212 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: mpi-select.eclass -# @MAINTAINER: -# Michael Gilroy <michael.gilroy24@gmail.com> -# @BLURB: Allow mpi software to select mpi implementation of choice. - -inherit multilib flag-o-matic - -EXPORT_FUNCTIONS src_configure src_compile src_test src_install - -case ${EAPI:-0} in - 6) ;; - 5) ;; - *) die "mpi-select.eclass does not support EAPI ${EAPI}" -esac - -# @ECLASS-VARIABLE: IMPLEMENTATION_LIST -# @INTERNAL -# @DESCRIPTION: -# List of used MPI implementation -IMPLEMENTATION_LIST="mpich mpich2 openmpi openib-mvapich2" - -# @ECLASS-VARIABLE: INSTALLED_IMPLEMENTATIONS -# @INTERNAL -# @DESCRIPTION: -# List of used MPI implementation -INSTALLED_IMPLEMENTATIONS=get_all_implementations - -# @ECLASS-VARIABLE: MPI_DIR -# @INTERNAL -# @DESCRIPTION: -# Location in which mpi software should be installed -MPI_DIR="/usr/$(get_libdir)/mpi" - -# @ECLASS-VARIABLE: MPI_TARGETS -# @INTERNAL -# @DESCRIPTION: -# List of implementations in make.conf. -MPI_TARGETS="${MPI_TARGETS}" - -# @ECLASS-FUNCTION: mpi-select_detect_installs -# @DESCRIPTION: -# See what MPI software is installed on the system -get_all_implemenetations() -{ - for dir in "${MPI_DIR}"/* - do - INSTALLED_IMPLEMENTATIONS="${INSTALLED_IMPLEMENTATIONS} ${dir}" - done - - echo "${INSTALLED_IMPLEMENTATIONS}" -} - -# @ECLASS-FUNCTION: mpi_foreach_implementation -# @DESCRIPTION: -# Iterates through each given implementation and repeats commands for each implementation -mpi_foreach_implementation() -{ - debug-print-function ${FUNCNAME} "${@}" - - # [[ -z "${INSTALLED_IMPLEMENTATIONS}" ]] \ - # die "No mpi implementations detected" - - local status=0 - - for implementation in "${@}" - do - # iterate through implementations, repeat same commands for each variant - if [[ "${IMPLEMENTATION_LIST}" == *"${implementation}"* ]]; then - local BUILD_DIR="${WORKDIR}/build" - einfo ${BUILD_DIR} - - # modeling after multibuild for testing & learning - _mpi_run() - { - local i=1 - while [[ ${!1} == _* ]];do - i+=1 - done - - [[ ${i} -le ${#} ]] - einfo ${@} - echo ${@} - } - - _mpi_run "${@}" - else - die "invalid implementation!" - fi - - - done - - echo "${status}" -} - -# @ECLASS-FUNCTION: mpi_wrapper -# @DESCRIPTION: -# Helper function for setting up environment -mpi_wrapper() -{ - export BUILD_DIR="${PF}-${ABI}" - - echo ${impl} -} - -# @ECLASS-FUNCTION: mpi-select_get_implementation -# @DESCRIPTION: -# Helper function for getting the current implementation in use -mpi-select_get_implementation() -{ - echo "${PN}" -} - -# @ECLASS-FUNCTION: mpi-select_bindir -# @DESCRIPTION: -# Helper function for getting the directory for binaries to be installed to -mpi-select_bindir() -{ - echo "${D}/usr/bin/${PF}/" -} - -# @ECLASS-FUNCTION: mpi-select_libdir -# @DESCRIPTION: -# Helper function for getting the directory for libraries to be installed to -mpi-select_libdir() -{ - echo "${D}/usr/$(get_libdir)/${PF}/" -} - -# @ECLASS-FUNCTION: mpi-select_etcdir -# @DESCRIPTION: -# Helper function for getting the directory for /etc* to be installed to -mpi-select_etcdir() -{ - echo "${D}/etc/${PF}/" -} - -########################### -# MPI SRC PHASE FUNCTIONS # -########################### - -mpi_src_configure() -{ - append-cflags -std=gnu89 - - if [[ "${imp}" == "mpich" ]]; then - local c= - if use mpi-threads; then - c="${c} --with-thread-package=pthreads" - c="${c} --enable-threds=runtime" - else - if use threads; then - c="${c} --with-thrad-package=pthreads" - else - c="${c} --with-thread-package=none" - fi - c="${c} --enable-threds=single" - fi - - c="${c} --sysconfidr=${EPREFIX}/etc/${PF}" - - econf ${c} - - elif [[ "${imp}" == "openmpi" ]]; then - einfo "hit openmpi" - fi -} - -mpi_src_compile() -{ - local imp=$(mpi-select_get_implementation) - - if [[ "${imp}" == "mpich" ]]; then - if use fortran; then - mkdir "${T}"/fortran || die - mv "${ED}"usr/include/mpif* "${T}"fortran || die - else - - fi - einfo "hit mpich" - elif [[ "${imp}" == "openmpi" ]]; then - einfo "hit openmpi" - fi -} - -mpi_src_test() -{ - emake -j1 check -} - -mpi_src_install() -{ - emake DESTDIR="${D}" install - - dodir $(mpi-select_bindir) - mv "${D}"/usr/bin/* $(mpi-select_bindir) - - dodir $(mpi-select_libdir) - mv "${D}"/usr/$(get_libdir)/* $(mpi-select_libdir) - - dodir $(mpi-select_etcdir) - local i - for i in "${D}/etc/"*; do - [ "${i}" == $(mpi-select_etcdir) ] && continue - mv "${i}" $(mpi-select_etcdir) || die "failed to mv" - done - - find . -type d -empty -delete || die "could not delete empty directories" -} diff --git a/eclass/mpi-select.eclass b/eclass/mpi-select.eclass index caced64..6eddec2 100644 --- a/eclass/mpi-select.eclass +++ b/eclass/mpi-select.eclass @@ -53,19 +53,6 @@ get_all_implemenetations() echo "${INSTALLED_IMPLEMENTATIONS}" } -mpi_dependencies() -{ - ret="" - - # TODO: verify each ${impl} in MPI_TARGETS exists - for impl in ${MPI_TARGETS} - do - ret="${ret} ${impl}" - done - - echo "${ret}" -} - # @ECLASS-FUNCTION: mpi_foreach_implementation # @DESCRIPTION: # Iterates through each given implementation and repeats commands for each implementation @@ -109,87 +96,95 @@ mpi_foreach_implementation() echo "${status}" } +# @ECLASS-FUNCTION: mpi_wrapper +# @DESCRIPTION: +# Helper function for setting up environment mpi_wrapper() { export BUILD_DIR="${PF}-${ABI}" - + echo ${impl} } -# TODO: write src_configure/compile/test/ -mpi-select_src_configure() +# @ECLASS-FUNCTION: mpi-select_get_implementation +# @DESCRIPTION: +# Helper function for getting the current implementation in use +mpi-select_get_implementation() { - debug-print-function "${FUNCNAME}" "${@}" + echo "${PN}" +} - append-cflags -std=gnu89 +# @ECLASS-FUNCTION: mpi-select_bindir +# @DESCRIPTION: +# Helper function for getting the directory for binaries to be installed to +mpi-select_bindir() +{ + echo "${D}/usr/bin/${PF}/" +} - mpi-select_abi_src_configure() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_configure - else - default_src_configure - fi - popd > /dev/null || die - } +# @ECLASS-FUNCTION: mpi-select_libdir +# @DESCRIPTION: +# Helper function for getting the directory for libraries to be installed to +mpi-select_libdir() +{ + echo "${D}/usr/$(get_libdir)/${PF}/" +} - mpi_foreach_implementation mpi_wrapper mpi-select_abi_src_configure +# @ECLASS-FUNCTION: mpi-select_etcdir +# @DESCRIPTION: +# Helper function for getting the directory for /etc* to be installed to +mpi-select_etcdir() +{ + echo "${D}/etc/${PF}/" } -mpi-select_src_compile() +########################### +# MPI SRC PHASE FUNCTIONS # +########################### + +mpi_src_configure() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_compile() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_compile - else - default_src_configure - fi - popd > /dev/null || die - } + append-cflags -std=gnu89 - mpi_foreach_implementation mpi_wrapper mpi-select_abi_src_compile + if [[ "${imp}" == "mpich" ]]; then + einfo "hit mpich" + elif [[ "${imp}" == "openmpi" ]]; then + einfo "hit openmpi" + fi } -mpi-select_src_test() +mpi_src_compile() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_test() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_test - else - default_src_configure - fi - popd > /dev/null || die - } + local imp=$(mpi-select_get_implementation) - mpi_foreach_implementation mpi_wrapper mpi-select_abi_src_test + if [[ "${imp}" == "mpich" ]]; then + einfo "hit mpich" + elif [[ "${imp}" == "openmpi" ]]; then + einfo "hit openmpi" + fi } -mpi-select_src_install() +mpi_src_test() { - debug-print-function "${FUNCNAME}" "${@}" - - mpi-select_abi_src_install() - { - debug-print-function "${FUNCNAME}" "${@}" - pushd "${BUILD_DIR}" > /dev/null || die - if declare -f mpi_src_configure > /dev/null; then - mpi_src_install_ - else - default_src_configure - fi - popd > /dev/null || die - } - mpi_foreach_implementation mpi-wrapper mpi-select_abi_src_install + emake -j1 check +} + +mpi_src_install() +{ + emake DESTDIR="${D}" install + + dodir $(mpi-select_bindir) + mv "${D}"/usr/bin/* $(mpi-select_bindir) + + dodir $(mpi-select_libdir) + mv "${D}"/usr/$(get_libdir)/* $(mpi-select_libdir) + + dodir $(mpi-select_etcdir) + local i + for i in "${D}/etc/"*; do + [ "${i}" == $(mpi-select_etcdir) ] && continue + mv "${i}" $(mpi-select_etcdir) || die "failed to mv" + done + + find . -type d -empty -delete || die "could not delete empty directories" } |