diff options
author | jhclark <jhclark@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-09-26 19:00:14 +0400 |
---|---|---|
committer | jhclark <jhclark@1f5c12ca-751b-0410-a591-d2e778427230> | 2011-09-26 19:00:14 +0400 |
commit | a4fa26acedc2ae12377ca17c7f9fd0ddaf886060 (patch) | |
tree | d25750fca2351bb1d115b70b9a7bf8d1cba7b353 /regenerate-makefiles.sh | |
parent | 39747881cb55d52c9c8ba900554f55f213145e95 (diff) |
And detect number of cores while we're at it
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@4269 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'regenerate-makefiles.sh')
-rwxr-xr-x | regenerate-makefiles.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/regenerate-makefiles.sh b/regenerate-makefiles.sh index a498441ce..6d89797c9 100755 --- a/regenerate-makefiles.sh +++ b/regenerate-makefiles.sh @@ -69,9 +69,17 @@ echo "Calling $LIBTOOLIZE" $LIBTOOLIZE || die "libtoolize failed" +cores=$(cat /proc/cpuinfo | fgrep -c processor) +if [ -z "$cores" ]; then + cores=2 # assume 2 cores if we can't figure it out + echo >&2 "Assuming 2 cores" +else + echo >&2 "Detected $cores cores" +fi + echo echo "You should now be able to configure and build:" echo " ./configure [--with-srilm=/path/to/srilm] [--with-irstlm=/path/to/irstlm] [--with-randlm=/path/to/randlm] [--without-kenlm] [--with-synlm] [--with-xmlrpc-c=/path/to/xmlrpc-c-config]" -echo " make -j 4" +echo " make -j ${cores}" echo |