commit:     49c918e8544ecb0141046aef3b71795b46dd1fcd
Author:     Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Tue Jan 10 01:05:02 2017 +0000
Commit:     Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
CommitDate: Tue Jan 10 01:05:02 2017 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=49c918e8

sci-biology/vcflib: disctinguish various openmp commandline switches

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sci-biology/vcflib/vcflib-9999.ebuild | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/sci-biology/vcflib/vcflib-9999.ebuild 
b/sci-biology/vcflib/vcflib-9999.ebuild
index 5a03fe4..d66d935 100644
--- a/sci-biology/vcflib/vcflib-9999.ebuild
+++ b/sci-biology/vcflib/vcflib-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -15,9 +15,9 @@ EGIT_REPO_URI="https://github.com/vcflib/vcflib.git";
 LICENSE="MIT-with-advertising"
 SLOT="0"
 KEYWORDS=""
-IUSE="mpi"
+IUSE="openmp"
 
-DEPEND="mpi? ( sys-cluster/openmpi )"
+DEPEND=""
 RDEPEND="${DEPEND}"
 # contains bundled sci-biology/htslib ?
 # see also ./include for possible traces of other bundled sw
@@ -26,10 +26,21 @@ src_prepare(){
        default
        sed -e "s/^CXX = g++/CXX = $(tc-getCXX)/" -i Makefile || die
        sed -e "s/^CXXFLAGS = -O3/CXXFLAGS = ${CXXFLAGS}/" -i Makefile || die
+       # openmp detection stolen from velvet-1.2.10.ebuild
+       if use openmp; then
+               if [[ $(tc-getCXX) =~ g++ ]]; then
+                       local eopenmp=-fopenmp
+               elif [[ $(tc-getCXX) =~ cxx ]]; then
+                       local eopenmp=-openmp
+                       sed -e "s/-fopenmp/${eopenmp}/" -i Makefile || die
+               else
+                       elog "Cannot detect compiler type so not setting openmp 
support"
+               fi
+       fi
 }
 
 src_compile(){
-       if use mpi ; then
+       if use openmp ; then
                emake openmp
        else
                emake

Reply via email to