From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QYzXs-0007pr-Ik for garchives@archives.gentoo.org; Tue, 21 Jun 2011 11:55:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 960821C1E2; Tue, 21 Jun 2011 11:54:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 556BB1C1BD for ; Tue, 21 Jun 2011 11:54:17 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C01861B4037 for ; Tue, 21 Jun 2011 11:54:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id A573380048 for ; Tue, 21 Jun 2011 11:54:15 +0000 (UTC) From: "Justin Lecher" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Justin Lecher" Message-ID: Subject: [gentoo-commits] proj/sci:master commit in: eclass/ X-VCS-Repository: proj/sci X-VCS-Files: eclass/fortran-2.eclass X-VCS-Directories: eclass/ X-VCS-Committer: jlec X-VCS-Committer-Name: Justin Lecher X-VCS-Revision: bfd2b190f937a7044231d13a47156cc4afd75274 Date: Tue, 21 Jun 2011 11:54:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 0b9a39e7d60e5bc448ff9f171d51007c commit: bfd2b190f937a7044231d13a47156cc4afd75274 Author: Justin Lecher gentoo org> AuthorDate: Tue Jun 21 10:54:26 2011 +0000 Commit: Justin Lecher gentoo org> CommitDate: Tue Jun 21 10:54:26 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3Dbfd2b190 Moved to tree --- eclass/fortran-2.eclass | 154 -----------------------------------------= ------ 1 files changed, 0 insertions(+), 154 deletions(-) diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass deleted file mode 100644 index 050e45e..0000000 --- a/eclass/fortran-2.eclass +++ /dev/null @@ -1,154 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -# Author Justin Lecher -# Test functions provided by Sebastien Fabbro and Kacper Kowalik - -# @ECLASS: fortran-2.eclass -# @MAINTAINER: -# jlec@gentoo.org -# sci@gentoo.org -# @BLURB: Simplify fortran compiler management -# @DESCRIPTION: -# If you need a fortran compiler, then you should be inheriting this ecl= ass. -# The eclass tests for working fortran compilers -# and exports the variables FC and F77. -# Optionally, it checks for extended capabilities based on -# the variable options selected in the ebuild -# The only phase function exported is fortran-2_pkg_setup. - -# @ECLASS-VARIABLE: FORTRAN_NEED_OPENMP -# @DESCRIPTION: -# Set to "1" in order to automatically have the eclass abort if the fort= ran -# compiler lacks openmp support. -: ${FORTRAN_NEED_OPENMP:=3D0} - -# @ECLASS-VARIABLE: FORTRAN_STANDARD -# @DESCRIPTION: -# Set this, if a special dialect needs to be supported. -# Generally not needed as default is sufficient. -# -# Valid settings are any combination of: 77 90 95 2003 -: ${FORTRAN_STANDARD:=3D77} - -inherit toolchain-funcs - -DEPEND=3D"virtual/fortran" -RDEPEND=3D"${DEPEND}" - -# @FUNCTION: _write_testsuite -# @DESCRIPTION: writes fortran test code -# @INTERNAL -_write_testsuite() { - local filebase=3D${T}/test-fortran - - # f77 code - cat <<- EOF > "${filebase}.f" - end - EOF - - # f90/95 code - cat <<- EOF > "${filebase}.f90" - end - EOF - - # f2003 code - cat <<- EOF > "${filebase}.f03" - procedure(), pointer :: p - end - EOF -} - -# @FUNCTION: _compile_test -# @DESCRIPTION: -# Takes fortran compiler as first argument and dialect as second. -# Checks whether the passed fortran compiler speaks the fortran dialect -# @INTERNAL -_compile_test() { - local filebase=3D${T}/test-fortran - local fcomp=3D${1} - local fdia=3D${2} - local fcode=3D${filebase}.f${fdia} - local ret - - [[ $# -eq 0 ]] && die "_compile_test() needs at least one argument" - - [[ -f ${fcode} ]] || _write_testsuite - - ${fcomp} "${fcode}" -o "${fcode}.x" >&/dev/null - ret=3D$? - - rm -f "${fcode}.x" - return ${ret} -} - -# @FUNCTION: _fortran-has-openmp -# @DESCRIPTION: -# See if the fortran supports OpenMP. -# @INTERNAL -_fortran-has-openmp() { - local flag - local filebase=3D${T}/test-fc-openmp - local fcode=3D${filebase}.f - local ret - local _fc=3D$(tc-getFC) - - cat <<- EOF > "${fcode}" - call omp_get_num_threads - end - EOF - - for flag in -fopenmp -xopenmp -openmp -mp -omp -qsmp=3Domp; do - ${_fc} ${flag} "${fcode}" -o "${fcode}.x" >&/dev/null - ret=3D$? - (( ${ret} )) || break - done - - rm -f "${fcode}.x" - return ${ret} -} - -# @FUNCTION: _die_msg -# @DESCRIPTION: Detailed description how to handle fortran support -# @INTERNAL -_die_msg() { - echo - eerror "Please install currently selected gcc version with USE=3Dfortra= n." - eerror "If you intend to use a different compiler then gfortran, please= " - eerror "set FC variable accordingly and take care that the neccessary" - eerror "fortran dialects are support." - echo - die "Currently no working fortran compiler is available" -} - -# @FUNCTION: fortran-2_pkg_setup -# @DESCRIPTION: -# Setup functionallity, checks for a valid fortran compiler and optional= ly for its openmp support. -fortran-2_pkg_setup() { - local dialect - - : ${F77:=3D$(tc-getFC)} - - : ${FORTRAN_STANDARD:=3D77} - for dialect in ${FORTRAN_STANDARD}; do - case ${dialect} in - 77) _compile_test $(tc-getF77) || _die_msg ;; - 90|95) _compile_test $(tc-getFC) 90 || _die_msg ;; - 2003) _compile_test $(tc-getFC) 03 || _die_msg ;; - 2008) die "Future" ;; - *) die "${dialect} is not a Fortran dialect." ;; - esac - done - - if [[ ${FORTRAN_NEED_OPENMP} =3D=3D 1 ]]; then - _fortran-has-openmp || \ - die "Please install current gcc with USE=3Dopenmp or set the FC varia= ble to a compiler that supports OpenMP" - fi - tc-export F77 FC -} - -case ${EAPI:-0} in - 1|2|3|4) EXPORT_FUNCTIONS pkg_setup ;; - *) die "EAPI=3D${EAPI} is not supported" ;; -esac