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

compiling WRF3.7.1 with KPP! no executables! compile.log attached

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 compiling WRFChem 3.7.1 with KPP option and using configure option 34(dmpar) gcc;
But, Its not building executables.

I also tried building in an allover a new directory so that it doesn't overlaps anywhere, still its not building executables after compiling.

I am attaching my compile.log file.

please help me out!


  • compile.log
    812.3 KB · Views: 86
Your first problem is in the compiling of KPP - from your log file:
compile kpp
make[1]: Entering directory `/home/sahir/WRF371/Build_WRF/WRFV3/chem/KPP/kpp/kpp-2.1/src'
/usr/bin/yacc scan.y
gcc -O -c
flex scan.l
gcc -O -c lex.yy.c
scan.l:44:21: fatal error: No such file or directory
#include ""

It might be your YACC version - newer versions are not compatible with KPP - so you should compile an older version. This is what I use:
-bash-4.1$ ./yacc -V
./yacc - 1.9 20100216

This I have got:

yacc -V
yacc - 1.9 20130304

Now please help me as I dont know how to fix this.
Furthermore I am a normal user at my HPC, I dont have any access to root.
Ok, I have installed byacc -1.9 20100216, it gives me bin and man directories and yacc is in bin directory.

Having done that, I compiled again and again ended up with no executables.

Here is my compile.log and configure.wrf attached


  • compile.log
    814.1 KB · Views: 83
  • configure.wrf
    20.2 KB · Views: 63
Your new version of YACC has been used - KPP almost got compiled. Your next issue is this:
gcc -O -lm lex.yy.o scanner.o scanutil.o kpp.o gen.o code.o code_c.o code_f77.o code_f90.o code_matlab.o debug.o -L/home/sahir/WRF371/Build_WRF/LIBRARIES/flex/lib -lfl -ll -o kpp
/usr/bin/ld: cannot find -ll

The flags needed by your version of gcc are different to those that the KPP make file contains (these are set separately to the settings in your configure.wrf file).

You need to delete the -ll option from these two lines of code in this file: chem/KPP/kpp/kpp-2.1/src/Makefile
@echo " "$(SCC) $(CC_FLAGS) $(CLFLAGS) $(CFLAGS) $(OBJS) -L$(FLEX_LIB_DIR) -lfl -ll -o kpp
@$(SCC) $(CC_FLAGS) $(CFLAGS) $(CLFLAGS) $(OBJS) -L$(FLEX_LIB_DIR) -lfl -ll -o kpp

Hopefully after you do this then KPP will compile, and so should WRF-Chem.

Ok, I did the same removed -ll option from both the lines.

Still not building executables.

compile.log attached


  • compile.log
    816.2 KB · Views: 79
Looks like there’s a problem with the flex shared library - it is not being found. Possibly you need to find the library files and make sure that location is in the LD_LIBRARY_PATH environment variable - that might help. Otherwise you might have to change your version of flex - when I’m next at a computer I’ll check which version we use, and will post that info for you.
compile kpp
make[1]: Entering directory `/home/sahir/WRF371/Build_WRF/WRFV3/chem/KPP/kpp/kpp-2.1/src'
/home/sahir/WRF371/Build_WRF/LIBRARIES/byacc/bin/yacc -d scan.y
gcc -O -c
/home/sahir/WRF371/Build_WRF/LIBRARIES/flex scan.l
make[1]: execvp: /home/sahir/WRF371/Build_WRF/LIBRARIES/flex: Permission denied
make[1]: *** [lex.yy.c] Error 127
make[1]: Leaving directory `/home/sahir/WRF371/Build_WRF/WRFV3/chem/KPP/kpp/kpp-2.1/src
It looks like you are having linux system issues there - I'm afraid I can't help you with those.

In case you can solve your system issues - the version of flex that I use for compiling WRF-Chem is 2.5.35. And, if you have compiled a new copy of flex, you should make sure to set the FLEX_LIB_DIR environment variable, to point to the directory containing the libfl.a file.

Good luck!