Make Command Gives Error During Installation of Surfex Code

Make Command Gives Error During Installation of Surfex Code

I need to install and compile SURFEX code on Ubuntu 18.04. To do that I'm following the docs here. This went well until I tried to compile the master version of the code with make. I got Error 127. I looked up the meaning of this error, but I don't really understand what it means in this context. Any help greatly appreciated.

The full message is as follows

[ ! -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 Answer

According to compilation log

/bin/sh: 2: cmake: not found

you have to install the package which provides cmake executable by

sudo apt-get install cmake

The reproducible method of SURFEX installation for Ubuntu 18.04.6 LTS is below:

sudo apt-get install build-essential cmake libopenmpi-dev gfortran git libcurl4-openssl-dev libnetcdf-dev

cd ~/Downloads
wget -c 
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.