Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Problems compiling WRF

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member

I am trying to build the latest WRF v4.1.4 on a CentOS-7 Linux desktop. I have taken the following steps:

cd /tmp
sudo apt-get install -y libnetcdff-dev
sudo export NETCDF=/usr/
<Download from GitHub>
cd WRF-release-v4.1.4

Then (I have chosen '32' for serial and gfortran and gcc, and '0' for no nesting):
sudo ./configure

Then, I try to compile an example:
sudo ./compile em_squall2d_x

I get the following errors (see attached compile.log file):

makefile:43: recipe for target 'diffwrf' failed
Makefile:16: recipe for target 'em_wrf' failed
Makefile:28: recipe for target 'em_ideal' failed

Does netCDF need to be compiled as well? I have compiled both the netCDF-c and netCDF-fortran but they do not create the needed '' file that WRF needs.

Many thanks in advance.


  • compile.log
    105.4 KB · Views: 49
Please take a look at the website here and follow the instructions step by step:

if you still cannot build WRF successfully, please send me your log file to take a look.
Hi Ming,

Thank you very much for this. By following the tutorial in the link you provided, I can now compile it.