Blame view
tools/Makefile
4.98 KB
8dcb6dfcb first commit |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# SHELL += -x CXX ?= g++ CC ?= gcc # used for sph2pipe # CXX = clang++ # Uncomment these lines... # CC = clang # ...to build with Clang. # Note: OpenFst requires a relatively recent C++ compiler with C++11 support, # e.g. g++ >= 4.7, Apple clang >= 5.0 or LLVM clang >= 3.3. OPENFST_VERSION ?= 1.6.7 CUB_VERSION ?= 1.8.0 OPENBLAS_VERSION ?= 0.3.5 # Default features configured for OpenFST; can be overridden in the make command line. OPENFST_CONFIGURE ?= --enable-static --enable-shared --enable-far --enable-ngram-fsts OPENFST_VER_NUM := $(shell echo $(OPENFST_VERSION) | sed 's/\./ /g' | xargs printf "%d%02d%02d") ifeq ("$(shell expr $(OPENFST_VER_NUM) \< 10600)","1") $(error OpenFst-$(OPENFST_VERSION) is not supported. \ Supported versions: >= 1.6.0) endif all: check_required_programs sph2pipe sclite openfst cub @echo -e " " @echo "Warning: IRSTLM is not installed by default anymore. If you need IRSTLM" @echo "Warning: use the script extras/install_irstlm.sh" @echo "All done OK." # make sure check_required_programs runs before anything else: sph2pipe sclite openfst sctk: | check_required_programs check_required_programs: extras/check_dependencies.sh clean: openfst_cleaned sclite_cleaned openfst_cleaned: $(MAKE) -C openfst-$(OPENFST_VERSION) clean sclite_cleaned: $(MAKE) -C sctk clean distclean: rm -rf openfst-$(OPENFST_VERSION)/ rm -rf sctk-2.4.10/ rm -rf sctk rm -rf sph2pipe_v2.5/ rm -rf sph2pipe_v2.5.tar.gz rm -rf sctk-2.4.10-20151007-1312Z.tar.bz2 rm -rf openfst-$(OPENFST_VERSION).tar.gz rm -f openfst rm -rf libsndfile-1.0.25{,.tar.gz} BeamformIt-3.51{,.tgz} rm -f cub-$(CUB_VERSION).zip rm -rf cub-$(CUB_VERSION) rm -f cub .PHONY: openfst # so target will be made even though "openfst" exists. openfst: openfst_compiled openfst-$(OPENFST_VERSION)/lib -rm -f openfst -ln -s openfst-$(OPENFST_VERSION) openfst .PHONY: openfst_compiled openfst_compiled: openfst-$(OPENFST_VERSION)/Makefile $(MAKE) -C openfst-$(OPENFST_VERSION) install MAKEOVERRIDES= openfst-$(OPENFST_VERSION)/lib: | openfst-$(OPENFST_VERSION)/Makefile -cd openfst-$(OPENFST_VERSION) && [ -d lib64 ] && [ ! -d lib ] && ln -s lib64 lib # Add the -O flag to CXXFLAGS on cygwin as it can fix the compilation error # "file too big". ifeq ($(OSTYPE),cygwin) # Note: OSTYPE path is probably dead for latest cygwin64 (installed on 2016/11/11). openfst_add_CXXFLAGS = -O -Wa,-mbig-obj else ifeq ($(OS),Windows_NT) # This new OS path is confirmed working on Windows 10 / Cygwin64. openfst_add_CXXFLAGS = -O -Wa,-mbig-obj else openfst_add_CXXFLAGS = endif openfst-$(OPENFST_VERSION)/Makefile: openfst-$(OPENFST_VERSION) | check_required_programs cd openfst-$(OPENFST_VERSION)/ && \ ./configure --prefix=`pwd` $(OPENFST_CONFIGURE) CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) $(openfst_add_CXXFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="-ldl" openfst-$(OPENFST_VERSION): openfst-$(OPENFST_VERSION).tar.gz tar xozf openfst-$(OPENFST_VERSION).tar.gz openfst-$(OPENFST_VERSION).tar.gz: wget -T 10 -t 1 http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-$(OPENFST_VERSION).tar.gz || \ wget -T 10 -t 3 http://www.openslr.org/resources/2/openfst-$(OPENFST_VERSION).tar.gz sclite: sclite_compiled .PHONY: sclite_compiled sclite_compiled: sctk sctk_configured cd sctk; \ $(MAKE) CC="$(CC)" CXX="$(CXX)" all && $(MAKE) install && $(MAKE) doc sctk_configured: sctk sctk/.configured sctk/.configured: sctk cd sctk; $(MAKE) config touch sctk/.configured .PHONY: sctk sctk: sctk-2.4.10-20151007-1312Z.tar.bz2 tar xojf sctk-2.4.10-20151007-1312Z.tar.bz2 || \ tar --exclude '*NONE*html' -xvojf sctk-2.4.10-20151007-1312Z.tar.bz2 rm -rf sctk && ln -s sctk-2.4.10 sctk sctk-2.4.10-20151007-1312Z.tar.bz2: wget -T 10 -t 3 ftp://jaguar.ncsl.nist.gov/pub/sctk-2.4.10-20151007-1312Z.tar.bz2|| \ wget --no-check-certificate -T 10 http://www.openslr.org/resources/4/sctk-2.4.10-20151007-1312Z.tar.bz2 sph2pipe: sph2pipe_compiled sph2pipe_compiled: sph2pipe_v2.5/sph2pipe sph2pipe_v2.5/sph2pipe: | sph2pipe_v2.5 cd sph2pipe_v2.5/; \ $(CC) -o sph2pipe *.c -lm sph2pipe_v2.5: sph2pipe_v2.5.tar.gz tar --no-same-owner -xzf sph2pipe_v2.5.tar.gz sph2pipe_v2.5.tar.gz: wget -T 10 -t 3 http://www.openslr.org/resources/3/sph2pipe_v2.5.tar.gz || \ wget --no-check-certificate -T 10 https://sourceforge.net/projects/kaldi/files/sph2pipe_v2.5.tar.gz .PHONY: cub cub: wget -T 10 -t 3 -O cub-$(CUB_VERSION).zip https://github.com/NVlabs/cub/archive/$(CUB_VERSION).zip unzip -oq cub-$(CUB_VERSION).zip rm -f cub ln -s cub-$(CUB_VERSION) cub # OpenBLAS is not compiled by default. Run 'make -j openblas' in this directory to build. .PHONY: openblas openblas: @-rm -rf OpenBLAS xianyi-OpenBLAS-* wget -t3 -nv -O- $$( \ wget -qO- 'https://api.github.com/repos/xianyi/OpenBLAS/releases/tags/v$(OPENBLAS_VERSION)' | \ python -c 'import sys,json;print(json.load(sys.stdin)["tarball_url"])') | \ tar xzf - mv xianyi-OpenBLAS-* OpenBLAS $(MAKE) PREFIX=$$(pwd)/OpenBLAS/install USE_THREAD=0 -C OpenBLAS all install |