Skip to content

Commit

Permalink
[build,scripts] Make OpenBLAS install check for gfortran; documentati…
Browse files Browse the repository at this point in the history
…on fix (#3507)
  • Loading branch information
danpovey authored Aug 5, 2019
1 parent 0986892 commit 53b6549
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
19 changes: 15 additions & 4 deletions egs/wsj/s5/utils/data/get_uniform_subsegments.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@
def get_args():
parser = argparse.ArgumentParser(
description=textwrap.dedent("""
Creates a subsegments file from an input segments file
that has the format
Creates a subsegments file from an input segments file.
The output format is
<subsegment-id> <utterance-id> <start-time> <end-time>,
where the timing are relative to the start-time of the
<utterance-id> in the input segments file.
where the timings are relative to the start-time of the
<utterance-id> in the input segments file.
Reminder: the format of the input segments file is:
<utterance-id> <recording-id> <start-time> <end-time>
where the recording-id corresponds to a wav file (or a channel of
a wav file) from wav.scp. Note: you can use
utils/data/get_segments_for_data.sh to generate a 'default'
segments file for your data if one doesn't already exist.
e.g.: get_uniform_subsegments.py data/dev/segments > \\
data/dev_uniform_segments/sub_segments
Expand Down
12 changes: 4 additions & 8 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,9 @@ cub:
rm -f cub
ln -s cub-$(CUB_VERSION) cub

# OpenBLAS is not compiled by default. Run 'make -j openblas' in this directory to build.
# OpenBLAS is not compiled by default; you can run `make openblas` to build it,
# but you should probably just call extras/install_openblas.sh; this is
# here for legacy reasons.
.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
extras/install_openblas.sh
26 changes: 23 additions & 3 deletions tools/extras/install_openblas.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
#!/bin/bash

# OpenBLAS is downloaded and built by tools/Makefile, but not automatically by
# its default 'all' target.
make -j openblas

OPENBLAS_VERSION=0.3.5

set -e

if ! command -v gfortran 2>/dev/null; then
echo "$0: gfortran is not installed. Please install it, e.g. by:"
echo " apt-get install gfortran"
echo "(if on Debian or Ubuntu), or:"
echo " yum install fortran"
echo "(if on RedHat/CentOS). On a Mac, if brew is installed, it's:"
echo " brew install gfortran"
exit 1
fi


rm -rf xianyi-OpenBLAS-* 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

0 comments on commit 53b6549

Please sign in to comment.