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 1QVjIc-0001kJ-MS for garchives@archives.gentoo.org; Sun, 12 Jun 2011 11:57:51 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 334EF1C024; Sun, 12 Jun 2011 11:57:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 03D9E1C024 for ; Sun, 12 Jun 2011 11:57:41 +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 6623C1B4025 for ; Sun, 12 Jun 2011 11:57:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9651F8003C for ; Sun, 12 Jun 2011 11:57:39 +0000 (UTC) From: "Kacper Kowalik" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kacper Kowalik" 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: xarthisius X-VCS-Committer-Name: Kacper Kowalik X-VCS-Revision: e7bf55e8a83cf631299a2af835a7a61630bfb86b Date: Sun, 12 Jun 2011 11:57:39 +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: e76e07741692156b7aaab71ed63b80a9 commit: e7bf55e8a83cf631299a2af835a7a61630bfb86b Author: Kacper Kowalik (Xarthisius) gentoo org= > AuthorDate: Sun Jun 12 11:57:32 2011 +0000 Commit: Kacper Kowalik gentoo org> CommitDate: Sun Jun 12 11:57:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3De7bf55e8 [fortran-2.eclass] tc-has-fortran -> have-valid-fortran, remove some quot= es, add checks for openmp support for other compilers --- eclass/fortran-2.eclass | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass index 0eebf3d..dbc0c2d 100644 --- a/eclass/fortran-2.eclass +++ b/eclass/fortran-2.eclass @@ -26,8 +26,8 @@ inherit toolchain-funcs DEPEND=3D"virtual/fortran" RDEPEND=3D"${DEPEND}" =20 -_tc-has-fortran() { - local base=3D"${T}/test-tc-fortran" +_have-valid-fortran() { + local base=3D${T}/test-tc-fortran cat <<-EOF > "${base}.f" end EOF @@ -37,26 +37,35 @@ _tc-has-fortran() { return ${ret} } =20 -# See if the toolchain gfortran only supports OpenMP. -_gfortran-has-openmp() { - [[ $(tc-getFC) !=3D *gfortran* ]] && return 0 - local base=3D"${T}/test-fc-openmp" +# See if the fortran supports OpenMP. +_fortran-has-openmp() { + local flag + case "$(tc-getFC)" in + *gfortran*|pathf*) + flag=3D-fopenmp ;; + ifort) + flag=3D-openmp ;; + *) + return 0 ;; + esac + local base=3D${T}/test-fc-openmp # leave extra leading space to make sure it works on fortran 77 as well cat << EOF > "${base}.f" call omp_get_num_threads end EOF - $(tc-getFC "$@") -fopenmp "${base}.f" -o "${base}" >&/dev/null + $(tc-getFC "$@") ${flag} "${base}.f" -o "${base}" >&/dev/null local ret=3D$? rm -f "${base}"* return ${ret} } =20 fortran-2_pkg_setup() { - _tc-has-fortran || \ - die "Please emerge the current gcc with USE=3Dfortran or export FC de= fining a working fortran compiler" + _have-valid-fortran || \ + die "Please emerge the current gcc with USE=3Dfortran or export FC def= ining a working fortran compiler" if [[ ${FCOPENMP} =3D=3D 1 ]]; then - _gfortran-has-openmp || die "Please emerge current gcc with USE=3Dopen= mp" + _fortran-has-openmp || \ + die "Please emerge current gcc with USE=3Dopenmp or export FC with com= piler that supports OpenMP" fi } =20