From d74e903a793e3340ba471d976e135d580936ba77 Mon Sep 17 00:00:00 2001 From: "Gao, Xiang" Date: Mon, 16 Nov 2015 14:40:36 -0500 Subject: fix dependency on boost[python] rdkit should requires that boost is installed with python support. --- sci-libs/rdkit/rdkit-2015.03.1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/rdkit/rdkit-2015.03.1.ebuild b/sci-libs/rdkit/rdkit-2015.03.1.ebuild index 68ee45fa0..21b444b14 100644 --- a/sci-libs/rdkit/rdkit-2015.03.1.ebuild +++ b/sci-libs/rdkit/rdkit-2015.03.1.ebuild @@ -18,7 +18,7 @@ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" IUSE="+python -static-libs" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" -RDEPEND="dev-libs/boost +RDEPEND="dev-libs/boost[python] python? ( dev-libs/boost[${PYTHON_USEDEP}] dev-python/numpy[${PYTHON_USEDEP}] -- cgit v1.2.3-65-gdbad From d3e18a1c5c48d14f6505981961d573c4a66c6e2e Mon Sep 17 00:00:00 2001 From: "Gao, Xiang" Date: Tue, 17 Nov 2015 17:17:54 -0500 Subject: if rdkit don't uses python,boost won't need use if rdkit don't uses python,boost won't need use --- sci-libs/rdkit/rdkit-2015.03.1.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sci-libs/rdkit/rdkit-2015.03.1.ebuild b/sci-libs/rdkit/rdkit-2015.03.1.ebuild index 21b444b14..38e30e975 100644 --- a/sci-libs/rdkit/rdkit-2015.03.1.ebuild +++ b/sci-libs/rdkit/rdkit-2015.03.1.ebuild @@ -18,9 +18,9 @@ KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" IUSE="+python -static-libs" REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" -RDEPEND="dev-libs/boost[python] +RDEPEND="dev-libs/boost python? ( - dev-libs/boost[${PYTHON_USEDEP}] + dev-libs/boost[python,${PYTHON_USEDEP}] dev-python/numpy[${PYTHON_USEDEP}] ) >=dev-db/sqlite-3" -- cgit v1.2.3-65-gdbad From 4f6c87e3500f9750f66edd527a2fbf8fe7ac612b Mon Sep 17 00:00:00 2001 From: "Gao, Xiang" Date: Tue, 17 Nov 2015 17:18:35 -0500 Subject: fix dependency on python --- sci-libs/rdkit/rdkit-9999.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-libs/rdkit/rdkit-9999.ebuild b/sci-libs/rdkit/rdkit-9999.ebuild index 0b4f40aa9..be37c582c 100644 --- a/sci-libs/rdkit/rdkit-9999.ebuild +++ b/sci-libs/rdkit/rdkit-9999.ebuild @@ -21,7 +21,7 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" RDEPEND="dev-libs/boost python? ( - dev-libs/boost[${PYTHON_USEDEP}] + dev-libs/boost[python,${PYTHON_USEDEP}] dev-python/numpy[${PYTHON_USEDEP}] ) >=dev-db/sqlite-3" -- cgit v1.2.3-65-gdbad From c55b36e1b4aa36eb54f33d89aa5c18e2a740b98c Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Sun, 8 Nov 2015 16:28:04 -0400 Subject: 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 ++ sci-misc/kaldi/Manifest | 1 + .../kaldi/files/default_rules.mk.a7d9824.patch | 48 ++++++++++++ sci-misc/kaldi/kaldi-0_p20151106.ebuild | 91 ++++++++++++++++++++++ sci-misc/kaldi/metadata.xml | 11 ++- 5 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 sci-misc/kaldi/files/default_rules.mk.a7d9824.patch create mode 100644 sci-misc/kaldi/kaldi-0_p20151106.ebuild diff --git a/sci-misc/kaldi/ChangeLog b/sci-misc/kaldi/ChangeLog index fe4798129..b40d1713a 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 + +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 diff --git a/sci-misc/kaldi/Manifest b/sci-misc/kaldi/Manifest index 73235f010..fa70f9d27 100644 --- a/sci-misc/kaldi/Manifest +++ b/sci-misc/kaldi/Manifest @@ -1 +1,2 @@ DIST kaldi-0_p20150709.tar.xz 2322512 SHA256 84f1856315c8a1a3179cd464628bb0efa0423de0d68a529a064ba93c41bd64aa SHA512 cf1f0cb0701d386202a9e406c9a3aa40046058c4ecec8cedb51fc2b3216084eecc8d2a7353d695a21afa668fb88fa5dae29911d35ab5d413f48ccc9025258e90 WHIRLPOOL 144ad5a92fe46146766e9a4f34385b171cf24ce4849456e73783432e8cc74af145f7375e0130dfcbd0eac584d43ed79652f03967a24b532f11b7bf1bf15c2b7b +DIST kaldi-0_p20151106.tar.xz 2533608 SHA256 77726388b33739dcd3840b49bca027c3d97afad02e7b52c931d65ae08d900d40 SHA512 35f41bea999f8fdc5bc8d33753b9630bafddb23975254b12d30287e65cb2bfd48c7d1f126d96fc669cbbd43ad80abf6a5d5ccd6a24d516061454f8f84f560333 WHIRLPOOL 6e6c3ebc2f4701185e5d5c6eae727b5a4c06a764495e5a5172be142724ce89cd7e521b6f9602ae051d44e8766269000cde96ad12e9439cd16890bce6e311eabe 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 000000000..458d45341 --- /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 000000000..128c26898 --- /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 e961e5163..ddeac8413 100644 --- a/sci-misc/kaldi/metadata.xml +++ b/sci-misc/kaldi/metadata.xml @@ -3,6 +3,7 @@ pavel.a.denisov@gmail.com + Pavel Denisov Kaldi is a toolkit for speech recognition written @@ -10,6 +11,14 @@ Kaldi is intended for use by speech recognition researchers. - kaldi + kaldi-asr/kaldi + + + Use sci-libs/atlas for math library. + + + Build with CUDA support. + + -- cgit v1.2.3-65-gdbad From 92caf979dce6cfc34b8a57e03e394b14b40d833a Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Mon, 9 Nov 2015 19:41:45 -0400 Subject: sci-misc/kaldi: Fix IUSE Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index 128c26898..63543d548 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -12,7 +12,7 @@ SRC_URI="http://gentoo.akreal.net/distfiles/${P}.tar.xz" LICENSE="Apache-2.0" SLOT="0" -IUSE="doc test threads atlas cuda" +IUSE="doc test threads -atlas cuda" KEYWORDS="~amd64" RDEPEND=" -- cgit v1.2.3-65-gdbad From 6d0c42fa63e22a8d44d8b45b243da36ad11ee57e Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Mon, 9 Nov 2015 19:55:51 -0400 Subject: sci-misc/kaldi: Fix RESTRICT conditions Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index 63543d548..a72c3701b 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -30,7 +30,7 @@ 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 )" +RESTRICT="test? ( cuda? ( userpriv ) )" src_prepare() { epatch \ -- cgit v1.2.3-65-gdbad From 24648b1c7fc42093d530c9937ea94be381e302ac Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Mon, 9 Nov 2015 19:58:05 -0400 Subject: sci-misc/kaldi: Change dohtml to dodoc Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index a72c3701b..64fea67fe 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -87,5 +87,5 @@ src_test() { src_install() { dolib.so $(make print-libfiles) dobin $(make print-binfiles) - use doc && dohtml -r html/* + use doc && dodoc -r html } -- cgit v1.2.3-65-gdbad From 889fa1375816b99303707b0da7e06d9e6cffddd2 Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Mon, 9 Nov 2015 20:02:11 -0400 Subject: sci-misc/kaldi: Create unified diff for default_rules.mk patch Package-Manager: portage-2.2.24 --- .../kaldi/files/default_rules.mk.a7d9824.patch | 78 +++++++++------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch index 458d45341..7e60268bc 100644 --- a/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch +++ b/sci-misc/kaldi/files/default_rules.mk.a7d9824.patch @@ -1,48 +1,30 @@ -*** 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))) +--- 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 +@@ -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 +@@ -75,7 +75,7 @@ + @{ result=0; \ + for x in $(TESTFILES); do \ + printf "Running $$x ..."; \ +- ./$$x >$$x.testlog 2>&1; \ ++ LD_LIBRARY_PATH=$(KALDILIBDIR):${LD_LIBRARY_PATH} ./$$x >$$x.testlog 2>&1; \ + if [ $$? -ne 0 ]; then \ + echo "... FAIL $$x"; \ + result=1; \ +@@ -99,3 +99,9 @@ + # 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))) -- cgit v1.2.3-65-gdbad From a1da40b60fe840950f023512d099ffb4078c11fa Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Wed, 18 Nov 2015 21:00:40 -0400 Subject: sci-misc/kaldi: Create unified diff for Makefile patch Package-Manager: portage-2.2.24 --- sci-misc/kaldi/files/Makefile.patch | 117 ++++++++++++++++++------------------ 1 file changed, 60 insertions(+), 57 deletions(-) diff --git a/sci-misc/kaldi/files/Makefile.patch b/sci-misc/kaldi/files/Makefile.patch index ef1a60640..9fa1841c6 100644 --- a/sci-misc/kaldi/files/Makefile.patch +++ b/sci-misc/kaldi/files/Makefile.patch @@ -1,57 +1,60 @@ -*** 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 +--- Makefile.orig 2015-11-06 18:43:31.000000000 -0400 ++++ 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 + .DEFAULT_GOAL := +-all: checkversion test_dependencies kaldi.mk mklibdir $(SUBDIRS) ++all: kaldi.mk mklibdir $(SUBDIRS) + -echo Done + + mklibdir: +@@ -45,14 +45,6 @@ + @true + endif + +-.PHONY: checkversion +-checkversion: +-ifeq ($(shell ./configure --version),$(CONFIGURE_VERSION)) +- @echo "The version of configure script matches kaldi.mk version. Good." +-else +- $(error The kaldi.mk file was generated using a different version of configure script. Run the configure script again.) +-endif +- + biglib: $(SUBDIRS_LIB) + ifeq ($(KALDI_FLAVOR), dynamic) + ifeq ($(shell uname), Darwin) +@@ -88,16 +80,6 @@ + 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 ) + +@@ -131,6 +113,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 -- cgit v1.2.3-65-gdbad From 9d956a08c867d1771a7a619dfb71d5d8274b8c93 Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Wed, 18 Nov 2015 21:15:59 -0400 Subject: sci-misc/kaldi: Switch to user-selected BLAS/LAPACK Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 88 ++++++++++++++++++++++----------- sci-misc/kaldi/metadata.xml | 3 -- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index 64fea67fe..e2e0bb69c 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -4,7 +4,7 @@ EAPI="5" -inherit eutils flag-o-matic +inherit eutils toolchain-funcs flag-o-matic DESCRIPTION="A toolkit for speech recognition" HOMEPAGE="http://kaldi-asr.org/" @@ -12,62 +12,90 @@ SRC_URI="http://gentoo.akreal.net/distfiles/${P}.tar.xz" LICENSE="Apache-2.0" SLOT="0" -IUSE="doc test threads -atlas cuda" +IUSE="doc test cuda" KEYWORDS="~amd64" RDEPEND=" media-libs/speex + virtual/cblas 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="test? ( 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 + append-cxxflags \ + -DKALDI_DOUBLEPRECISION=0 \ + -DHAVE_POSIX_MEMALIGN \ + -DHAVE_EXECINFO_H=1 \ + -DHAVE_CXXABI_H \ + -DHAVE_SPEEX \ + -DHAVE_OPENFST_GE_10400 \ + -std=c++0x \ + -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 \ + -lspeex \ + -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) else - myconf+=( --openblas-root="${EPREFIX}/usr" ) - append-cxxflags "-I${EPREFIX}/usr/include/openblas" - append-libs -lreflapack + die "Build with ${cblas_provider} CBLAS is not supported" 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" + cat <<-EOF > kaldi.mk + KALDI_FLAVOR := dynamic + KALDILIBDIR := "${S}"/lib + CC = $(tc-getCXX) + RANLIB = $(tc-getRANLIB) + LDLIBS = ${LIBS} + EOF + + if use cuda; then + cat <<-EOF >> kaldi.mk + CUDA = true + CUDATKDIR = "${EPREFIX}"/opt/cuda + EOF + cat makefiles/linux_x86_64_cuda.mk >> kaldi.mk + sed -i \ + -e "s:CUDA_FLAGS = -g:CUDA_FLAGS = -O2:" \ + kaldi.mk || die "sed unix/kaldi.mk failed" + fi } src_compile() { diff --git a/sci-misc/kaldi/metadata.xml b/sci-misc/kaldi/metadata.xml index ddeac8413..3aa9b1d14 100644 --- a/sci-misc/kaldi/metadata.xml +++ b/sci-misc/kaldi/metadata.xml @@ -14,9 +14,6 @@ kaldi-asr/kaldi - - Use sci-libs/atlas for math library. - Build with CUDA support. -- cgit v1.2.3-65-gdbad From 7fc25873fec545a84886b8520fad8a6d1e13e4f1 Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Thu, 19 Nov 2015 19:22:59 -0400 Subject: sci-misc/kaldi: Add pkg_pretend() to check for suitable CBLAS provider Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index e2e0bb69c..9657ceff5 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -29,6 +29,14 @@ DEPEND="${RDEPEND} # user is (usually) not in the video group RESTRICT="test? ( 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() { epatch \ "${FILESDIR}"/Makefile.patch \ @@ -66,14 +74,12 @@ src_configure() { local cblas_provider=$(eselect cblas show) - if [[ ${cblas_provider} =~ "atlas" ]]; then + if [[ ${cblas_provider} =~ atlas ]]; then append-cxxflags -DHAVE_ATLAS - elif [[ ${cblas_provider} =~ "mkl" ]]; then + elif [[ ${cblas_provider} =~ mkl ]]; then append-cxxflags -DHAVE_MKL - elif [[ ${cblas_provider} =~ "openblas" ]]; then + elif [[ ${cblas_provider} =~ openblas ]]; then append-cxxflags -DHAVE_OPENBLAS $($(tc-getPKG_CONFIG) --cflags lapacke) - else - die "Build with ${cblas_provider} CBLAS is not supported" fi use test || append-cxxflags -DNDEBUG -- cgit v1.2.3-65-gdbad From f31b3eeaa38fdc2b33709436644c109e5ac6b5c7 Mon Sep 17 00:00:00 2001 From: Pavel Denisov Date: Thu, 19 Nov 2015 20:16:01 -0400 Subject: sci-misc/kaldi: Use cuda eclass Package-Manager: portage-2.2.24 --- sci-misc/kaldi/kaldi-0_p20151106.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sci-misc/kaldi/kaldi-0_p20151106.ebuild b/sci-misc/kaldi/kaldi-0_p20151106.ebuild index 9657ceff5..9a86cf686 100644 --- a/sci-misc/kaldi/kaldi-0_p20151106.ebuild +++ b/sci-misc/kaldi/kaldi-0_p20151106.ebuild @@ -4,7 +4,7 @@ EAPI="5" -inherit eutils toolchain-funcs flag-o-matic +inherit eutils toolchain-funcs cuda flag-o-matic DESCRIPTION="A toolkit for speech recognition" HOMEPAGE="http://kaldi-asr.org/" @@ -99,7 +99,7 @@ src_configure() { EOF cat makefiles/linux_x86_64_cuda.mk >> kaldi.mk sed -i \ - -e "s:CUDA_FLAGS = -g:CUDA_FLAGS = -O2:" \ + -e "s:CUDA_FLAGS = -g:CUDA_FLAGS = ${NVCCFLAGS}:" \ kaldi.mk || die "sed unix/kaldi.mk failed" fi } -- cgit v1.2.3-65-gdbad