Closed xin-chen-github closed 1 year ago
Thanks for writing @xin-chen-github. That error means that KPP cannot find the flex
library, which is one of its dependencies. In this version of KPP, this is set in the kpp-code/Makefile.defs
file here:
Note that this code snippet uses the ${FLEX_HOME}
environment variable. You can set this to the path to your libfl.a
or libfl.so
file (i.e. the flex
library file). In many cases this will be in the /usr/lib
or /usr/local/lib
path. If your system uses a software module package, ask your IT staff where this is. Then once you know, add this line to your .bashrc
file:
export FLEX_HOME=/path/to/flex/library
Oops and then you have to type . ~/.bashrc
at the command line to accept the changes.
Thanks @yantosca for the thoughts. I'm pretty sure that I modified the flex library path in Makefile.def:
ifndef FLEX_HOME
FLEX_LIB_DIR=~/flex/lib
else
FLEX_LIB_DIR=$FLEX_HOME/lib
endif
And actually I have these defined in my .bashrc too, to confirm:
[xinch@svante-login ~]$ which flex
~/flex/bin/flex
[xinch@svante-login ~]$ echo $FLEX_HOME
/home/xinch/flex
[xinch@svante-login ~]$ echo $FLEX_LIB_DIR
/home/xinch/flex/lib
In my .bashrc, I have:
# flex for KPP
FLEX_HOME=~/flex
#export FLEX_HOME
export PATH=$PATH:$FLEX_HOME/bin
# bison for KPP
BISON_HOME=~/bison
#export BISON_HOME
export PATH=$PATH:$BISON_HOME/bin
# KPP
FLEX_LIB_DIR=$FLEX_HOME/lib
export FLEX_LIB_DIR
export PATH=$PATH:$FLEX_LIB_DIR
KPP_HOME=~/tmpfolder/KPP/kpp-code
export KPP_HOME
export PATH=$PATH:$KPP_HOME/bin
Any further thoughts on what's going on?
Thanks, Xin
Thanks for the info @xin-chen-github. Try adding FLEX_LIB_DIR to the LD_LIBRARY_PATH variable in your .bashrc
:
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${FLEX_LIB_DIR}:"
The "can't find library" error disappeared already, although I don't really know from which step of the debugging it disappeared... distracted by many lines of the warning messages above it #62.
Is it fine to proceed with those warning messages?
Thanks, Xin
@xin-chen-github: Yes, those warning messages are OK. We got rid of them in KPP 2.5.0 and later. They are basically complaining about C-language syntax (unused variables, missing function prototypes, etc). Warnings are harmless but Errors are fatal.
Thank you @yantosca, works fine now, I'll close this issue.
This question follows up on the previous question posted in geoschem repository https://github.com/geoschem/geos-chem/issues/1531 and is similar to #62 posted in the KPP repository here.
For research needs, we now need to modify chemical mechanism in GCv13.4.1 which requires KPPv2.3.3. When compiling KPPv2.3.3 (or a few other adjacent versions), I met the error message exactly the same as the picture attached in #62. The recommendation there was to switch to newer KPP versions, but I have mentioned in geoschem issue #1531 that newer versions of KPP require additional modifications to be consistent with GCv13.4.1 and eventually cause GCv13.4.1 segmentation fault, although KPP itself can be compiled successfully.
Any other thoughts on how to resolve the compilation error in #62 when compiling KPPv2.3.3. Does it require specific versions of related software packages such as gcc, flex, etc.?
Thanks, Xin