我需要在 Ubuntu 18.04 上安装并编译 SURFEX 代码。为此,我遵循了以下文档这里。一切都很顺利,直到我尝试用编译代码的主版本make
。我得到了错误 127。我查了一下这个错误的含义,但我真的不明白它在这种情况下意味着什么。任何帮助都非常感谢。
完整内容如下
[ ! -d /home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-LXgfortran-build ] && mkdir -p /home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-LXgfortran-build
Makefile:422: recipe for target '/home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source-LXgfortran/include/grib_api.mod' failed
make: [/home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source-LXgfortran/include/grib_api.mod] Error 1 (ignored)
cd /home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-LXgfortran-build && \
cmake /home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source -DCMAKE_INSTALL_PREFIX=/home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source-LXgfortran -DBUILD_SHARED_LIBS=ON \
-DENABLE_NETCDF=OFF -DENABLE_JPG=OFF -DENABLE_PYTHON=OFF -DENABLE_EXAMPLES=OFF \
-DCMAKE_Fortran_COMPILER=f77 -DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_FLAGS= -DCMAKE_C_FLAGS= && \
make && make install && make clean
/bin/sh: 2: cmake: not found
Makefile:422: recipe for target '/home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source-LXgfortran/include/grib_api.mod' failed
make: *** [/home/sarah/MYDIR/open_surfex_v8_1_20210914/open_SURFEX_V8_1/src/LIB/eccodes-2.18.0-Source-LXgfortran/include/grib_api.mod] Error 127
答案1
根据编译日志
/bin/sh: 2: cmake: not found
你必须安装包裹提供cmake
可执行文件
sudo apt-get install cmake
Ubuntu 18.04.6 LTS 中 SURFEX 安装的可重现方法如下:
sudo apt-get install build-essential cmake libopenmpi-dev gfortran git libcurl4-openssl-dev libnetcdf-dev
cd ~/Downloads
wget -c https://www.umr-cnrm.fr/surfex/data/OPEN-SURFEX/open_surfex_v8_1_20210914.tar.gz
tar -xf open_surfex_v8_1_20210914.tar.gz
cd open_SURFEX_V8_1/src
./configure
. ../conf/profile_surfex-LXgfortran-SFX-V8-1-1-MPIAUTO-OMP-O2-X0
make
sudo make installmaster