aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2011-06-12 14:16:23 +0200
committerJustin Lecher <jlec@gentoo.org>2011-06-12 14:16:23 +0200
commitfa3826fc98c094a01d21208235d821c4e4ba2240 (patch)
tree8e804c7e0a093ae0f9f73a8cbdd37c8cbf527e4e /eclass/fortran-2.eclass
parentfortran-2 some cosmetic changes (diff)
parent[fortran-2.eclass] tc-has-fortran -> have-valid-fortran, remove some quotes, ... (diff)
downloadsci-fa3826fc98c094a01d21208235d821c4e4ba2240.tar.gz
sci-fa3826fc98c094a01d21208235d821c4e4ba2240.tar.bz2
sci-fa3826fc98c094a01d21208235d821c4e4ba2240.zip
Merge branch 'master' of git+ssh://git.overlays.gentoo.org/proj/sci
* 'master' of git+ssh://git.overlays.gentoo.org/proj/sci: [fortran-2.eclass] tc-has-fortran -> have-valid-fortran, remove some quotes, add checks for openmp support for other compilers Conflicts: eclass/fortran-2.eclass Signed-off-by: Justin Lecher <jlec@gentoo.org>
Diffstat (limited to 'eclass/fortran-2.eclass')
-rw-r--r--eclass/fortran-2.eclass29
1 files changed, 19 insertions, 10 deletions
diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
index 252ad3e42..dd1da730f 100644
--- a/eclass/fortran-2.eclass
+++ b/eclass/fortran-2.eclass
@@ -26,8 +26,8 @@ inherit toolchain-funcs
DEPEND="virtual/fortran"
RDEPEND="${DEPEND}"
-_tc-has-fortran() {
- local base="${T}/test-tc-fortran"
+_have-valid-fortran() {
+ local base=${T}/test-tc-fortran
cat <<- EOF > "${base}.f"
end
EOF
@@ -37,26 +37,35 @@ _tc-has-fortran() {
return ${ret}
}
-# See if the toolchain gfortran only supports OpenMP.
-_gfortran-has-openmp() {
- [[ $(tc-getFC) != *gfortran* ]] && return 0
- local base="${T}/test-fc-openmp"
+# See if the fortran supports OpenMP.
+_fortran-has-openmp() {
+ local flag
+ case "$(tc-getFC)" in
+ *gfortran*|pathf*)
+ flag=-fopenmp ;;
+ ifort)
+ flag=-openmp ;;
+ *)
+ return 0 ;;
+ esac
+ local base=${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=$?
rm -f "${base}"*
return ${ret}
}
fortran-2_pkg_setup() {
- _tc-has-fortran || \
- die "Please emerge the current gcc with USE=fortran or export FC defining a working fortran compiler"
+ _have-valid-fortran || \
+ die "Please emerge the current gcc with USE=fortran or export FC defining a working fortran compiler"
if [[ ${FCOPENMP} == 1 ]]; then
- _gfortran-has-openmp || die "Please emerge current gcc with USE=openmp"
+ _fortran-has-openmp || \
+ die "Please emerge current gcc with USE=openmp or export FC with compiler that supports OpenMP"
fi
}