public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/sci:master commit in: sci-misc/kaldi/files/, sci-misc/kaldi/
@ 2015-01-15  6:53 Justin Lecher
  0 siblings, 0 replies; 4+ messages in thread
From: Justin Lecher @ 2015-01-15  6:53 UTC (permalink / raw
  To: gentoo-commits

commit:     37fed9bcfb03ea5915e20dc5af15c74fbf3622bc
Author:     Pavel Denisov <pavel.a.denisov <AT> gmail <DOT> com>
AuthorDate: Sun Jan 11 20:33:12 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Jan 15 06:52:56 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=37fed9bc

sci-misc/kaldi: New package

Package-Manager: portage-2.2.15

---
 sci-misc/kaldi/ChangeLog                    | 10 ++++
 sci-misc/kaldi/files/Makefile.patch         | 19 ++++++++
 sci-misc/kaldi/files/configure.patch        | 71 +++++++++++++++++++++++++++++
 sci-misc/kaldi/files/default_rules.mk.patch | 20 ++++++++
 sci-misc/kaldi/kaldi-0_p20150101.ebuild     | 57 +++++++++++++++++++++++
 sci-misc/kaldi/metadata.xml                 | 12 +++++
 6 files changed, 189 insertions(+)

diff --git a/sci-misc/kaldi/ChangeLog b/sci-misc/kaldi/ChangeLog
new file mode 100644
index 0000000..f7406fa
--- /dev/null
+++ b/sci-misc/kaldi/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for sci-misc/kaldi
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*kaldi-0_p20150101 (11 Jan 2015)
+
+  11 Jan 2015; Pavel Denisov <pavel.a.denisov@gmail.com> +files/Makefile.patch,
+  +files/configure.patch, +files/default_rules.mk.patch,
+  +kaldi-0_p20150101.ebuild, +metadata.xml:
+  sci-misc/kaldi: New package

diff --git a/sci-misc/kaldi/files/Makefile.patch b/sci-misc/kaldi/files/Makefile.patch
new file mode 100644
index 0000000..07302d6
--- /dev/null
+++ b/sci-misc/kaldi/files/Makefile.patch
@@ -0,0 +1,19 @@
+--- Makefile.orig	2015-01-01 21:51:30.999356027 -0400
++++ Makefile	2015-01-04 16:54:02.527824499 -0400
+@@ -131,6 +131,16 @@
+ ext_depend: check_portaudio
+ 	-for x in $(EXT_SUBDIRS); do $(MAKE) -C $$x depend; done
+ 
++print-binfiles: $(addsuffix /print-binfiles, $(SUBDIRS))
++
++%/print-binfiles:
++	@$(MAKE) --no-print-directory -C $(dir $@) print-binfiles
++
++print-libfiles: $(addsuffix /print-libfiles, $(SUBDIRS))
++
++%/print-libfiles:
++	@$(MAKE) --no-print-directory -C $(dir $@) print-libfiles
++
+ 
+ .PHONY: $(SUBDIRS)
+ $(SUBDIRS) : mklibdir

diff --git a/sci-misc/kaldi/files/configure.patch b/sci-misc/kaldi/files/configure.patch
new file mode 100644
index 0000000..07d663e
--- /dev/null
+++ b/sci-misc/kaldi/files/configure.patch
@@ -0,0 +1,71 @@
+--- configure.orig	2015-01-01 21:51:05.611960184 -0400
++++ configure	2015-01-01 22:06:11.027064734 -0400
+@@ -45,15 +45,6 @@
+   fi
+ }
+ 
+-
+-
+-##   First do some checks.  These verify that all the things are
+-##   here that should be here.
+-if [ "`basename $PWD`" != "src" ]; then
+-  echo 'You must run "configure" from the src/ directory.'
+-  exit 1
+-fi
+-
+ ## Default locations for FST and linear algebra libraries.
+ MATHLIB='ATLAS'
+ ATLASROOT=`rel2abs ../tools/ATLAS/`
+@@ -473,6 +464,23 @@
+   exit_success;
+ }
+ 
++function linux_configure_gentoo {
++  m=$1  # 64 or empty.
++  ATLASLIBS="/usr/lib$m/libatlas.so.3 /usr/lib$m/libf77blas.so.3 /usr/lib$m/libatlcblas.so.3 /usr/lib$m/libatlclapack.so.3"
++  for f in $ATLASLIBS; do 
++    [ ! -f $f ] && return 1;
++  done
++  libdir=$(dirname $(echo $ATLASLIBS | awk '{print $1}'))
++  [ -z "$libdir" ] && echo "Error getting libdir in linux_configure_gentoo" && exit 1;
++  echo ATLASINC = $ATLASROOT >> kaldi.mk
++  echo ATLASLIBS = $ATLASLIBS -Wl,-rpath=$libdir >> kaldi.mk
++  echo 
++  cat makefiles/linux_atlas.mk >> kaldi.mk
++  fix_cxx_flag
++  echo "Successfully configured for gentoo [dynamic libraries] with ATLASLIBS =$ATLASLIBS"
++  $use_cuda && linux_configure_cuda
++  exit_success;
++}
+ 
+ function linux_configure_static {
+   if $threaded_atlas; then pt=pt; else pt=""; fi
+@@ -716,8 +724,8 @@
+ 
+   echo "On Linux: Checking for linear algebra header files ..."
+   if [ "$MATHLIB" == "ATLAS" ]; then
+-    if [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ; then
+-      failure "Could not find required header files cblas.h or clapack.h in ATLAS dir '$ATLASROOT/include'"
++    if  ( [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ) && ( [ ! -f $ATLASROOT/cblas.h ] || [ ! -f $ATLASROOT/clapack.h ] ) ; then
++      failure "Could not find required header files cblas.h or clapack.h in ATLAS dirs '$ATLASROOT/include' or '$ATLASROOT'"
+     fi
+     echo "Using ATLAS as the linear algebra library."
+     
+@@ -741,6 +749,8 @@
+         linux_configure_debian7 || \
+         linux_configure_redhat 64 || \
+         linux_configure_redhat || \
++        linux_configure_gentoo 64 || \
++        linux_configure_gentoo || \
+         linux_atlas_failure "Failed to configure ATLAS lbiraries";
+     else
+       # Prefer dynamic to static math.
+@@ -751,6 +761,8 @@
+         linux_configure_debian7 || \
+         linux_configure_redhat 64 || \
+         linux_configure_redhat || \
++        linux_configure_gentoo 64 || \
++        linux_configure_gentoo || \
+         linux_atlas_failure "Failed to configure ATLAS lbiraries";
+     fi
+ 

diff --git a/sci-misc/kaldi/files/default_rules.mk.patch b/sci-misc/kaldi/files/default_rules.mk.patch
new file mode 100644
index 0000000..26c7f36
--- /dev/null
+++ b/sci-misc/kaldi/files/default_rules.mk.patch
@@ -0,0 +1,20 @@
+--- makefiles/default_rules.mk.orig	2015-01-10 19:56:03.918751769 -0400
++++ makefiles/default_rules.mk	2015-01-11 13:34:14.596055674 -0400
+@@ -14,7 +14,7 @@
+         LIBFILE = lib$(LIBNAME).so
+         #LDLIBS  += -l$(LIBNAME)
+       endif
+-      LDFLAGS += -Wl,-rpath=$(shell readlink -f $(KALDILIBDIR)) -L.
++      LDFLAGS += -L.
+       LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
+       XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
+     else  # Platform not supported
+@@ -84,3 +84,8 @@
+ #.depend.mk: depend
+ -include .depend.mk
+ 
++print-binfiles:
++	@echo $(addprefix $(shell pwd)/, $(BINFILES))
++
++print-libfiles:
++	@echo $(addsuffix .so, $(addprefix $(shell pwd)/lib, $(LIBNAME)))

diff --git a/sci-misc/kaldi/kaldi-0_p20150101.ebuild b/sci-misc/kaldi/kaldi-0_p20150101.ebuild
new file mode 100644
index 0000000..6403bd8
--- /dev/null
+++ b/sci-misc/kaldi/kaldi-0_p20150101.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="5"
+
+inherit eutils flag-o-matic subversion
+
+DESCRIPTION="A toolkit for speech recognition"
+HOMEPAGE="http://kaldi.sourceforge.net/"
+ESVN_REPO_URI="https://svn.code.sf.net/p/kaldi/code/trunk/src@4735"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="doc test threads"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	media-libs/speex
+	sci-libs/atlas[lapack,threads=]
+	~sci-misc/openfst-1.3.4"
+DEPEND="${RDEPEND}
+	doc? ( app-doc/doxygen )"
+
+src_prepare() {
+	epatch \
+		"${FILESDIR}"/configure.patch \
+		"${FILESDIR}"/Makefile.patch \
+		"${FILESDIR}"/default_rules.mk.patch
+}
+
+src_configure() {
+	./configure \
+		--shared \
+		--fst-root="${EPREFIX}/usr" \
+		$(use threads && echo --threaded-atlas=yes) \
+		--atlas-root="${EPREFIX}/usr/include/atlas" || die "failed to run configure"
+
+	use test || append-cxxflags -DNDEBUG
+
+	sed -i \
+		-e 's/OPENFST_VER =/OPENFST_VER = 1.3.4#/' \
+		-e "s:-g :-DHAVE_SPEEX ${CXXFLAGS} :" \
+		-e "s:-lm -lpthread -ldl:-lm -lpthread -ldl -lspeex ${LDFLAGS}:" \
+		kaldi.mk || die "sed unix/kaldi.mk failed"
+}
+
+src_compile() {
+	emake
+	use doc && doxygen
+}
+
+src_install() {
+	dolib.so $(make print-libfiles)
+	dobin $(make print-binfiles)
+	use doc && dohtml -r html/*
+}

diff --git a/sci-misc/kaldi/metadata.xml b/sci-misc/kaldi/metadata.xml
new file mode 100644
index 0000000..9e25ae0
--- /dev/null
+++ b/sci-misc/kaldi/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer>
+    <email>pavel.a.denisov@gmail.com</email>
+  </maintainer>
+  <longdescription lang="en">
+    Kaldi is a toolkit for speech recognition written
+    in C++ and licensed under the Apache License v2.0.
+    Kaldi is intended for use by speech recognition researchers.
+  </longdescription>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-misc/kaldi/files/, sci-misc/kaldi/
@ 2015-03-02  7:15 Andrew Savchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Savchenko @ 2015-03-02  7:15 UTC (permalink / raw
  To: gentoo-commits

commit:     0063c7b7e3dfa20520464d865025a83531eb6b1d
Author:     Pavel Denisov <pavel.a.denisov <AT> gmail <DOT> com>
AuthorDate: Sun Mar  1 02:40:03 2015 +0000
Commit:     Andrew Savchenko <bircoph <AT> gmail <DOT> com>
CommitDate: Sun Mar  1 02:40:47 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=0063c7b7

sci-misc/kaldi: version bump

Package-Manager: portage-2.2.17

---
 sci-misc/kaldi/ChangeLog                           |   7 +
 sci-misc/kaldi/files/Makefile.patch                |  76 +++++++---
 sci-misc/kaldi/files/configure.patch               | 164 ++++++++++++---------
 sci-misc/kaldi/files/default_rules.mk.patch        |  67 ++++++---
 ...0_p20150101.ebuild => kaldi-0_p20150301.ebuild} |   5 +-
 5 files changed, 206 insertions(+), 113 deletions(-)

diff --git a/sci-misc/kaldi/ChangeLog b/sci-misc/kaldi/ChangeLog
index f7406fa..6639e7e 100644
--- a/sci-misc/kaldi/ChangeLog
+++ b/sci-misc/kaldi/ChangeLog
@@ -2,6 +2,13 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Header: $
 
+*kaldi-0_p20150301 (01 Mar 2015)
+
+  01 Mar 2015; Pavel Denisov <pavel.a.denisov@gmail.com>
+  -kaldi-0_p20150101.ebuild, +kaldi-0_p20150301.ebuild, files/Makefile.patch,
+  files/configure.patch, files/default_rules.mk.patch:
+  Version bump.
+
 *kaldi-0_p20150101 (11 Jan 2015)
 
   11 Jan 2015; Pavel Denisov <pavel.a.denisov@gmail.com> +files/Makefile.patch,

diff --git a/sci-misc/kaldi/files/Makefile.patch b/sci-misc/kaldi/files/Makefile.patch
index 07302d6..ef1a606 100644
--- a/sci-misc/kaldi/files/Makefile.patch
+++ b/sci-misc/kaldi/files/Makefile.patch
@@ -1,19 +1,57 @@
---- Makefile.orig	2015-01-01 21:51:30.999356027 -0400
-+++ Makefile	2015-01-04 16:54:02.527824499 -0400
-@@ -131,6 +131,16 @@
- ext_depend: check_portaudio
- 	-for x in $(EXT_SUBDIRS); do $(MAKE) -C $$x depend; done
- 
-+print-binfiles: $(addsuffix /print-binfiles, $(SUBDIRS))
-+
-+%/print-binfiles:
-+	@$(MAKE) --no-print-directory -C $(dir $@) print-binfiles
-+
-+print-libfiles: $(addsuffix /print-libfiles, $(SUBDIRS))
-+
-+%/print-libfiles:
-+	@$(MAKE) --no-print-directory -C $(dir $@) print-libfiles
-+
- 
- .PHONY: $(SUBDIRS)
- $(SUBDIRS) : mklibdir
+*** Makefile.orig	2015-02-28 16:31:57.377401743 -0400
+--- Makefile	2015-02-28 16:48:58.153175376 -0400
+***************
+*** 30,36 ****
+  
+  # Reset the default goal, so that the all target will become default
+  .DEFAULT_GOAL :=
+! all: checkversion test_dependencies kaldi.mk mklibdir $(SUBDIRS)
+  	-echo Done
+  
+  mklibdir:
+--- 30,36 ----
+  
+  # Reset the default goal, so that the all target will become default
+  .DEFAULT_GOAL :=
+! all: checkversion kaldi.mk mklibdir $(SUBDIRS)
+  	-echo Done
+  
+  mklibdir:
+***************
+*** 88,103 ****
+  ext: test_dependencies ext_depend $(SUBDIRS) $(EXT_SUBDIRS)
+  	-echo Done
+  
+- ifndef OPENFST_VER
+- $(error Please rerun configure: OPENFST_VER is not defined, likely kaldi.mk was produced by older configure script.)
+- endif
+- # Note: OPENFST_VER is determined by configure and added to kaldi.mk
+- OPENFST_VER_NUM := $(shell echo $(OPENFST_VER) | sed 's/\./ /g' | xargs printf "%d%02d%02d")
+- test_dependencies:
+- ifeq ("$(shell expr $(OPENFST_VER_NUM) \< 10302)","1")
+- 	$(error OpenFst $(OPENFST_VER) is not supported. You now need OpenFst >= 1.3.2.)
+- endif
+- 
+  check_portaudio:
+  	@[ -d ../tools/portaudio ] || ( cd ../tools;  ./install_portaudio.sh )
+  
+--- 88,93 ----
+***************
+*** 131,136 ****
+--- 121,136 ----
+  ext_depend: check_portaudio
+  	-for x in $(EXT_SUBDIRS); do $(MAKE) -C $$x depend; done
+  
++ print-binfiles: $(addsuffix /print-binfiles, $(SUBDIRS))
++ 
++ %/print-binfiles:
++ 	@$(MAKE) --no-print-directory -C $(dir $@) print-binfiles
++ 
++ print-libfiles: $(addsuffix /print-libfiles, $(SUBDIRS))
++ 
++ %/print-libfiles:
++ 	@$(MAKE) --no-print-directory -C $(dir $@) print-libfiles
++ 
+  
+  .PHONY: $(SUBDIRS)
+  $(SUBDIRS) : mklibdir

diff --git a/sci-misc/kaldi/files/configure.patch b/sci-misc/kaldi/files/configure.patch
index 07d663e..f6086fc 100644
--- a/sci-misc/kaldi/files/configure.patch
+++ b/sci-misc/kaldi/files/configure.patch
@@ -1,71 +1,93 @@
---- configure.orig	2015-01-01 21:51:05.611960184 -0400
-+++ configure	2015-01-01 22:06:11.027064734 -0400
-@@ -45,15 +45,6 @@
-   fi
- }
- 
--
--
--##   First do some checks.  These verify that all the things are
--##   here that should be here.
--if [ "`basename $PWD`" != "src" ]; then
--  echo 'You must run "configure" from the src/ directory.'
--  exit 1
--fi
--
- ## Default locations for FST and linear algebra libraries.
- MATHLIB='ATLAS'
- ATLASROOT=`rel2abs ../tools/ATLAS/`
-@@ -473,6 +464,23 @@
-   exit_success;
- }
- 
-+function linux_configure_gentoo {
-+  m=$1  # 64 or empty.
-+  ATLASLIBS="/usr/lib$m/libatlas.so.3 /usr/lib$m/libf77blas.so.3 /usr/lib$m/libatlcblas.so.3 /usr/lib$m/libatlclapack.so.3"
-+  for f in $ATLASLIBS; do 
-+    [ ! -f $f ] && return 1;
-+  done
-+  libdir=$(dirname $(echo $ATLASLIBS | awk '{print $1}'))
-+  [ -z "$libdir" ] && echo "Error getting libdir in linux_configure_gentoo" && exit 1;
-+  echo ATLASINC = $ATLASROOT >> kaldi.mk
-+  echo ATLASLIBS = $ATLASLIBS -Wl,-rpath=$libdir >> kaldi.mk
-+  echo 
-+  cat makefiles/linux_atlas.mk >> kaldi.mk
-+  fix_cxx_flag
-+  echo "Successfully configured for gentoo [dynamic libraries] with ATLASLIBS =$ATLASLIBS"
-+  $use_cuda && linux_configure_cuda
-+  exit_success;
-+}
- 
- function linux_configure_static {
-   if $threaded_atlas; then pt=pt; else pt=""; fi
-@@ -716,8 +724,8 @@
- 
-   echo "On Linux: Checking for linear algebra header files ..."
-   if [ "$MATHLIB" == "ATLAS" ]; then
--    if [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ; then
--      failure "Could not find required header files cblas.h or clapack.h in ATLAS dir '$ATLASROOT/include'"
-+    if  ( [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ) && ( [ ! -f $ATLASROOT/cblas.h ] || [ ! -f $ATLASROOT/clapack.h ] ) ; then
-+      failure "Could not find required header files cblas.h or clapack.h in ATLAS dirs '$ATLASROOT/include' or '$ATLASROOT'"
-     fi
-     echo "Using ATLAS as the linear algebra library."
-     
-@@ -741,6 +749,8 @@
-         linux_configure_debian7 || \
-         linux_configure_redhat 64 || \
-         linux_configure_redhat || \
-+        linux_configure_gentoo 64 || \
-+        linux_configure_gentoo || \
-         linux_atlas_failure "Failed to configure ATLAS lbiraries";
-     else
-       # Prefer dynamic to static math.
-@@ -751,6 +761,8 @@
-         linux_configure_debian7 || \
-         linux_configure_redhat 64 || \
-         linux_configure_redhat || \
-+        linux_configure_gentoo 64 || \
-+        linux_configure_gentoo || \
-         linux_atlas_failure "Failed to configure ATLAS lbiraries";
-     fi
- 
+*** configure.orig	2015-02-28 16:31:35.568045409 -0400
+--- configure	2015-02-28 17:21:58.477634475 -0400
+***************
+*** 46,60 ****
+    fi
+  }
+  
+- 
+- 
+- ##   First do some checks.  These verify that all the things are
+- ##   here that should be here.
+- if [ "`basename $PWD`" != "src" ]; then
+-   echo 'You must run "configure" from the src/ directory.'
+-   exit 1
+- fi
+- 
+  ## Default locations for FST and linear algebra libraries.
+  MATHLIB='ATLAS'
+  ATLASROOT=`rel2abs ../tools/ATLAS/`
+--- 46,51 ----
+***************
+*** 522,527 ****
+--- 513,535 ----
+    exit_success;
+  }
+  
++ function linux_configure_gentoo {
++   m=$1  # 64 or empty.
++   ATLASLIBS="/usr/lib$m/libatlas.so.3 /usr/lib$m/libf77blas.so.3 /usr/lib$m/libatlcblas.so.3 /usr/lib$m/libatlclapack.so.3"
++   for f in $ATLASLIBS; do 
++     [ ! -f $f ] && return 1;
++   done
++   libdir=$(dirname $(echo $ATLASLIBS | awk '{print $1}'))
++   [ -z "$libdir" ] && echo "Error getting libdir in linux_configure_gentoo" && exit 1;
++   echo ATLASINC = $ATLASROOT >> kaldi.mk
++   echo ATLASLIBS = $ATLASLIBS -Wl,-rpath=$libdir >> kaldi.mk
++   echo 
++   cat makefiles/linux_atlas.mk >> kaldi.mk
++   fix_cxx_flag
++   echo "Successfully configured for gentoo [dynamic libraries] with ATLASLIBS =$ATLASLIBS"
++   $use_cuda && linux_configure_cuda
++   exit_success;
++ }
+  
+  function linux_configure_static {
+    if $threaded_atlas; then pt=pt; else pt=""; fi
+***************
+*** 682,688 ****
+  echo "FSTROOT = $FSTROOT" >> kaldi.mk
+  
+  # Check installed OpenFst version and add C++11 flags if OpenFst >= 1.4
+! OPENFST_VER=`grep 'PACKAGE_VERSION' $FSTROOT/Makefile | sed -e 's:.*= ::'`
+  echo "OPENFST_VER = $OPENFST_VER" >> kaldi.mk
+  OPENFST_VER_NUM=`echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d"`
+  if [ $OPENFST_VER_NUM -ge 10400 ]; then
+--- 690,696 ----
+  echo "FSTROOT = $FSTROOT" >> kaldi.mk
+  
+  # Check installed OpenFst version and add C++11 flags if OpenFst >= 1.4
+! OPENFST_VER="1.4.1"
+  echo "OPENFST_VER = $OPENFST_VER" >> kaldi.mk
+  OPENFST_VER_NUM=`echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d"`
+  if [ $OPENFST_VER_NUM -ge 10400 ]; then
+***************
+*** 765,772 ****
+  
+    echo "On Linux: Checking for linear algebra header files ..."
+    if [ "$MATHLIB" == "ATLAS" ]; then
+!     if [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ; then
+!       failure "Could not find required header files cblas.h or clapack.h in ATLAS dir '$ATLASROOT/include'"
+      fi
+      echo "Using ATLAS as the linear algebra library."
+      
+--- 773,780 ----
+  
+    echo "On Linux: Checking for linear algebra header files ..."
+    if [ "$MATHLIB" == "ATLAS" ]; then
+!     if  ( [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ) && ( [ ! -f $ATLASROOT/cblas.h ] || [ ! -f $ATLASROOT/clapack.h ] ) ; then
+!       failure "Could not find required header files cblas.h or clapack.h in ATLAS dirs '$ATLASROOT/include' or '$ATLASROOT'"
+      fi
+      echo "Using ATLAS as the linear algebra library."
+      
+***************
+*** 797,802 ****
+--- 805,812 ----
+      else
+        # Prefer dynamic to static math.
+        linux_configure_debian_ubuntu3 || \
++         linux_configure_gentoo 64 || \
++         linux_configure_gentoo || \
+          linux_configure_dynamic || \
+          linux_configure_static || \
+          linux_configure_debian_ubuntu 64 || \

diff --git a/sci-misc/kaldi/files/default_rules.mk.patch b/sci-misc/kaldi/files/default_rules.mk.patch
index 26c7f36..60e3430 100644
--- a/sci-misc/kaldi/files/default_rules.mk.patch
+++ b/sci-misc/kaldi/files/default_rules.mk.patch
@@ -1,20 +1,47 @@
---- makefiles/default_rules.mk.orig	2015-01-10 19:56:03.918751769 -0400
-+++ makefiles/default_rules.mk	2015-01-11 13:34:14.596055674 -0400
-@@ -14,7 +14,7 @@
-         LIBFILE = lib$(LIBNAME).so
-         #LDLIBS  += -l$(LIBNAME)
-       endif
--      LDFLAGS += -Wl,-rpath=$(shell readlink -f $(KALDILIBDIR)) -L.
-+      LDFLAGS += -L.
-       LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
-       XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
-     else  # Platform not supported
-@@ -84,3 +84,8 @@
- #.depend.mk: depend
- -include .depend.mk
- 
-+print-binfiles:
-+	@echo $(addprefix $(shell pwd)/, $(BINFILES))
-+
-+print-libfiles:
-+	@echo $(addsuffix .so, $(addprefix $(shell pwd)/lib, $(LIBNAME)))
+*** makefiles/default_rules.mk.orig	2015-02-28 16:32:00.830458169 -0400
+--- makefiles/default_rules.mk	2015-02-28 19:10:50.692172138 -0400
+***************
+*** 14,20 ****
+          LIBFILE = lib$(LIBNAME).so
+          #LDLIBS  += -l$(LIBNAME)
+        endif
+!       LDFLAGS += -Wl,-rpath=$(shell readlink -f $(KALDILIBDIR)) -L.
+        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
+        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
+      else  # Platform not supported
+--- 14,20 ----
+          LIBFILE = lib$(LIBNAME).so
+          #LDLIBS  += -l$(LIBNAME)
+        endif
+!       LDFLAGS += -L.
+        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
+        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
+      else  # Platform not supported
+***************
+*** 72,78 ****
+  test_compile: $(TESTFILES)
+    
+  test: test_compile
+! 	@result=0; for x in $(TESTFILES); do printf "Running $$x ..."; ./$$x >/dev/null 2>&1; if [ $$? -ne 0 ]; then echo "... FAIL $$x"; result=1; else echo "... SUCCESS";  fi;  done; exit $$result
+  
+  .valgrind: $(BINFILES) $(TESTFILES)
+  
+--- 72,78 ----
+  test_compile: $(TESTFILES)
+    
+  test: test_compile
+! 	@result=0; for x in $(TESTFILES); do printf "Running $$x ..."; LD_LIBRARY_PATH=$(KALDILIBDIR):${LD_LIBRARY_PATH} ./$$x >/dev/null 2>&1; if [ $$? -ne 0 ]; then echo "... FAIL $$x"; result=1; else echo "... SUCCESS";  fi;  done; exit $$result
+  
+  .valgrind: $(BINFILES) $(TESTFILES)
+  
+***************
+*** 84,86 ****
+--- 84,91 ----
+  #.depend.mk: depend
+  -include .depend.mk
+  
++ print-binfiles:
++ 	@echo $(addprefix $(shell pwd)/, $(BINFILES))
++ 
++ print-libfiles:
++ 	@echo $(addsuffix .so, $(addprefix $(shell pwd)/lib, $(LIBNAME)))

diff --git a/sci-misc/kaldi/kaldi-0_p20150101.ebuild b/sci-misc/kaldi/kaldi-0_p20150301.ebuild
similarity index 89%
rename from sci-misc/kaldi/kaldi-0_p20150101.ebuild
rename to sci-misc/kaldi/kaldi-0_p20150301.ebuild
index 9ef5703..8ba100d 100644
--- a/sci-misc/kaldi/kaldi-0_p20150101.ebuild
+++ b/sci-misc/kaldi/kaldi-0_p20150301.ebuild
@@ -8,7 +8,7 @@ inherit eutils flag-o-matic subversion
 
 DESCRIPTION="A toolkit for speech recognition"
 HOMEPAGE="http://kaldi.sourceforge.net/"
-ESVN_REPO_URI="https://svn.code.sf.net/p/kaldi/code/trunk/src@4735"
+ESVN_REPO_URI="https://svn.code.sf.net/p/kaldi/code/trunk/src@4927"
 
 LICENSE="Apache-2.0"
 SLOT="0"
@@ -18,7 +18,7 @@ KEYWORDS=""
 RDEPEND="
 	media-libs/speex
 	sci-libs/atlas[lapack,threads=]
-	~sci-misc/openfst-1.3.4"
+	>=sci-misc/openfst-1.4.1"
 DEPEND="${RDEPEND}
 	doc? ( app-doc/doxygen )"
 
@@ -41,7 +41,6 @@ src_configure() {
 	use test || append-cxxflags -DNDEBUG
 
 	sed -i \
-		-e 's/OPENFST_VER =/OPENFST_VER = 1.3.4#/' \
 		-e "s:-g :-DHAVE_SPEEX ${CXXFLAGS} :" \
 		-e "s:-lm -lpthread -ldl:-lm -lpthread -ldl -lspeex ${LDFLAGS}:" \
 		kaldi.mk || die "sed unix/kaldi.mk failed"


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-misc/kaldi/files/, sci-misc/kaldi/
@ 2015-11-20 11:39 Justin Lecher
  0 siblings, 0 replies; 4+ messages in thread
From: Justin Lecher @ 2015-11-20 11:39 UTC (permalink / raw
  To: gentoo-commits

commit:     c55b36e1b4aa36eb54f33d89aa5c18e2a740b98c
Author:     Pavel Denisov <pavel.a.denisov <AT> gmail <DOT> com>
AuthorDate: Sun Nov  8 20:28:04 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Thu Nov 19 01:20:29 2015 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=c55b36e1

sci-misc/kaldi: Version bump, switch to OpenBLAS math library by default, add CUDA support

Package-Manager: portage-2.2.24

 sci-misc/kaldi/ChangeLog                           |  8 ++
 .../kaldi/files/default_rules.mk.a7d9824.patch     | 48 ++++++++++++
 sci-misc/kaldi/kaldi-0_p20151106.ebuild            | 91 ++++++++++++++++++++++
 sci-misc/kaldi/metadata.xml                        | 11 ++-
 4 files changed, 157 insertions(+), 1 deletion(-)

diff --git a/sci-misc/kaldi/ChangeLog b/sci-misc/kaldi/ChangeLog
index fe47981..b40d171 100644
--- a/sci-misc/kaldi/ChangeLog
+++ b/sci-misc/kaldi/ChangeLog
@@ -2,6 +2,14 @@
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
 # $Id$
 
+*kaldi-0_p20151106 (08 Nov 2015)
+
+  08 Nov 2015; Pavel Denisov <pavel.a.denisov@gmail.com>
+  +files/default_rules.mk.a7d9824.patch, +kaldi-0_p20151106.ebuild,
+  metadata.xml:
+  sci-misc/kaldi: Version bump, switch to OpenBLAS math library by default, add
+  CUDA support
+
 *kaldi-0_p20150709 (18 Jul 2015)
 
   18 Jul 2015; Pavel Denisov <pavel.a.denisov@gmail.com>

diff --git a/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch
new file mode 100644
index 0000000..458d453
--- /dev/null
+++ b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch
@@ -0,0 +1,48 @@
+*** makefiles/default_rules.mk.orig	2015-10-28 22:11:07.903182744 -0400
+--- makefiles/default_rules.mk	2015-10-29 20:43:41.081851545 -0400
+***************
+*** 14,20 ****
+          LIBFILE = lib$(LIBNAME).so
+          #LDLIBS  += -l$(LIBNAME)
+        endif
+!       LDFLAGS += -Wl,-rpath=$(shell readlink -f $(KALDILIBDIR)) -L.
+        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
+        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
+      else  # Platform not supported
+--- 14,20 ----
+          LIBFILE = lib$(LIBNAME).so
+          #LDLIBS  += -l$(LIBNAME)
+        endif
+!       LDFLAGS += -L.
+        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
+        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
+      else  # Platform not supported
+***************
+*** 75,81 ****
+  	@{ result=0;			\
+  	for x in $(TESTFILES); do	\
+  	  printf "Running $$x ...";	\
+! 	  ./$$x >$$x.testlog 2>&1;	\
+  	  if [ $$? -ne 0 ]; then	\
+  	    echo "... FAIL $$x";	\
+  	    result=1;			\
+--- 75,81 ----
+  	@{ result=0;			\
+  	for x in $(TESTFILES); do	\
+  	  printf "Running $$x ...";	\
+! 	  LD_LIBRARY_PATH=$(KALDILIBDIR):${LD_LIBRARY_PATH} ./$$x >$$x.testlog 2>&1;	\
+  	  if [ $$? -ne 0 ]; then	\
+  	    echo "... FAIL $$x";	\
+  	    result=1;			\
+***************
+*** 99,101 ****
+--- 99,107 ----
+  # removing automatic making of "depend" as it's quite slow.
+  #.depend.mk: depend
+  -include .depend.mk
++ 
++ print-binfiles:
++ 	@echo $(addprefix $(shell pwd)/, $(BINFILES))
++ 
++ print-libfiles:
++ 	@echo $(addsuffix .so, $(addprefix $(shell pwd)/lib, $(LIBNAME)))

diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild
new file mode 100644
index 0000000..128c268
--- /dev/null
+++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="A toolkit for speech recognition"
+HOMEPAGE="http://kaldi-asr.org/"
+SRC_URI="http://gentoo.akreal.net/distfiles/${P}.tar.xz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="doc test threads atlas cuda"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	media-libs/speex
+	virtual/lapack
+	virtual/lapacke
+	>=sci-misc/openfst-1.4.1
+	atlas? ( sci-libs/atlas[threads=] )
+	!atlas? ( sci-libs/openblas[-openmp,-threads] sci-libs/lapack-reference )
+	cuda? ( dev-util/nvidia-cuda-toolkit )"
+DEPEND="${RDEPEND}
+	doc? ( app-doc/doxygen )"
+
+REQUIRED_USE="!atlas? ( !threads )"
+
+# We need write acccess /dev/nvidiactl, /dev/nvidia0 and /dev/nvidia-uvm and the portage
+# user is (usually) not in the video group
+RESTRICT="cuda? ( userpriv )"
+
+src_prepare() {
+	epatch \
+		"${FILESDIR}"/configure.patch \
+		"${FILESDIR}"/Makefile.patch \
+		"${FILESDIR}"/default_rules.mk.a7d9824.patch
+}
+
+src_configure() {
+	if use atlas; then
+		myconf+=( --atlas-root="${EPREFIX}/usr/include/atlas" )
+		if use threads; then
+			myconf+=( --threaded-atlas=yes )
+		fi
+	else
+		myconf+=( --openblas-root="${EPREFIX}/usr" )
+		append-cxxflags "-I${EPREFIX}/usr/include/openblas"
+		append-libs -lreflapack
+	fi
+
+	# Upstream's configure script is "hand-generated" and not autotools compatible,
+	# for this reason econf can not be used
+	./configure \
+		--shared \
+		--fst-root="${EPREFIX}/usr" \
+		$(use cuda && echo "--use-cuda=yes --cudatk-dir=${EPREFIX}/opt/cuda" \
+			|| echo --use-cuda=no) \
+		"${myconf[@]}" || die "failed to run configure"
+
+	use test || append-cxxflags -DNDEBUG
+	append-libs -lspeex
+
+	sed -i \
+		-e "s:-g # -O0 -DKALDI_PARANOID:-DHAVE_SPEEX ${CXXFLAGS} :" \
+		-e "s:-lm -lpthread -ldl:-lm -lpthread -ldl ${LIBS} ${LDFLAGS}:" \
+		-e "s:CUDA_FLAGS = -g:CUDA_FLAGS = -O2:" \
+		kaldi.mk || die "sed unix/kaldi.mk failed"
+}
+
+src_compile() {
+	default
+	use doc && doxygen
+}
+
+src_test() {
+	if use cuda; then
+		addwrite /dev/nvidiactl
+		addwrite /dev/nvidia0
+		addwrite /dev/nvidia-uvm
+	fi
+	default
+}
+
+src_install() {
+	dolib.so $(make print-libfiles)
+	dobin $(make print-binfiles)
+	use doc && dohtml -r html/*
+}

diff --git a/sci-misc/kaldi/metadata.xml b/sci-misc/kaldi/metadata.xml
index e961e51..ddeac84 100644
--- a/sci-misc/kaldi/metadata.xml
+++ b/sci-misc/kaldi/metadata.xml
@@ -3,6 +3,7 @@
 <pkgmetadata>
   <maintainer>
     <email>pavel.a.denisov@gmail.com</email>
+    <name>Pavel Denisov</name>
   </maintainer>
   <longdescription lang="en">
     Kaldi is a toolkit for speech recognition written
@@ -10,6 +11,14 @@
     Kaldi is intended for use by speech recognition researchers.
   </longdescription>
   <upstream>
-    <remote-id type="sourceforge">kaldi</remote-id>
+    <remote-id type="github">kaldi-asr/kaldi</remote-id>
   </upstream>
+  <use>
+    <flag name="atlas">
+      Use <pkg>sci-libs/atlas</pkg> for math library.
+    </flag>
+    <flag name="cuda">
+      Build with CUDA support.
+    </flag>
+  </use>
 </pkgmetadata>


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] proj/sci:master commit in: sci-misc/kaldi/files/, sci-misc/kaldi/
@ 2016-07-20 17:48 Christoph Junghans
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Junghans @ 2016-07-20 17:48 UTC (permalink / raw
  To: gentoo-commits

commit:     4bb0a5fafca7f6562b2b47c4c62bb54680237c99
Author:     Pavel Denisov <pavel.a.denisov <AT> gmail <DOT> com>
AuthorDate: Wed Jul 20 04:54:46 2016 +0000
Commit:     Christoph Junghans <ottxor <AT> gentoo <DOT> org>
CommitDate: Wed Jul 20 04:54:46 2016 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=4bb0a5fa

sci-misc/kaldi: version bump; add speex USE flag

Package-Manager: portage-2.3.0

 sci-misc/kaldi/files/Makefile.patch                |   4 +-
 sci-misc/kaldi/files/configure.patch               |  93 --------------
 .../kaldi/files/default_rules.mk.a7d9824.patch     |   4 +-
 sci-misc/kaldi/files/default_rules.mk.patch        |  47 -------
 sci-misc/kaldi/kaldi-0_p20150709.ebuild            |  58 ---------
 sci-misc/kaldi/kaldi-0_p20160628.ebuild            | 136 +++++++++++++++++++++
 6 files changed, 140 insertions(+), 202 deletions(-)

diff --git a/sci-misc/kaldi/files/Makefile.patch b/sci-misc/kaldi/files/Makefile.patch
index 9fa1841..0556e25 100644
--- a/sci-misc/kaldi/files/Makefile.patch
+++ b/sci-misc/kaldi/files/Makefile.patch
@@ -1,5 +1,5 @@
---- Makefile.orig	2015-11-06 18:43:31.000000000 -0400
-+++ Makefile	2015-11-17 20:15:14.452502675 -0400
+--- src/Makefile.orig	2015-11-06 18:43:31.000000000 -0400
++++ src/Makefile	2015-11-17 20:15:14.452502675 -0400
 @@ -30,7 +30,7 @@
  
  # Reset the default goal, so that the all target will become default

diff --git a/sci-misc/kaldi/files/configure.patch b/sci-misc/kaldi/files/configure.patch
deleted file mode 100644
index f6086fc..0000000
--- a/sci-misc/kaldi/files/configure.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-*** configure.orig	2015-02-28 16:31:35.568045409 -0400
---- configure	2015-02-28 17:21:58.477634475 -0400
-***************
-*** 46,60 ****
-    fi
-  }
-  
-- 
-- 
-- ##   First do some checks.  These verify that all the things are
-- ##   here that should be here.
-- if [ "`basename $PWD`" != "src" ]; then
--   echo 'You must run "configure" from the src/ directory.'
--   exit 1
-- fi
-- 
-  ## Default locations for FST and linear algebra libraries.
-  MATHLIB='ATLAS'
-  ATLASROOT=`rel2abs ../tools/ATLAS/`
---- 46,51 ----
-***************
-*** 522,527 ****
---- 513,535 ----
-    exit_success;
-  }
-  
-+ function linux_configure_gentoo {
-+   m=$1  # 64 or empty.
-+   ATLASLIBS="/usr/lib$m/libatlas.so.3 /usr/lib$m/libf77blas.so.3 /usr/lib$m/libatlcblas.so.3 /usr/lib$m/libatlclapack.so.3"
-+   for f in $ATLASLIBS; do 
-+     [ ! -f $f ] && return 1;
-+   done
-+   libdir=$(dirname $(echo $ATLASLIBS | awk '{print $1}'))
-+   [ -z "$libdir" ] && echo "Error getting libdir in linux_configure_gentoo" && exit 1;
-+   echo ATLASINC = $ATLASROOT >> kaldi.mk
-+   echo ATLASLIBS = $ATLASLIBS -Wl,-rpath=$libdir >> kaldi.mk
-+   echo 
-+   cat makefiles/linux_atlas.mk >> kaldi.mk
-+   fix_cxx_flag
-+   echo "Successfully configured for gentoo [dynamic libraries] with ATLASLIBS =$ATLASLIBS"
-+   $use_cuda && linux_configure_cuda
-+   exit_success;
-+ }
-  
-  function linux_configure_static {
-    if $threaded_atlas; then pt=pt; else pt=""; fi
-***************
-*** 682,688 ****
-  echo "FSTROOT = $FSTROOT" >> kaldi.mk
-  
-  # Check installed OpenFst version and add C++11 flags if OpenFst >= 1.4
-! OPENFST_VER=`grep 'PACKAGE_VERSION' $FSTROOT/Makefile | sed -e 's:.*= ::'`
-  echo "OPENFST_VER = $OPENFST_VER" >> kaldi.mk
-  OPENFST_VER_NUM=`echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d"`
-  if [ $OPENFST_VER_NUM -ge 10400 ]; then
---- 690,696 ----
-  echo "FSTROOT = $FSTROOT" >> kaldi.mk
-  
-  # Check installed OpenFst version and add C++11 flags if OpenFst >= 1.4
-! OPENFST_VER="1.4.1"
-  echo "OPENFST_VER = $OPENFST_VER" >> kaldi.mk
-  OPENFST_VER_NUM=`echo $OPENFST_VER | sed 's/\./ /g' | xargs printf "%d%02d%02d"`
-  if [ $OPENFST_VER_NUM -ge 10400 ]; then
-***************
-*** 765,772 ****
-  
-    echo "On Linux: Checking for linear algebra header files ..."
-    if [ "$MATHLIB" == "ATLAS" ]; then
-!     if [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ; then
-!       failure "Could not find required header files cblas.h or clapack.h in ATLAS dir '$ATLASROOT/include'"
-      fi
-      echo "Using ATLAS as the linear algebra library."
-      
---- 773,780 ----
-  
-    echo "On Linux: Checking for linear algebra header files ..."
-    if [ "$MATHLIB" == "ATLAS" ]; then
-!     if  ( [ ! -f $ATLASROOT/include/cblas.h ] || [ ! -f $ATLASROOT/include/clapack.h ] ) && ( [ ! -f $ATLASROOT/cblas.h ] || [ ! -f $ATLASROOT/clapack.h ] ) ; then
-!       failure "Could not find required header files cblas.h or clapack.h in ATLAS dirs '$ATLASROOT/include' or '$ATLASROOT'"
-      fi
-      echo "Using ATLAS as the linear algebra library."
-      
-***************
-*** 797,802 ****
---- 805,812 ----
-      else
-        # Prefer dynamic to static math.
-        linux_configure_debian_ubuntu3 || \
-+         linux_configure_gentoo 64 || \
-+         linux_configure_gentoo || \
-          linux_configure_dynamic || \
-          linux_configure_static || \
-          linux_configure_debian_ubuntu 64 || \

diff --git a/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch
index 7e60268..a51fd20 100644
--- a/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch
+++ b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch
@@ -1,5 +1,5 @@
---- makefiles/default_rules.mk.orig	2015-11-06 18:43:31.000000000 -0400
-+++ makefiles/default_rules.mk	2015-11-09 18:42:33.609774157 -0400
+--- src/makefiles/default_rules.mk.orig	2015-11-06 18:43:31.000000000 -0400
++++ src/makefiles/default_rules.mk	2015-11-09 18:42:33.609774157 -0400
 @@ -14,7 +14,7 @@
          LIBFILE = lib$(LIBNAME).so
          #LDLIBS  += -l$(LIBNAME)

diff --git a/sci-misc/kaldi/files/default_rules.mk.patch b/sci-misc/kaldi/files/default_rules.mk.patch
deleted file mode 100644
index 60e3430..0000000
--- a/sci-misc/kaldi/files/default_rules.mk.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-*** makefiles/default_rules.mk.orig	2015-02-28 16:32:00.830458169 -0400
---- makefiles/default_rules.mk	2015-02-28 19:10:50.692172138 -0400
-***************
-*** 14,20 ****
-          LIBFILE = lib$(LIBNAME).so
-          #LDLIBS  += -l$(LIBNAME)
-        endif
-!       LDFLAGS += -Wl,-rpath=$(shell readlink -f $(KALDILIBDIR)) -L.
-        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
-        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
-      else  # Platform not supported
---- 14,20 ----
-          LIBFILE = lib$(LIBNAME).so
-          #LDLIBS  += -l$(LIBNAME)
-        endif
-!       LDFLAGS += -L.
-        LDFLAGS += $(foreach dep,$(ADDLIBS), -L$(dir $(dep)) )
-        XDEPENDS = $(foreach dep,$(ADDLIBS), $(dir $(dep))/lib$(notdir $(basename $(dep))).so )
-      else  # Platform not supported
-***************
-*** 72,78 ****
-  test_compile: $(TESTFILES)
-    
-  test: test_compile
-! 	@result=0; for x in $(TESTFILES); do printf "Running $$x ..."; ./$$x >/dev/null 2>&1; if [ $$? -ne 0 ]; then echo "... FAIL $$x"; result=1; else echo "... SUCCESS";  fi;  done; exit $$result
-  
-  .valgrind: $(BINFILES) $(TESTFILES)
-  
---- 72,78 ----
-  test_compile: $(TESTFILES)
-    
-  test: test_compile
-! 	@result=0; for x in $(TESTFILES); do printf "Running $$x ..."; LD_LIBRARY_PATH=$(KALDILIBDIR):${LD_LIBRARY_PATH} ./$$x >/dev/null 2>&1; if [ $$? -ne 0 ]; then echo "... FAIL $$x"; result=1; else echo "... SUCCESS";  fi;  done; exit $$result
-  
-  .valgrind: $(BINFILES) $(TESTFILES)
-  
-***************
-*** 84,86 ****
---- 84,91 ----
-  #.depend.mk: depend
-  -include .depend.mk
-  
-+ print-binfiles:
-+ 	@echo $(addprefix $(shell pwd)/, $(BINFILES))
-+ 
-+ print-libfiles:
-+ 	@echo $(addsuffix .so, $(addprefix $(shell pwd)/lib, $(LIBNAME)))

diff --git a/sci-misc/kaldi/kaldi-0_p20150709.ebuild b/sci-misc/kaldi/kaldi-0_p20150709.ebuild
deleted file mode 100644
index ad8c84d..0000000
--- a/sci-misc/kaldi/kaldi-0_p20150709.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic
-
-DESCRIPTION="A toolkit for speech recognition"
-HOMEPAGE="http://kaldi.sourceforge.net/"
-SRC_URI="http://gentoo.akreal.net/distfiles/${P}.tar.xz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-IUSE="doc test threads"
-KEYWORDS="~amd64"
-
-RDEPEND="
-	media-libs/speex
-	sci-libs/atlas[lapack,threads=]
-	>=sci-misc/openfst-1.4.1"
-DEPEND="${RDEPEND}
-	doc? ( app-doc/doxygen )"
-
-src_prepare() {
-	epatch \
-		"${FILESDIR}"/configure.patch \
-		"${FILESDIR}"/Makefile.patch \
-		"${FILESDIR}"/default_rules.mk.patch
-}
-
-src_configure() {
-	# Upstream's configure script is "hand-generated" and not autotools compatible,
-	# for this reason econf can not be used
-	./configure \
-		--shared \
-		--fst-root="${EPREFIX}/usr" \
-		$(use threads && echo --threaded-atlas=yes) \
-		--atlas-root="${EPREFIX}/usr/include/atlas" || die "failed to run configure"
-
-	use test || append-cxxflags -DNDEBUG
-
-	sed -i \
-		-e "s:-g :-DHAVE_SPEEX ${CXXFLAGS} :" \
-		-e "s:-lm -lpthread -ldl:-lm -lpthread -ldl -lspeex ${LDFLAGS}:" \
-		kaldi.mk || die "sed unix/kaldi.mk failed"
-}
-
-src_compile() {
-	default
-	use doc && doxygen
-}
-
-src_install() {
-	dolib.so $(make print-libfiles)
-	dobin $(make print-binfiles)
-	use doc && dohtml -r html/*
-}

diff --git a/sci-misc/kaldi/kaldi-0_p20160628.ebuild b/sci-misc/kaldi/kaldi-0_p20160628.ebuild
new file mode 100644
index 0000000..65effe5
--- /dev/null
+++ b/sci-misc/kaldi/kaldi-0_p20160628.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs cuda flag-o-matic
+
+COMMIT_ID="16e69f1aacce8ad0665d2b6666c053b1421a9e91"
+DESCRIPTION="A toolkit for speech recognition"
+HOMEPAGE="http://kaldi-asr.org/"
+SRC_URI="https://github.com/kaldi-asr/kaldi/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
+
+S=${WORKDIR}/${PN}-${COMMIT_ID}/src
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="cuda doc speex test"
+KEYWORDS="~amd64"
+
+RDEPEND="
+	speex? ( media-libs/speex )
+	virtual/cblas
+	virtual/lapack
+	virtual/lapacke
+	<sci-misc/openfst-1.5.0
+	cuda? ( dev-util/nvidia-cuda-toolkit )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	doc? ( app-doc/doxygen )"
+
+# We need write acccess /dev/nvidiactl, /dev/nvidia0 and /dev/nvidia-uvm and the portage
+# user is (usually) not in the video group
+RESTRICT="cuda? ( userpriv )"
+
+pkg_pretend() {
+	local cblas_provider=$(eselect cblas show)
+
+	if [[ ! ${cblas_provider} =~ (atlas|mkl|openblas) ]]; then
+		die "Build with '${cblas_provider}' CBLAS is not supported"
+	fi
+}
+
+src_prepare() {
+	eapply \
+		"${FILESDIR}"/Makefile.patch \
+		"${FILESDIR}"/default_rules.mk.a7d9824.patch
+	eapply_user
+
+	use cuda && cuda_src_prepare
+}
+
+src_configure() {
+	append-cxxflags \
+		-DHAVE_EXECINFO_H=1 \
+		-DHAVE_CXXABI_H \
+		-DHAVE_OPENFST_GE_10400 \
+		-std=c++11 \
+		-Wall \
+		-I.. \
+		-pthread \
+		-Wno-sign-compare \
+		-Wno-unused-local-typedefs \
+		-Winit-self \
+		-rdynamic \
+		-fPIC \
+		$($(tc-getPKG_CONFIG) --cflags cblas) \
+		$($(tc-getPKG_CONFIG) --cflags lapack)
+
+	append-libs \
+		-lfst \
+		-lm \
+		-lpthread \
+		-ldl \
+		$($(tc-getPKG_CONFIG) --libs cblas) \
+		$($(tc-getPKG_CONFIG) --libs lapack)
+
+	local cblas_provider=$(eselect cblas show)
+
+	if [[ ${cblas_provider} =~ atlas ]]; then
+		append-cxxflags -DHAVE_ATLAS
+	elif [[ ${cblas_provider} =~ mkl ]]; then
+		append-cxxflags -DHAVE_MKL
+	elif [[ ${cblas_provider} =~ openblas ]]; then
+		append-cxxflags -DHAVE_OPENBLAS $($(tc-getPKG_CONFIG) --cflags lapacke)
+	fi
+
+	use test || append-cxxflags -DNDEBUG
+
+	if use speex; then
+		append-cxxflags -DHAVE_SPEEX
+		append-libs -lspeex
+	fi
+
+	cat <<-EOF > kaldi.mk
+		KALDI_FLAVOR := dynamic
+		KALDILIBDIR := "${S}"/lib
+		CC = $(tc-getCXX)
+		RANLIB = $(tc-getRANLIB)
+		LDLIBS = ${LIBS}
+		DOUBLE_PRECISION = 0
+	EOF
+
+	if use cuda; then
+		cat <<-EOF >> kaldi.mk
+			CUDA = true
+			CUDATKDIR = "${EPREFIX}"/opt/cuda
+			CUDA_ARCH :=
+			CUDA_ARCH +=
+		EOF
+		cat makefiles/cuda_64bit.mk >> kaldi.mk
+		sed -i \
+			-e "s:CUDA_FLAGS = -g:CUDA_FLAGS = ${NVCCFLAGS}:" \
+			kaldi.mk || die "sed unix/kaldi.mk failed"
+	fi
+}
+
+src_compile() {
+	default
+	use doc && doxygen
+}
+
+src_test() {
+	if use cuda; then
+		addwrite /dev/nvidiactl
+		addwrite /dev/nvidia0
+		addwrite /dev/nvidia-uvm
+	fi
+	default
+}
+
+src_install() {
+	dolib.so $(make print-libfiles)
+	dobin $(make print-binfiles)
+	use doc && dodoc -r html
+}


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-20 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20 11:39 [gentoo-commits] proj/sci:master commit in: sci-misc/kaldi/files/, sci-misc/kaldi/ Justin Lecher
  -- strict thread matches above, loose matches on Subject: below --
2016-07-20 17:48 Christoph Junghans
2015-03-02  7:15 Andrew Savchenko
2015-01-15  6:53 Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox