diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/alternatives-2.eclass | 142 | ||||
-rw-r--r-- | eclass/intel-sdp-r1.eclass | 571 | ||||
-rw-r--r-- | eclass/mpi.eclass | 478 | ||||
-rw-r--r-- | eclass/numeric-int64-multibuild.eclass | 414 | ||||
-rw-r--r-- | eclass/numeric.eclass | 138 |
5 files changed, 0 insertions, 1743 deletions
diff --git a/eclass/alternatives-2.eclass b/eclass/alternatives-2.eclass deleted file mode 100644 index 7237f0db3..000000000 --- a/eclass/alternatives-2.eclass +++ /dev/null @@ -1,142 +0,0 @@ -# Copyright 2010-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# Based in part upon 'alternatives.exlib' from Exherbo, which is: -# Copyright 2008, 2009 Bo Ørsted Andresen -# Copyright 2008, 2009 Mike Kelly -# Copyright 2009 David Leverton - -# @ECLASS: alternatives-2.eclass -# @MAINTAINER: -# Gentoo Science Project <sci@gentoo.org> -# @BLURB: Manage alternative implementations. -# @DESCRIPTION: -# Autogenerate eselect modules for alternatives and ensure that valid provider -# is set. -# -# Remove eselect modules when last provider is unmerged. -# -# If your package provides pkg_postinst or pkg_prerm phases, you need to be -# sure you explicitly run alternatives-2_pkg_{postinst,prerm} where appropriate. - -case "${EAPI:-0}" in - 0|1|2|3|4) - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" - ;; - 5|6|7) - ;; - *) - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" - ;; -esac - -DEPEND=">=app-admin/eselect-1.4.13-r101" -RDEPEND="${DEPEND} - !app-eselect/eselect-blas - !app-eselect/eselect-cblas - !app-eselect/eselect-lapack" - -# @ECLASS-VARIABLE: ALTERNATIVES_DIR -# @INTERNAL -# @DESCRIPTION: -# Alternatives directory with symlinks managed by eselect. -ALTERNATIVES_DIR="/etc/env.d/alternatives" - -# @FUNCTION: alternatives_for -# @USAGE: <alternative> <provider> <importance> <source> <target> [<source> <target> [...]] -# @DESCRIPTION: -# Set up alternative provider. -# -# EXAMPLE: -# @CODE -# alternatives_for sh bash 0 \ -# /usr/bin/sh bash -# @CODE -alternatives_for() { - debug-print-function ${FUNCNAME} "${@}" - - dodir /etc/env.d/alternatives - - ALTERNATIVESDIR_ROOT="${D%/}" \ - eselect alternatives add ${@} || die - - ALTERNATIVES_CREATED+=( ${1} ) -} - -# @FUNCTION: cleanup_old_alternatives_module -# @USAGE: <alternative> -# @DESCRIPTION: -# Remove old alternatives module. -cleanup_old_alternatives_module() { - debug-print-function ${FUNCNAME} "${@}" - - local alt=${1} old_module="${EROOT%/}/usr/share/eselect/modules/${alt}.eselect" - - if [[ -f "${old_module}" && $(grep 'ALTERNATIVE=' "${old_module}" | cut -d '=' -f 2) == "${alt}" ]]; then - local version="$(grep 'VERSION=' "${old_module}" | grep -o '[0-9.]\+')" - if [[ "${version}" == "0.1" || "${version}" == "20080924" ]]; then - einfo "rm ${old_module}" - rm "${old_module}" || eerror "rm ${old_module} failed" - fi - fi -} - -# @FUNCTION: alternatives-2_pkg_postinst -# @DESCRIPTION: -# Create eselect modules for all provided alternatives if necessary and ensure -# that valid provider is set. -# -# Also remove old eselect modules for provided alternatives. -# -# Provided alternatives are set up using alternatives_for(). -alternatives-2_pkg_postinst() { - debug-print-function ${FUNCNAME} "${@}" - - local alt - - for alt in ${ALTERNATIVES_CREATED[@]}; do - if ! eselect ${alt} show > /dev/null; then - einfo "Creating Alternative for ${alt}" - eselect alternatives create ${alt} - fi - - # Set alternative provider if there is no valid provider selected - eselect alternatives update "${alt}" - - cleanup_old_alternatives_module ${alt} - done -} - -# @FUNCTION: alternatives-2_pkg_prerm -# @DESCRIPTION: -# Ensure a valid provider is set in case the package is unmerged and -# remove autogenerated eselect modules for alternative when last -# provider is unmerged. -# -# Provided alternatives are set up using alternatives_for(). -alternatives-2_pkg_prerm() { - debug-print-function ${FUNCNAME} "${@}" - - local alt ret - - # If we are uninstalling, update alternatives to valid provider - [[ -n ${REPLACED_BY_VERSION} ]] || ignore="--ignore" - for alt in ${ALTERNATIVES_CREATED[@]}; do - eselect alternatives update "${alt}" - ret=$? - - case ${ret} in - 0) : ;; - 2) - # This was last provider for the alternative, remove eselect module - einfo "Cleaning up unused alternatives module for ${alt}" - eselect alternatives delete "${alt}" || eerror "Failed to remove ${alt}" - ;; - *) - eerror "eselect alternatives update returned \"${ret}\"" - ;; - esac - done -} - -EXPORT_FUNCTIONS pkg_postinst pkg_prerm diff --git a/eclass/intel-sdp-r1.eclass b/eclass/intel-sdp-r1.eclass deleted file mode 100644 index 12d1f868d..000000000 --- a/eclass/intel-sdp-r1.eclass +++ /dev/null @@ -1,571 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: intel-sdp-r1.eclass -# @MAINTAINER: -# Justin Lecher <jlec@gentoo.org> -# David Seifert <soap@gentoo.org> -# Sci Team <sci@gentoo.org> -# @BLURB: Handling of Intel's Software Development Products package management - -MULTILIB_COMPAT=( abi_x86_{32,64} ) - -inherit check-reqs eutils multilib-build versionator - -EXPORT_FUNCTIONS src_unpack src_install pkg_postinst pkg_postrm pkg_pretend - -if [[ ! ${_INTEL_SDP_R1_ECLASS_} ]]; then - -case "${EAPI}" in - 6) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -# @ECLASS-VARIABLE: INTEL_DIST_NAME -# @DESCRIPTION: -# The package name to download from Intel. -# To determine its value, see the links to download in -# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx -# -# e.g. parallel_studio_xe -# -# Must be defined before inheriting the eclass. -: ${INTEL_DIST_NAME:=parallel_studio_xe} - -# @ECLASS-VARIABLE: INTEL_DIST_PV -# @DEFAULT_UNSET -# @DESCRIPTION: -# The package download version from Intel. -# To determine its value, see the links to download in -# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx -# -# e.g. 2016_update1 -# -# Must be defined before inheriting the eclass. - -# @ECLASS-VARIABLE: INTEL_DIST_TARX -# @DESCRIPTION: -# The package distfile suffix. -# To determine its value, see the links to download in -# https://registrationcenter.intel.com/RegCenter/MyProducts.aspx -# -# e.g. tgz -# -# Must be defined before inheriting the eclass. -: ${INTEL_DIST_TARX:=tgz} - -# @ECLASS-VARIABLE: INTEL_SUBDIR -# @DESCRIPTION: -# The package sub-directory (without version numbers) where it will end-up in /opt/intel -# -# e.g. compilers_and_libraries -# -# To determine its value, you have to do a raw install from the Intel tarball. -: ${INTEL_SUBDIR:=compilers_and_libraries} - -# @ECLASS-VARIABLE: INTEL_SKIP_LICENSE -# @DEFAULT_UNSET -# @DESCRIPTION: -# Possibility to skip the mandatory check for licenses. Only set this if there -# is really no fix. - -# @ECLASS-VARIABLE: INTEL_RPMS_DIR -# @DESCRIPTION: -# Main subdirectory which contains the rpms to extract. -: ${INTEL_RPMS_DIR:=rpm} - -# @ECLASS-VARIABLE: INTEL_DIST_BIN_RPMS -# @DESCRIPTION: -# Functional name of rpm without any version/arch tag. -# Has to be a bash array -# -# e.g. ("icc-l-all-devel") -# -# if the rpm is located in a directory other than INTEL_RPMS_DIR you can -# specify the full path -# -# e.g. ("CLI_install/rpm/intel-vtune-amplifier-xe-cli") -[[ ${INTEL_DIST_BIN_RPMS[@]} ]] || INTEL_DIST_BIN_RPMS=() - -# @ECLASS-VARIABLE: INTEL_DIST_AMD64_RPMS -# @DESCRIPTION: -# AMD64 single arch rpms. Same syntax as INTEL_DIST_BIN_RPMS. -# Has to be a bash array. -[[ ${INTEL_DIST_AMD64_RPMS[@]} ]] || INTEL_DIST_AMD64_RPMS=() - -# @ECLASS-VARIABLE: INTEL_DIST_X86_RPMS -# @DESCRIPTION: -# X86 single arch rpms. Same syntax as INTEL_DIST_BIN_RPMS. -# Has to be a bash array. -[[ ${INTEL_DIST_X86_RPMS[@]} ]] || INTEL_DIST_X86_RPMS=() - -# @ECLASS-VARIABLE: INTEL_DIST_DAT_RPMS -# @DESCRIPTION: -# Functional name of rpm of common data which are arch free -# without any version tag. Has to be a bash array. -# -# e.g. ("openmp-l-all-devel") -# -# if the rpm is located in a directory different to INTEL_RPMS_DIR you can -# specify the full path -# -# e.g. ("CLI_install/rpm/intel-vtune-amplifier-xe-cli-common") -[[ ${INTEL_DIST_DAT_RPMS[@]} ]] || INTEL_DIST_DAT_RPMS=() - -# @ECLASS-VARIABLE: INTEL_DIST_SPLIT_ARCH -# @DESCRIPTION: -# Set to "true" if arches are to be fetched separately, instead of using -# the combined tarball. -: ${INTEL_DIST_SPLIT_ARCH:=false} - -# @FUNCTION: _isdp_path_exists -# @INTERNAL -# @USAGE: [-a|-o] <paths> -# @DESCRIPTION: -# Check if the specified paths exist. Works for all types of paths -# (files/dirs/etc...). The -a and -o flags control the requirements -# of the paths. They correspond to "and" and "or" logic. So the -a -# flag means all the paths must exist while the -o flag means at least -# one of the paths must exist. The default behavior is "and". If no -# paths are specified, then the return value is "false". -_isdp_path_exists() { - local opt=$1 - [[ ${opt} == -[ao] ]] && shift || opt="-a" - - # no paths -> return false - # same behavior as: [[ -e "" ]] - [[ $# -eq 0 ]] && return 1 - - local p r=0 - for p in "$@" ; do - [[ -e ${p} ]] - : $(( r += $? )) - done - - case ${opt} in - -a) return $(( r != 0 )) ;; - -o) return $(( r == $# )) ;; - esac - eerror "path_exists has been removed. Please see the following post" - eerror "for a replacement snippet:" - eerror "https://blogs.gentoo.org/mgorny/2018/08/09/inlining-path_exists/" - die "path_exists is banned" -} - -# @FUNCTION: _isdp_get-sdp-year -# @INTERNAL -# @DESCRIPTION: -# Gets the year component from INTEL_DIST_PV -_isdp_get-sdp-year() { - local _intel_sdp_year - _intel_sdp_year=${INTEL_DIST_PV} - _intel_sdp_year=${_intel_sdp_year%_sp*} - _intel_sdp_year=${_intel_sdp_year%_update*} - echo "${_intel_sdp_year}" -} - -# @FUNCTION: isdp_get-sdp-dir -# @DESCRIPTION: -# Gets the full rootless path to the installation directory -# -# e.g. opt/intel/compilers_and_libraries_2016.1.150 -# opt/intel/vtune_amplifier_2018.2.0.551022 -isdp_get-sdp-dir() { - local _intel_sdp_dir="opt/intel/${INTEL_SUBDIR}_$(_isdp_get-sdp-year).$(get_version_component_range 3-)" - echo "${_intel_sdp_dir}" -} - -# @FUNCTION: isdp_get-sdp-edir -# @DESCRIPTION: -# Gets the full rooted/prefixed path to the installation directory -# -# e.g. /opt/intel/compilers_and_libraries_2016.1.150 -isdp_get-sdp-edir() { - local _intel_sdp_edir="${EPREFIX%/}/$(isdp_get-sdp-dir)" - echo "${_intel_sdp_edir}" -} - -SRC_URI="${INTEL_DIST_NAME}_${INTEL_DIST_PV}.${INTEL_DIST_TARX}" -LICENSE="Intel-SDP" -# TODO: Proper slotting -# Future work, #394411 -SLOT="0" - -RESTRICT="mirror fetch" - -RDEPEND="" -DEPEND="app-arch/rpm2targz" - -S="${WORKDIR}" - -QA_PREBUILT="$(isdp_get-sdp-dir)/*" - -# @FUNCTION: isdp_convert2intel-arch -# @USAGE: <arch> -# @DESCRIPTION: -# Convert between portage arch (e.g. amd64, x86) and intel installed arch -# nomenclature (e.g. intel64, ia32) -isdp_convert2intel-arch() { - debug-print-function ${FUNCNAME} "${@}" - - case $1 in - *amd64*|abi_x86_64) - echo "intel64" - ;; - *x86*) - echo "ia32" - ;; - *) - die "Abi \'$1\' is unsupported" - ;; - esac -} - -# @FUNCTION: isdp_get-native-abi-arch -# @DESCRIPTION: -# Determine the the intel arch string of the native ABI -isdp_get-native-abi-arch() { - debug-print-function ${FUNCNAME} "${@}" - - use amd64 && echo "$(isdp_convert2intel-arch abi_x86_64)" - use x86 && echo "$(isdp_convert2intel-arch abi_x86_32)" -} - -# @FUNCTION: isdp_get-sdp-installed-arches -# @DESCRIPTION: -# Returns a space separated list of the arch suffixes used in directory -# names for enabled ABIs. Intel uses "ia32" for x86 and "intel64" for -# amd64. The result would be "ia32 intel64" if both ABIs were enabled. -isdp_get-sdp-installed-arches() { - local arch=() - use abi_x86_64 && arch+=($(isdp_convert2intel-arch abi_x86_64)) - use abi_x86_32 && arch+=($(isdp_convert2intel-arch abi_x86_32)) - echo "${arch[*]}" -} - -# @FUNCTION: _isdp_generate-list-install-rpms -# @INTERNAL -# @DESCRIPTION: -# Generates the list of fully expanded RPMs to be extracted. -_isdp_generate-list-install-rpms() { - debug-print-function ${FUNCNAME} "${@}" - - # Expand components into full RPM filenames - expand_component_into_full_rpm() { - local deref_var="${1}[@]" - local p rpm_prefix expanded_full_rpms=() - - for p in "${!deref_var}"; do - # check if a directory is prefixed - if [[ "${p}" == "${p##*/}" ]]; then - rpm_prefix="${INTEL_RPMS_DIR}/intel-" - else - rpm_prefix="" - fi - expanded_full_rpms+=( "${rpm_prefix}${p}" ) - done - echo ${expanded_full_rpms[*]} - } - - local vars_to_expand=("INTEL_DIST_BIN_RPMS" "INTEL_DIST_DAT_RPMS") - if use abi_x86_32; then - vars_to_expand+=("INTEL_DIST_X86_RPMS") - fi - if use abi_x86_64; then - vars_to_expand+=("INTEL_DIST_AMD64_RPMS") - fi - - local i fully_expanded_intel_rpms=() - for ((i=0; i<${#vars_to_expand[@]}; i++)); do - fully_expanded_intel_rpms+=($(expand_component_into_full_rpm "${vars_to_expand[i]}")) - done - echo ${fully_expanded_intel_rpms[*]} -} - -# @FUNCTION: _isdp_big-warning -# @USAGE: [pre-check | test-failed] -# @INTERNAL -# @DESCRIPTION: -# warn user that we really require a license -_isdp_big-warning() { - debug-print-function ${FUNCNAME} "${@}" - - case ${1} in - pre-check ) - ewarn "License file not found!" - ;; - - test-failed ) - ewarn "Function test failed. Most probably due to an invalid license." - ewarn "This means you already tried to bypass the license check once." - ;; - esac - - ewarn - ewarn "Make sure you have received an Intel license." - ewarn "To receive a non-commercial license, you need to register at:" - ewarn "https://software.intel.com/en-us/qualify-for-free-software" - ewarn "Install the license file into ${EPREFIX}/opt/intel/licenses" - - case ${1} in - pre-check ) - ewarn "before proceeding with installation of ${P}" - ;; - * ) - ;; - esac -} - -# @FUNCTION: _isdp_version_test -# @INTERNAL -# @DESCRIPTION: -# Testing for valid license by asking for version information of the compiler. -_isdp_version_test() { - debug-print-function ${FUNCNAME} "${@}" - - local comp - case ${PN} in - ifc ) - debug-print "Testing ifort" - comp=ifort - ;; - icc ) - debug-print "Testing icc" - comp=icc - ;; - *) - die "${PN} is not supported for testing" - ;; - esac - - local comp_full arch warn - for arch in $(isdp_get-sdp-installed-arches); do - case ${EBUILD_PHASE} in - install ) - comp_full="${ED%/}/$(isdp_get-sdp-dir)/linux/bin/${arch}/${comp}" - ;; - postinst ) - comp_full="$(isdp_get-sdp-edir)/linux/bin/${arch}/${comp}" - ;; - * ) - die "Compile test not supported in ${EBUILD_PHASE}" - ;; - esac - - debug-print "LD_LIBRARY_PATH=\"$(isdp_get-sdp-edir)/linux/bin/${arch}/\" \"${comp_full}\" -V" - - LD_LIBRARY_PATH="$(isdp_get-sdp-edir)/linux/bin/${arch}/" "${comp_full}" -V &>/dev/null || warn=yes - done - [[ ${warn} == yes ]] && _isdp_big-warning test-failed -} - -# @FUNCTION: _isdp_run-test -# @INTERNAL -# @DESCRIPTION: -# Test if installed compiler is working. -_isdp_run-test() { - debug-print-function ${FUNCNAME} "${@}" - - if [[ -z ${INTEL_SKIP_LICENSE} ]]; then - case ${PN} in - ifc | icc ) - _isdp_version_test - ;; - * ) - debug-print "No test available for ${PN}" - ;; - esac - fi -} - -# @FUNCTION: intel-sdp-r1_pkg_pretend -# @DESCRIPTION: -# -# * Check for a (valid) license before proceeding. -# -# * Check for space requirements being fulfilled. -# -intel-sdp-r1_pkg_pretend() { - debug-print-function ${FUNCNAME} "${@}" - - local warn=1 dir dirs ret arch a p - - : ${CHECKREQS_DISK_BUILD:=256M} - check-reqs_pkg_pretend - - if [[ -z ${INTEL_SKIP_LICENSE} ]]; then - if [[ ${INTEL_LICENSE_FILE} == *@* ]]; then - einfo "Looks like you are using following license server:" - einfo " ${INTEL_LICENSE_FILE}" - return 0 - fi - - dirs=( - "${EPREFIX}/opt/intel/licenses" - "$(isdp_get-sdp-edir)/licenses" - "$(isdp_get-sdp-edir)/Licenses" - ) - for dir in "${dirs[@]}" ; do - ebegin "Checking for a license in: ${dir}" - _isdp_path_exists "${dir}"/*lic && warn=0 - eend ${warn} && break - done - if [[ ${warn} == 1 ]]; then - _isdp_big-warning pre-check - die "Could not find license file" - fi - else - eqawarn "The ebuild doesn't check for presence of a proper intel license!" - eqawarn "This shouldn't be done unless there is a very good reason." - fi -} - -# @FUNCTION: intel-sdp-r1_pkg_nofetch -# @DESCRIPTION: -# Advice user to download the parallel studio tarball -pkg_nofetch() { - einfo "Please download" - einfo " ${SRC_URI}" - einfo "from" - einfo " https://registrationcenter.intel.com/RegCenter/MyProducts.aspx" - einfo "and place the tarball in your DISTDIR directory." -} - -# @FUNCTION: intel-sdp-r1_src_unpack -# @DESCRIPTION: -# Unpacking necessary rpms from tarball, extract them and rearrange the output. -intel-sdp-r1_src_unpack() { - local t - for t in ${A}; do - local r list=() source_rpms=($(_isdp_generate-list-install-rpms)) - for r in "${source_rpms[@]}"; do - list+=( ${t%%.*}/${r} ) - done - - local debug_list - debug_list="$(IFS=$'\n'; echo ${list[@]} )" - - debug-print "Adding to decompression list:" - debug-print ${debug_list} - - tar -xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log - - for r in ${list[@]}; do - einfo "Unpacking ${r}" - printf "\nUnpacking %s\n" "${r}" >> "${T}"/rpm-extraction.log - rpm2tar -O ${r} | tar -xvf - &>> "${T}"/rpm-extraction.log; assert "Unpacking ${r} failed" - done - done -} - -# @FUNCTION: intel-sdp-r1_src_install -# @DESCRIPTION: -# Install everything -intel-sdp-r1_src_install() { - debug-print-function ${FUNCNAME} "${@}" - - local i - # remove uninstall information - ebegin "Cleaning out uninstall" - while IFS='\n' read -r -d '' i; do - rm -r "${i}" || die - done < <(find opt -regextype posix-extended -regex '.*(uninstall|uninstall.sh)$' -print0) - eend - - # handle documentation - if _isdp_path_exists "opt/intel/documentation_$(_isdp_get-sdp-year)"; then - # normal man pages - if _isdp_path_exists "opt/intel/documentation_$(_isdp_get-sdp-year)/en/man/common/man1"; then - doman opt/intel/documentation_"$(_isdp_get-sdp-year)"/en/man/common/man1/* - rm -r opt/intel/documentation_"$(_isdp_get-sdp-year)"/en/man || die - fi - - use doc && dodoc -r opt/intel/documentation_"$(_isdp_get-sdp-year)"/* - - ebegin "Cleaning out documentation" - rm -r "opt/intel/documentation_$(_isdp_get-sdp-year)" || die - rm -rf "$(isdp_get-sdp-dir)"/linux/{documentation,man} || die - eend - fi - - # MPI man pages - if _isdp_path_exists "$(isdp_get-sdp-dir)/linux/mpi/man/man3"; then - doman "$(isdp_get-sdp-dir)"/linux/mpi/man/man3/* - rm -r "$(isdp_get-sdp-dir)"/linux/mpi/man || die - fi - - # licensing docs - if _isdp_path_exists "$(isdp_get-sdp-dir)/licensing/documentation"; then - dodoc -r "$(isdp_get-sdp-dir)/licensing/documentation"/* - rm -rf "$(isdp_get-sdp-dir)/licensing/documentation" || die - fi - - if _isdp_path_exists opt/intel/"${INTEL_DIST_NAME}"*/licensing; then - dodoc -r opt/intel/"${INTEL_DIST_NAME}"*/licensing - rm -rf opt/intel/"${INTEL_DIST_NAME}"* || die - fi - - # handle examples - if _isdp_path_exists "opt/intel/samples_$(_isdp_get-sdp-year)"; then - use examples && dodoc -r opt/intel/samples_"$(_isdp_get-sdp-year)"/* - - ebegin "Cleaning out examples" - rm -r "opt/intel/samples_$(_isdp_get-sdp-year)" || die - eend - fi - - # remove eclipse unconditionally - ebegin "Cleaning out eclipse files" - rm -rf opt/intel/ide_support_* || die - eend - - # repair shell scripts used for sourcing PATH (iccvars.sh and such) - ebegin "Tagging ${PN}" - find opt -name \*sh -type f -exec sed -i \ - -e "s:<.*DIR>:$(isdp_get-sdp-edir)/linux:g" \ - '{}' + || die - eend - - ebegin "Removing broken symlinks" - while IFS='\n' read -r -d '' i; do - rm "${i}" || die - done < <(find opt -xtype l -print0) - eend - - mv opt "${ED%/}"/ || die "moving files failed" - - keepdir "$(isdp_get-sdp-dir)"/licenses /opt/intel/ism/rm -} - -# @FUNCTION: intel-sdp-r1_pkg_postinst -# @DESCRIPTION: -# Test for all things working -intel-sdp-r1_pkg_postinst() { - debug-print-function ${FUNCNAME} "${@}" - - _isdp_run-test - - if [[ ${PN} = icc ]] && has_version ">=dev-util/ccache-3.1.9-r2" ; then - #add ccache links as icc might get installed after ccache - "${EROOT}"/usr/bin/ccache-config --install-links - fi - - elog "Beginning with the 2016 suite of Intel tools, Gentoo has removed" - elog "support for the eclipse plugin. If you require the IDE support," - elog "you will have to install the suite on your own, outside portage." -} - -# @FUNCTION: intel-sdp-r1_pkg_postrm -# @DESCRIPTION: -# Sanitize cache links -intel-sdp-r1_pkg_postrm() { - debug-print-function ${FUNCNAME} "${@}" - - if [[ ${PN} = icc ]] && has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then - # --remove-links would remove all links, --install-links updates them - "${EROOT}"/usr/bin/ccache-config --install-links - fi -} - -_INTEL_SDP_R1_ECLASS_=1 -fi diff --git a/eclass/mpi.eclass b/eclass/mpi.eclass deleted file mode 100644 index 3c6537196..000000000 --- a/eclass/mpi.eclass +++ /dev/null @@ -1,478 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: mpi.eclass -# @MAINTAINER: -# Justin Bronder <jsbronder@gentoo.org> -# @BLURB: Common functions for mpi-pkg.eclass and mpi-imp.eclass - -# History: -# 2009-06-26 (jsbronder): Add ability to require common use flags. -# Remove dep on eselect-mpi (it's in sys-cluster/empi) -# Use virtual/$class to get imp dep in mpi_pkg_deplist. -# 2008-11-20 (jsbronder): Initial rewrite from old mpi.eclass - -if [[ ! ${_MPI_ECLASS} ]]; then - -case ${EAPI:-0} in - 2|3|4|5) - inherit multilib ;; - 6) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -##################### -# Private Variables # -##################### - -# @ECLASS-VARIABLE: __MPI_ALL_IMPLEMENTATION_PNS -# @INTERNAL -# @DESCRIPTION: -# All known mpi implementations -__MPI_ALL_IMPLEMENTATION_PNS="mpich mpich2 openmpi lam-mpi openib-mvapich2" - -# @ECLASS-VARIABLE: __MPI_ALL_CLASSABLE_PNS -# @INTERNAL -# @DESCRIPTION: -# All mpi implentations that can be classed. -__MPI_ALL_CLASSABLE_PNS="mpich openmpi mpich2 lam-mpi" - - - -################################################################### -# Generic Functions that are used by Implementations and Packages # -################################################################### - -# @ECLASS-VARIABLE: MPI_UNCLASSED_DEP_STR -# @DEFAULT_UNSET -# @DESCRIPTION: -# String inserted into the deplist when not using a classed -# install. - -# @FUNCTION: mpi_classed -# @RETURN: True if this build is classed. -mpi_classed() { - [[ ${CATEGORY} == mpi-* ]] -} - -#empi has no support for multilib yet -mpi_classed && [[ ${_MULTILIB_BUILD} ]] && REQUIRED_USE="abi_x86_64? ( !abi_x86_32 )" - -# @FUNCTION: mpi_class -# @RETURN: The name of the current class, or nothing if unclassed. -mpi_class() { - mpi_classed && echo "${CATEGORY}" -} - -# @FUNCTION: mpi_root -# @RETURN: The root path that packages should start installing to. In the end, -# the majority of a package will will install to ${ROOT}$(mpi_root). -mpi_root() { - if mpi_classed; then - echo "/usr/$(get_libdir)/mpi/$(mpi_class)/" - else - echo "/" - fi -} - -# @FUNCTION: mpi_econf_args -# @DESCRIPTION: -# If classed, returns a list of arguments for econf that sets the -# default install locations correctly. Should be first in the list of arguments -# to econf so that any unsuitable options can be overwritten. -mpi_econf_args() { - if mpi_classed; then - local d=$(mpi_root) - local c=$(mpi_class) - local a=" - --prefix=${d}usr - --mandir=${d}usr/share/man - --infodir=${d}usr/share/info - --datadir=${d}usr/share - --sysconfdir=/etc/${c} - --localstatedir=/var/lib/${c}" - echo "${a}" - fi -} - -# @FUNCTION: _mpi_do -# @USAGE: <Standard ebuild command to replicate> -# @DESCRIPTION: -# Large wrapping class for all of the {do,new}* commands that need -# to respect the new root to install to. Works with unclassed builds as well. -# Currently supports: -# -# @CODE -# dobin newbin dodoc newdoc -# doexe newexe dohtml dolib -# dolib.a newlib.a dolib.so newlib.so -# dosbin newsbin doman newman -# doinfo dodir dohard doins -# dosym -# @CODE -_mpi_do() { - local rc prefix d - local cmd=${1} - local ran=1 - local slash=/ - local mdir="$(mpi_root)" - - if ! mpi_classed; then - $* - return ${?} - fi - - shift - if [ "${cmd#do}" != "${cmd}" ]; then - prefix="do"; cmd=${cmd#do} - elif [ "${cmd#new}" != "${cmd}" ]; then - prefix="new"; cmd=${cmd#new} - else - die "Unknown command passed to _mpi_do: ${cmd}" - fi - case ${cmd} in - bin|lib|lib.a|lib.so|sbin) - DESTTREE="${mdir}usr" ${prefix}${cmd} $* - rc=$?;; - doc) - _E_DOCDESTTREE_="../../../../${mdir}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" \ - ${prefix}${cmd} $* - rc=$? - for d in "/share/doc/${P}" "/share/doc" "/share"; do - rmdir ${D}/usr${d} &>/dev/null - done - ;; - html) - _E_DOCDESTTREE_="../../../../${mdir}usr/share/doc/${PF}/www/${_E_DOCDESTTREE_}" \ - ${prefix}${cmd} $* - rc=$? - for d in "/share/doc/${P}/html" "/share/doc/${P}" "/share/doc" "/share"; do - rmdir ${D}/usr${d} &>/dev/null - done - ;; - exe) - _E_EXEDESTTREE_="${mdir}${_E_EXEDESTTREE_}" ${prefix}${cmd} $* - rc=$?;; - man|info) - [ -d "${D}"usr/share/${cmd} ] && mv "${D}"usr/share/${cmd}{,-orig} - [ ! -d "${D}"${mdir}usr/share/${cmd} ] \ - && install -d "${D}"${mdir}usr/share/${cmd} - [ ! -d "${D}"usr/share ] \ - && install -d "${D}"usr/share - - ln -snf ../../${mdir}usr/share/${cmd} ${D}usr/share/${cmd} - ${prefix}${cmd} $* - rc=$? - rm "${D}"usr/share/${cmd} - [ -d "${D}"usr/share/${cmd}-orig ] \ - && mv "${D}"usr/share/${cmd}{-orig,} - [ "$(find "${D}"usr/share/)" == "${D}usr/share/" ] \ - && rmdir "${D}usr/share" - ;; - dir) - dodir "${@/#${slash}/${mdir}${slash}}"; rc=$?;; - hard|sym) - ${prefix}${cmd} "${mdir}$1" "${mdir}/$2"; rc=$?;; - ins) - INSDESTTREE="${mdir}${INSTREE}" ${prefix}${cmd} $*; rc=$?;; - *) - rc=0;; - esac - - [[ ${ran} -eq 0 ]] && die "mpi_do passed unknown command: ${cmd}" - return ${rc} -} -mpi_dobin() { _mpi_do "dobin" $*; } -mpi_newbin() { _mpi_do "newbin" $*; } -mpi_dodoc() { _mpi_do "dodoc" $*; } -mpi_newdoc() { _mpi_do "newdoc" $*; } -mpi_doexe() { _mpi_do "doexe" $*; } -mpi_newexe() { _mpi_do "newexe" $*; } -mpi_dohtml() { _mpi_do "dohtml" $*; } -mpi_dolib() { _mpi_do "dolib" $*; } -mpi_dolib.a() { _mpi_do "dolib.a" $*; } -mpi_newlib.a() { _mpi_do "newlib.a" $*; } -mpi_dolib.so() { _mpi_do "dolib.so" $*; } -mpi_newlib.so() { _mpi_do "newlib.so" $*; } -mpi_dosbin() { _mpi_do "dosbin" $*; } -mpi_newsbin() { _mpi_do "newsbin" $*; } -mpi_doman() { _mpi_do "doman" $*; } -mpi_newman() { _mpi_do "newman" $*; } -mpi_doinfo() { _mpi_do "doinfo" $*; } -mpi_dodir() { _mpi_do "dodir" $*; } -mpi_dohard() { _mpi_do "dohard" $*; } -mpi_doins() { _mpi_do "doins" $*; } -mpi_dosym() { _mpi_do "dosym" $*; } - - -########################################### -# Functions for MPI Implementation Builds # -########################################### - -# @FUNCTION: mpi_imp_deplist -# @DESCRIPTION: -# To be written -# @RETURNS: Returns a deplist that handles the blocking between mpi -# implementations, and any blockers as specified in MPI_UNCLASSED_DEP_STR -mpi_imp_deplist() { - local c="sys-cluster" - local pn ver - - mpi_classed && c="${CATEGORY}" - ver="" - for pn in ${__MPI_ALL_IMPLEMENTATION_PNS}; do - ver="${ver} !${c}/${pn}" - done - if ! mpi_classed && [ -n "${MPI_UNCLASSED_DEP_STR}" ]; then - ver="${ver} ${MPI_UNCLASSED_DEP_STR}" - else - ver="${ver} sys-cluster/empi" - fi - echo "${ver}" -} - -# @FUNCTION: mpi_imp_add_eselect -# @DESCRIPTION: -# To be written -mpi_imp_add_eselect() { - mpi_classed || return 0 - local c=$(mpi_class) - cp "${FILESDIR}"/${MPI_ESELECT_FILE} ${T}/${c}.eselect || die - sed -i \ - -e "s|@ROOT@|$(mpi_root)|g" \ - -e "s|@LIBDIR@|$(get_libdir)|g" \ - -e "s|@BASE_IMP@|${PN}|g" \ - ${T}/${c}.eselect || die - - eselect mpi add "${T}"/${c}.eselect || die -} - - - -######################################## -# Functions for packages requiring MPI # -######################################## - -# @ECLASS-VARIABLE: MPI_PKG_NEED_IMPS -# @DESCRIPTION: -# List of package names (${PN}) that this package is compatible -# with. Default is the list of all mpi implementations -MPI_PKG_NEED_IMPS="${MPI_PKG_NEED_IMPS:-${__MPI_ALL_CLASSABLE_PNS}}" - - -# @ECLASS-VARIABLE: MPI_PKG_USE_CXX -# @DESCRIPTION: -# Require a mpi implementation with c++ enabled. -# This feature requires EAPI 2 style use dependencies -MPI_PKG_USE_CXX="${MPI_PKG_USE_CXX:-0}" - -# @ECLASS-VARIABLE: MPI_PKG_USE_FC -# @DESCRIPTION: -# Require a mpi implementation with fortran enabled. -# This feature requires EAPI 2 style use dependencies -MPI_PKG_USE_FC="${MPI_PKG_USE_FC:-0}" - -# @ECLASS-VARIABLE: MPI_PKG_USE_ROMIO -# @DESCRIPTION: -# Require a mpi implementation with romio enabled. -# This feature requires EAPI 2 style use dependencies -MPI_PKG_USE_ROMIO="${MPI_PKG_USE_ROMIO:-0}" - -# @ECLASS-VARIABLE: MPI_PKG_USE_THREADS -# @DESCRIPTION: -# Require a mpi implementation with threads enabled. -# This feature requires EAPI 2 style use dependencies -MPI_PKG_USE_THREADS="${MPI_PKG_USE_THREADS:-0}" - -# @ECLASS-VARIABLE: MPI_PKG_USE_DEPS -# @DESCRIPTION: -# Set the use deps for the virtual mpi package -# directly. For instance, if set to 'fortran=,threads?' then a dep on -# virtual/mpi[fortran=,threads?] will be added. -# This feature requires EAPI 2 style use dependencies -MPI_PKG_USE_DEPS="${MPI_PKG_USE_DEPS}" - - -# @FUNCTION: mpi_pkg_deplist -# @DESCRIPTION: -# To be written -# @RETURN: Returns a deplist comprised of valid implementations and any blockers -# depending on if this package is building with mpi class support. -mpi_pkg_deplist() { - local pn pn2 ver usedeps invalid_imps inval - - case "${EAPI}" in - 2|3|4|5) - [[ ${MPI_PKG_USE_CXX} -ne 0 ]] \ - && usedeps=",cxx" - [[ ${MPI_PKG_USE_FC} -ne 0 ]] \ - && usedeps="${usedeps},fortran" - [[ ${MPI_PKG_USE_ROMIO} -ne 0 ]] \ - && usedeps="${usedeps},romio" - [[ "${MPI_PKG_USE_THREADS}" -ne 0 ]] \ - && usedeps="${usedeps},threads" - [ -n "${MPI_PKG_USE_DEPS}" ] \ - && usedeps="${usedeps},${MPI_PKG_USE_DEPS}" - ;; - *) - ;; - esac - - if mpi_classed; then - ver="sys-cluster/empi virtual/$(mpi_class)" - else - ver="virtual/mpi" - fi - - if [ -n "${usedeps}" ]; then - ver="${ver}[${usedeps:1}]" - fi - - if ! mpi_classed && [ -n "${MPI_UNCLASSED_DEP_STR}" ]; then - ver="${ver} ${MPI_UNCLASSED_DEP_STR}" - fi - - for pn in ${__MPI_ALL_IMPLEMENTATION_PNS}; do - inval=1 - for pn2 in ${MPI_PKG_NEED_IMPS}; do - if [ "${pn}" == "${pn2}" ]; then - inval=0 - break; - fi - done - [[ ${inval} -eq 1 ]] \ - && invalid_imps="${invalid_imps} ${pn}" - done - - for pn in ${inval_imps}; do - ver="${ver} !${c}/${pn}" - done - echo "${ver}" -} - -# @FUNCTION: mpi_pkg_base_imp -# @DESCRIPTION: -# To be written -# @RETURNS: -# Returns the ${PN} of the package providing mpi support. Works -# even when using an unclassed mpi build. -mpi_pkg_base_imp() { - if mpi_classed; then - echo "$(_get_eselect_var CLASS_BASE_MPI_IMP)" - else - local pn - for pn in ${MPI_PKG_NEED_IMPS}; do - if has_version "sys-cluster/${pn}"; then - echo "${PN}" - fi - done - fi -} - -# @FUNCTION: mpi_pkg_cc -# @DESCRIPTION: -# Returns the full path to the mpi C compiler. Trys to find one -# even if this build is unclassed. If return is empty, user should assume the -# implementation does not support this compiler -mpi_pkg_cc() { _mpi_pkg_compiler "MPI_CC" "cc"; } - -# @FUNCTION: mpi_pkg_cxx -# @DESCRIPTION: -# Returns the full path to the mpi C++ compiler. Trys to find one -# even if this build is unclassed. If return is empty, user should assume the -# implementation does not support this compiler -mpi_pkg_cxx() { _mpi_pkg_compiler "MPI_CXX" "cxx c++"; } - -# @FUNCTION: mpi_pkg_fc -# @DESCRIPTION: -# Returns the full path to the mpi f90 compiler. Trys to find one -# even if this build is unclassed. If return is empty, user should assume the -# implementation does not support this compiler -mpi_pkg_fc() { _mpi_pkg_compiler "MPI_FC" "f90 fc"; } - -# @FUNCTION: mpi_pkg_f77 -# @DESCRIPTION: -# Returns the full path to the mpi f77 compiler. Trys to find one -# even if this build is unclassed. If return is empty, user should assume the -# implementation does not support this compiler -mpi_pkg_f77() { _mpi_pkg_compiler "MPI_F77" "f77"; } - - -# @FUNCTION: mpi_pkg_set_ld_library_path -# @DESCRIPTION: -# Adds the correct path(s) to the end of LD_LIBRARY_PATH. Does -# nothing if the build is unclassed. -mpi_pkg_set_ld_library_path() { - if mpi_classed; then - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$(_get_eselect_var LD_LIBRARY_PATH)" - fi -} - -# @FUNCTION: _mpi_pkg_compiler -# @DESCRIPTION: -# If classed, we can ask eselect-mpi. Otherwise we'll look for some common -# executable names in ${ROOT}usr/bin. -_mpi_pkg_compiler() { - if mpi_classed; then - echo "$(eselect mpi printvar $(mpi_class) ${1})" - else - local suffixes=${2} - local p - - for p in ${suffixes}; do - if [ -x ${ROOT}usr/bin/mpi${p} ]; then - echo "${ROOT}usr/bin/mpi${p}" - break - fi - done - fi -} - -# @FUNCTION: mpi_pkg_set_env -# @DESCRIPTION: -# Exports 'some influential environment variables'. CC, CXX, F77, FC -mpi_pkg_set_env() { - if mpi_classed; then - _mpi_oCC=$CC - _mpi_oCXX=$CXX - _mpi_oF77=$F77 - _mpi_oFC=$FC - _mpi_oPCP=${PKG_CONFIG_PATH} - _mpi_oLLP=${LD_LIBRARY_PATH} - export CC=$(mpi_pkg_cc) - export CXX=$(mpi_pkg_cxx) - export F77=$(mpi_pkg_f77) - export FC=$(mpi_pkg_fc) - export PKG_CONFIG_PATH="$(mpi_root)$(get_libdir)/pkgconfig:${PKG_CONFIG_PATH}" - mpi_pkg_set_ld_library_path - fi -} - -# @FUNCTION: mpi_pkg_restore_env -# @DESCRIPTION: -# Attempts to undo the damage done by mpi_pkg_set_env -mpi_pkg_restore_env() { - if mpi_classed; then - export CC=$_mpi_oCC - export CXX=$_mpi_oCXX - export F77=$_mpi_oF77 - export FC=$_mpi_oFC - export PKG_CONFIG_PATH=$_mpi_oPCP - export LD_LIBRARY_PATH=$_mpi_oLLP - fi -} - - - -# @FUNCTION: _get_eselect_var -# @USAGE: <Variable to get from the class definition> -# @RETURN: If classed, and given a valid variable, the contents; empty -# otherwise. -_get_eselect_var() { - if mpi_classed && [ -n "${1}" ]; then - echo "$(eselect mpi printvar $(mpi_class) ${1} 2>/dev/null)" - fi -} - -_MPI_ECLASS=1 -fi diff --git a/eclass/numeric-int64-multibuild.eclass b/eclass/numeric-int64-multibuild.eclass deleted file mode 100644 index f720356a3..000000000 --- a/eclass/numeric-int64-multibuild.eclass +++ /dev/null @@ -1,414 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: numeric-int64-multilib.eclass -# @MAINTAINER: -# sci team <sci@gentoo.org> -# @AUTHOR: -# Author: Mark Wright <gienah@gentoo.org> -# Author: Justin Lecher <jlec@gentoo.org> -# @BLURB: Build functions for Fortran multilib int64 multibuild packages -# @DESCRIPTION: -# The numeric-int64-multilib.eclass exports USE flags and utility functions -# necessary to build packages for multilib int64 multibuild in a clean -# and uniform manner. - -if [[ ! ${_NUMERIC_INT64_MULTILIB_ECLASS} ]]; then - -# EAPI=5 is required for meaningful MULTILIB_USEDEP. -case ${EAPI:-0} in - 5) - inherit multilib ;; - 6|7) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -inherit alternatives-2 eutils fortran-2 multilib-build numeric toolchain-funcs - -IUSE="int64" - -# @ECLASS-VARIABLE: NUMERIC_INT32_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for int32 build -NUMERIC_INT32_SUFFIX="int32" - -# @ECLASS-VARIABLE: NUMERIC_INT64_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for int64 build -NUMERIC_INT64_SUFFIX="int64" - -# @ECLASS-VARIABLE: NUMERIC_STATIC_SUFFIX -# @INTERNAL -# @DESCRIPTION: -# MULTIBUILD_ID suffix for static build -NUMERIC_STATIC_SUFFIX="static" - -# @FUNCTION: numeric-int64_is_int64_build -# @DESCRIPTION: -# Returns shell true if the current multibuild is a int64 build, -# else returns shell false. -# -# Example: -# -# @CODE -# $(numeric-int64_is_int64_build) && \ -# openblas_abi_cflags+=" -DOPENBLAS_USE64BITINT" -# @CODE -numeric-int64_is_int64_build() { - debug-print-function ${FUNCNAME} "${@}" - if [[ "${MULTIBUILD_ID}" =~ "${NUMERIC_INT64_SUFFIX}" ]]; then - return 0 - else - return 1 - fi -} - -# @FUNCTION: numeric-int64_is_static_build -# @DESCRIPTION: -# Returns shell true if current multibuild is a static build, -# else returns shell false. -# -# Example: -# -# @CODE -# if $(numeric-int64_is_static_build); then -# dolib.a lib*a -# fi -# @CODE -numeric-int64_is_static_build() { - debug-print-function ${FUNCNAME} "${@}" - if [[ "${MULTIBUILD_ID}" =~ "${NUMERIC_STATIC_SUFFIX}" ]]; then - return 0 - else - return 1 - fi -} - -# @FUNCTION: numeric-int64_get_module_name -# @USAGE: [<module_name>] -# @DESCRIPTION: -# Return the numeric module name, without the .pc extension, -# for the current fortran int64 build. If the current build is not an int64 -# build, and the ebuild does not have dynamic, threads or openmp USE flags or -# they are disabled, then the module_name is ${NUMERIC_MODULE_NAME} or -# <module_name> if <module_name> is specified. -# -# Takes an optional <module_name> parameter. If no <module_name> is specified, -# uses ${NUMERIC_MODULE_NAME} as the base to calculate the module_name for the -# current build. -# -# Example: -# -# @CODE -# NUMERIC_MODULE_NAME=blas -# profname=$(numeric-int64_get_module_name) -# -# int32 build: -# -> profname == blas -# -# int64 build: -# -> profname == blas-int64 -# @CODE -numeric-int64_get_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local module_name="${1:-${NUMERIC_MODULE_NAME}}" - if has dynamic ${IUSE} && use dynamic; then - module_name+="-dynamic" - fi - if $(numeric-int64_is_int64_build); then - module_name+="-${NUMERIC_INT64_SUFFIX}" - fi - # choose posix threads over openmp when the two are set - # yet to see the need of having the two profiles simultaneously - if use_if_iuse threads; then - module_name+="-threads" - elif use_if_iuse openmp; then - module_name+="-openmp" - fi - echo "${module_name}" -} - -# @FUNCTION: _numeric-int64_get_numeric_alternative -# @INTERNAL -_numeric-int64_get_numeric_alternative() { - debug-print-function ${FUNCNAME} "${@}" - local alternative_name="${1}" - if $(numeric-int64_is_int64_build); then - alternative_name+="-${NUMERIC_INT64_SUFFIX}" - fi - echo "${alternative_name}" -} - -# @FUNCTION: numeric-int64_get_blas_alternative -# @DESCRIPTION: -# Returns the eselect blas alternative for the current -# int build type. Which is blas-int64 if called from an int64 build, -# or blas otherwise. -numeric-int64_get_blas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative blas -} - -# @FUNCTION: numeric-int64_get_cblas_alternative -# @DESCRIPTION: -# Returns the eselect cblas alternative for the current -# int build type. Which is cblas-int64 if called from an int64 build, -# or cblas otherwise. -numeric-int64_get_cblas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative cblas -} - -# @FUNCTION: numeric-int64_get_xblas_alternative -# @DESCRIPTION: -# Returns the eselect xblas alternative for the current -# int build type. Which is xblas-int64 if called from an int64 build, -# or xblas otherwise. -numeric-int64_get_xblas_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative xblas -} - -# @FUNCTION: numeric-int64_get_lapack_alternative -# @DESCRIPTION: -# Returns the eselect lapack alternative for the current -# int build type. Which is lapack-int64 if called from an int64 build, -# or lapack otherwise. -numeric-int64_get_lapack_alternative() { - debug-print-function ${FUNCNAME} "${@}" - _numeric-int64_get_numeric_alternative lapack -} - -# @FUNCTION: numeric-int64_get_blas_module_name -# @DESCRIPTION: -# Returns the pkg-config file name, without the .pc extension, -# for the currently selected blas-int64 module if we are performing an int64 -# build, or the currently selected blas module otherwise. -numeric-int64_get_blas_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local blas_alternative=$(numeric-int64_get_blas_alternative) - local blas_symlinks=( $(eselect "${blas_alternative}" files) ) - local blas_prof_symlink="$(readlink -f ${blas_symlinks[0]})" - local blas_prof_file="${blas_prof_symlink##*/}" - echo "${blas_prof_file%.pc}" -} - -# @FUNCTION: numeric-int64_get_xblas_module_name -# @DESCRIPTION: -# Returns the xblas pkg-config file name, -# without the .pc extension, for the current build. Which is xblas-int64 if -# we are performing an int64 build, or xblas otherwise. -numeric-int64_get_xblas_module_name() { - debug-print-function ${FUNCNAME} "${@}" - local xblas_provider="xblas" - if $(numeric-int64_is_int64_build); then - xblas_provider+="-${INT64_SUFFIX}" - fi - echo "${xblas_provider}" -} - -# @FUNCTION: numeric-int64_get_fortran_int64_abi_fflags -# @DESCRIPTION: -# Return the Fortran compiler flag to enable 64 bit integers for -# array indices if we are performing an int64 build, or the empty string -# otherwise. -# -# Example: -# -# @CODE -# src_configure() { -# my_configure() { -# export FCFLAGS="${FCFLAGS} $(get_abi_CFLAGS) $(numeric-int64_get_fortran_int64_abi_fflags)" -# econf $(use_enable fortran) -# } -# numeric-int64-multibuild_foreach_all_abi_variants run_in_build_dir my_configure -# } -# @CODE -numeric-int64_get_fortran_int64_abi_fflags() { - debug-print-function ${FUNCNAME} "${@}" - $(numeric-int64_is_int64_build) && echo "$(fortran_int64_abi_fflags)" -} - -# @FUNCTION: numeric-int64_get_multibuild_int_variants -# @DESCRIPTION: -# Returns the array of int64 and int32 -# multibuild combinations. -numeric-int64_get_multibuild_int_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( int32 ) variant - - use_if_iuse int64 && MULTIBUILD_VARIANTS+=( int64 ) - - echo "${MULTIBUILD_VARIANTS[@]}" -} - -# @FUNCTION: numeric-int64_get_multibuild_variants -# @DESCRIPTION: -# Returns the array of int64, int32 and static -# multibuild combinations. -numeric-int64_get_multibuild_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=$(numeric-int64_get_multibuild_int_variants) - if use_if_iuse static-libs; then - for variant in ${MULTIBUILD_VARIANTS[@]}; do - MULTIBUILD_VARIANTS+=( static_${variant} ) - done - fi - echo "${MULTIBUILD_VARIANTS[@]}" -} - -# @FUNCTION: numeric-int64_get_all_abi_variants -# @DESCRIPTION: -# Returns the array of int64, int32 and static build combinations -# combined with all multilib ABI variants. -numeric-int64_get_all_abi_variants() { - debug-print-function ${FUNCNAME} "${@}" - local abi ret=() variant - - for abi in $(multilib_get_enabled_abi_pairs); do - for variant in $(numeric-int64_get_multibuild_variants); do - if [[ ${variant} =~ int64 ]]; then - [[ ${abi} =~ amd64 ]] && ret+=( ${abi}_${variant} ) - else - ret+=( ${abi}_${variant} ) - fi - done - done - echo "${ret[@]}" -} - -# @FUNCTION: numeric-int64_ensure_blas_int_support -# @DESCRIPTION: -# Check the blas supports the necessary int types in the currently -# selected blas module. -# -# Example: -# -# @CODE -# src_prepare() { -# numeric-int64_ensure_blas_int_support -# ... -# @CODE -numeric-int64_ensure_blas_int_support() { - local MULTILIB_INT64_VARIANTS=( $(numeric-int64_get_multibuild_variants) ) - local MULTIBUILD_ID - for MULTIBUILD_ID in "${MULTILIB_INT64_VARIANTS[@]}"; do - local blas_module_name=$(numeric-int64_get_blas_module_name) - $(tc-getPKG_CONFIG) --exists "${blas_module_name}" \ - || die "${PN} requires the pkgbuild module ${blas_module_name}" - done -} - -# @FUNCTION: numeric-int64-multibuild_install_alternative -# @USAGE: <alternative name> <provider name> [extra files sources] [extra files dest] -# @DESCRIPTION: -# Install alternatives pc file and extra files for all providers for all multilib ABIs. -numeric-int64-multibuild_install_alternative() { - debug-print-function ${FUNCNAME} "${@}" - [[ $# -lt 2 ]] && die "${FUNCNAME} needs at least two arguments" - pc_file() { - debug-print-function ${FUNCNAME} "${@}" - numeric-int64_is_static_build && return - local alternative=$(_numeric-int64_get_numeric_alternative "$1") - local module_name=$(numeric-int64_get_module_name) - printf \ - "/usr/$(get_libdir)/pkgconfig/${alternative}.pc ${module_name}.pc " \ - >> "${T}"/alternative-${alternative}.sh || die - } - pc_install() { - debug-print-function ${FUNCNAME} "${@}" - numeric-int64_is_static_build && return - local alternative=$(_numeric-int64_get_numeric_alternative "$1") - local module_name=$(numeric-int64_get_module_name $2) - shift 2 - alternatives_for \ - ${alternative} ${module_name} 0 \ - $(cat "${T}"/alternative-${alternative}.sh) ${@} - rm "${T}"/alternative-${alternative}.sh || die - } - numeric-int64-multibuild_foreach_all_abi_variants pc_file ${@} - numeric-int64-multibuild_foreach_int_abi pc_install ${@} -} - -# @FUNCTION: numeric-int64-multibuild_multilib_wrapper -# @USAGE: <argv>... -# @DESCRIPTION: -# Initialize the environment for ABI selected for multibuild. -# -# Example: -# -# @CODE -# multibuild_foreach_variant run_in_build_dir \ -# numeric-int64-multibuild_multilib_wrapper my_src_install -# @CODE -numeric-int64-multibuild_multilib_wrapper() { - debug-print-function ${FUNCNAME} "${@}" - - local v="${MULTIBUILD_VARIANT%_*}" - # MULTIBUILD_VARIANT could be abi_x86_64.amd64_static_int32 - v=${v%_${NUMERIC_STATIC_SUFFIX}} - local ABI="${v#*.}" - # hack: our int64 and int32 ABIs can correspond to the same ABI - # in multilib, resulting in multiple sed replacements of headers - # and thus error like "Flag not listed in wrapper template." - # Using MULTILIB_ABI_FLAG="${ABI}", the corresponding header - # is ignored. - local MULTILIB_ABI_FLAG - case ${MULTIBUILD_VARIANT} in - *_${NUMERIC_STATIC_SUFFIX}*|*_${NUMERIC_INT64_SUFFIX}) - MULTILIB_ABI_FLAG="${ABI}" - ;; - *_${NUMERIC_INT32_SUFFIX}) - MULTILIB_ABI_FLAG="${v%.*}" - ;; - esac - - multilib_toolchain_setup "${ABI}" - readonly ABI - "${@}" || die -} - -# @FUNCTION: numeric-int64-multibuild_foreach_int_abi -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric variant (e.g. int32, int64) -numeric-int64-multibuild_foreach_int_abi() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_multibuild_int_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_foreach_variant -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric abi and static-libs (e.g. int32, int64, static) -numeric-int64-multibuild_foreach_variant() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_multibuild_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_foreach_all_abi_variants -# @USAGE: <argv> ... -# @DESCRIPTION: -# Run command for each enabled numeric variant (e.g. int32, int64, static) _AND_ -# enabled multilib ABI -numeric-int64-multibuild_foreach_all_abi_variants() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_all_abi_variants) ) - multibuild_foreach_variant numeric-int64-multibuild_multilib_wrapper "${@}" -} - -# @FUNCTION: numeric-int64-multibuild_copy_sources -# @DESCRIPTION: -# Thin wrapper around multibuild_copy_sources() -numeric-int64-multibuild_copy_sources() { - debug-print-function ${FUNCNAME} "${@}" - local MULTIBUILD_VARIANTS=( $(numeric-int64_get_all_abi_variants) ) - multibuild_copy_sources -} - -_NUMERIC_INT64_MULTILIB_ECLASS=1 -fi diff --git a/eclass/numeric.eclass b/eclass/numeric.eclass deleted file mode 100644 index 431b7afec..000000000 --- a/eclass/numeric.eclass +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: numeric.eclass -# @MAINTAINER: -# jlec@gentoo.org -# @BLURB: Maintance bits needed for *lapack* and *blas* packages -# @DESCRIPTION: -# Various functions which make the maintenance numerical algebra packages -# easier. - -if [[ ! ${_NUMERIC_ECLASS} ]]; then - -case ${EAPI:-0} in - 0|1|2|3|4|5) - inherit multilib ;; - 6|7) ;; - *) die "EAPI=${EAPI} is not supported" ;; -esac - -# @VARIABLE: NUMERIC_MODULE_NAME -# @DESCRIPTION: -# The base pkg-config module name of the package being built. -# NUMERIC_MODULE_NAME is used by the numeric-int64_get_module_name to -# determine the pkg-config module name based on whether the package -# has dynamic, threads or openmp USE flags and if so, if the user has -# turned them or, and if the current multibuild is a int64 build or not. -# -# @CODE -# NUMERIC_MODULE_NAME="openblas" -# inherit ... numeric-int64-multibuild -# @CODE -: ${NUMERIC_MODULE_NAME:=blas} - -# @FUNCTION: create_pkgconfig -# @USAGE: [ additional arguments ] -# @DESCRIPTION: -# Creates and installs pkg-config file. The function should only be executed in -# src_install(). For further information about optional arguments please consult -# http://people.freedesktop.org/~dbn/pkg-config-guide.html -# -# @CODE -# Optional arguments are: -# -# -p | --prefix Offset for current package (${EPREFIX}/usr) -# -e | --exec-prefix Offset for current package (${prefix}) -# -L | --libdir Libdir to use (${prefix}/$(get_libdir)) -# -I | --includedir Includedir to use (${prefix}/include) -# -n | --name A human-readable name (PN} -# -d | --description A brief description (DESCRIPTION) -# -V | --version Version of the package (PV) -# -u | --url Web presents (HOMEPAGE) -# -r | --requires Packages required by this package (unset) -# -l | --libs Link flags specific to this package (unset) -# -c | --cflags Compiler flags specific to this package (unset) -# --requires-private Like --requires, but not exposed (unset) -# --conflicts Packages that this one conflicts with (unset) -# --libs-private Like --libs, but not exposed (unset) -# @CODE -create_pkgconfig() { - debug-print-function ${FUNCNAME} "${@}" - local pcfilename pcrequires pcrequirespriv pcconflicts pclibs pclibspriv pccflags - local pcprefix="${EPREFIX}/usr" - local pcexecprefix="${pcprefix}" - local pclibdir="${EPREFIX}/usr/$(get_libdir)" - local pcincldir="${pcprefix}/include" - local pcname=${PN} - local pcdescription="${DESCRIPTION}" - local pcurl=${HOMEPAGE} - local pcversion=${PV} - - [[ "${EBUILD_PHASE}" != "install" ]] && \ - die "create_pkgconfig should only be used in src_install()" - - while (($#)); do - case ${1} in - -p | --prefix ) - shift; pcprefix=${1} ;; - -e | --exec-prefix ) - shift; pcexecprefix=${1} ;; - -L | --libdir ) - shift; pclibdir=${1} ;; - -I | --includedir ) - shift; pcincldir=${1} ;; - -n | --name ) - shift; pcname=${1} ;; - -d | --description ) - shift; pcdescription=${1} ;; - -V | --version ) - shift; pcversion=${1} ;; - -u | --url ) - shift; pcurl=${1} ;; - -r | --requires ) - shift; pcrequires=${1} ;; - --requires-private ) - shift; pcrequirespriv=${1} ;; - --conflicts ) - shift; pcconflicts=${1};; - -l | --libs ) - shift; pclibs=${1} ;; - --libs-private ) - shift; pclibspriv=${1} ;; - -c | --cflags ) - shift; pccflags=${1} ;; - -* ) - ewarn "Unknown option ${1}" ;; - * ) - pcfilename=${1} ;; - esac - shift - done - - [[ -z ${pcfilename} ]] && die "Missing name for pkg-config file" - - cat > "${T}"/${pcfilename}.pc <<- EOF - prefix="${pcprefix}" - exec_prefix="${pcexecprefix}" - libdir="${pclibdir}" - includedir="${pcincldir}" - - Name: ${pcname} - Description: ${pcdescription} - Version: ${pcversion} - URL: ${pcurl} - Requires: ${pcrequires} - Requires.private: ${pcrequirespriv} - Conflicts: ${pcconflicts} - Libs: -L\${libdir} ${pclibs} - Libs.private: ${pclibspriv} - Cflags: -I\${includedir} ${pccflags} - EOF - - insinto /usr/$(get_libdir)/pkgconfig - doins "${T}"/${pcfilename}.pc -} - -_NUMERIC_ECLASS=1 -fi |