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

Vague error with C Compiler when compiling WRF

AJames

New member
When attempting to build WRF with the following:
./compile em_real -j 1 >& log.compile

I am encountering an error that seems to suggest the compilation process can't find my installed C compiler:
(excerpt from log)
Code:
The following indicate the compilers selected to build the WRF system
 
Serial Fortran compiler (mostly for tool generation):
which SFC
/usr/bin/gfortran
 
Serial C compiler (mostly for tool generation):
which SCC
/usr/bin/gcc
 
Fortran compiler for the model source code:
which FC
Will use 'time' to report timing information
 
C compiler for the model source code:
which CC
make: *** [Makefile:68: configcheck] Error 1

If I check where my cc is installed (i.e., running "which cc") I get /usr/bin/cc, and I definitely have GCC installed:
Code:
cc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

I get the feeling there is some environment variable I need to set, any clues?
 
SOLVED THIS.

I am a linux noob and I hate environment variables with relative paths. I went through and changed all the environment variables listed in the compilation guide from this:
Code:
export NETCDF=$DIR/netcdf
export LD_LIBRARY_PATH=$NETCDF/lib:$DIR/grib2/lib
export PATH=$NETCDF/bin:$DIR/mpich/bin:${PATH}
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include

to absolute paths, without $DIR. Now it compiles!
 
I'm glad that you've got this working now!

For future reference of other users that may find this thread useful, the guide sets $DIR to $PWD, which should expand to an absolute path. If you set $DIR manually, it should also be set with an absolute path.
 
Top