diff --git a/README.md b/README.md index 87dd546..ffa10cc 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Please download these datasets from [Dryad](https://datadryad.org/stash/dataset/ ``` - Turn off autorestarting for the redis server in terminal: - `sudo systemctl disable redis-server` -- `CMake >= 3.14` and `gcc >= 10.1` are required for the ngram language model installation. You can install these on linux with `sudo apt-get install build-essential`. +- `CMake >= 3.14` and `gcc >= 10.1` are required for the ngram language model installation. You can install these on linux with `sudo apt-get install cmake` and `sudo apt-get install build-essential`. ## Python environment setup for model training and evaluation To create a conda environment with the necessary dependencies, run the following command from the root directory of this repository: diff --git a/language_model/README.md b/language_model/README.md index e5efc90..47ca2e9 100644 --- a/language_model/README.md +++ b/language_model/README.md @@ -10,6 +10,7 @@ pytorch == 1.13.1 To install CMake and gcc on Ubuntu, simply run: ```bash sudo apt-get install build-essential +sudo apt-get install cmake ``` # Install language model python package diff --git a/setup_lm.sh b/setup_lm.sh index 17f109c..0e2d6b2 100755 --- a/setup_lm.sh +++ b/setup_lm.sh @@ -18,6 +18,18 @@ if [ -d "language_model/runtime/server/x86/fc_base" ]; then exit 1 fi +# make sure CMake is installed +if ! command -v cmake &> /dev/null; then + echo "CMake is not installed. Please install CMake >= 3.14 before running this script with 'sudo apt-get install cmake'." + exit 1 +fi + +# make sure gcc is installed +if ! command -v gcc &> /dev/null; then + echo "GCC is not installed. Please install GCC >= 10.1 before running this script with 'sudo apt-get install build-essential'." + exit 1 +fi + # Ensure conda is available source "$(conda info --base)/etc/profile.d/conda.sh"