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

Error in configure for WPS 4.6.0

jaytee

New member
Despite compiling WRF, netcdf, etc successfully, the ./configure fails on WPS with the following:
Your Fortran + NETCDF did not run successfully.

Running fort_netcdf indicates it can't find the libnetcdff library, although it seems to be there!

jt2@littleboy2 WPS]$ ./fort_netcdf
./fort_netcdf: error while loading shared libraries: libnetcdff.so.7: cannot open shared object file: No such file or directory
[jt2@littleboy2 WPS]$

It is compiled as follows:
$FC ${FFLAGS} fort_netcdf.f -o fort_netcdf -L${NETCDF}/lib $NETCDFF -lnetcdf > /dev/null 2>&1

FC is gfortran
FFLAGS are -ffree-form -O -fconvert=big-endian -frecord-marker=4
NETCDF is /home/jt2/Build_WRF/LIBRARIES/libs/netcdf
NETCDFF is -lnetcdff

[jt2@littleboy2 WPS]$ ls $NETCDF/lib
libnetcdf.a libnetcdff.la libnetcdff.so.7 libnetcdf.la libnetcdf.so libnetcdf.so.15.2.0
libnetcdff.a libnetcdff.so libnetcdff.so.7.0.0 libnetcdf.settings libnetcdf.so.15 pkgconfig
[jt2@littleboy2 WPS]$
 
Hi, Can you attach the following files? Thanks!

WPS compile log
WRF compile log
configure.wps
configure.wrf
 
If I go ahead and compile after the error in configure...
 

Attachments

  • compile.wrf.log
    838.4 KB · Views: 2
  • configure.wrf.txt
    21.5 KB · Views: 1
  • configure.wps.txt
    3.5 KB · Views: 1
opps .. here's the WPS compile log

and the error is similar with the compiled WPS utilities
[jt2@littleboy2 WPS]$ ./geogrid.exe
./geogrid.exe: error while loading shared libraries: libnetcdff.so.7: cannot open shared object file: No such file or directory
[jt2@littleboy2 WPS]$ ./metgrid.exe
./metgrid.exe: error while loading shared libraries: libnetcdff.so.7: cannot open shared object file: No such file or directory
[jt2@littleboy2 WPS]$ ./ungrib.exe
*** Starting program ungrib.exe ***
Start_date = 2019-09-04_12:00:00 , End_date = 2019-09-06_00:00:00
output format is WPS
Path to intermediate files is ./
ERROR: edition_num: unable to open GRIBFILE.AAA
 

Attachments

  • compile.log.wps.txt
    87.7 KB · Views: 5
Last edited:
When I check the libraries fort_netcdf looks for (or geogrid.exe) I see the following:

[jt2@littleboy2 WPS]$ ldd fort_netcdf
linux-vdso.so.1 (0x00007ffcee1f1000)
libnetcdff.so.7 => not found
libnetcdf.so.15 => /lib64/libnetcdf.so.15 (0x00007fc7594dc000)

Why is it picking up libnetcdf.so.15 in /lib64 instead of where I asked it too? Is this a clue?
 
Thanks for sharing that. Take a look at this previous post that describes a solution to a similar issue.
LD_LIBRAY^_PATH includes the path to the netcdff library:

[jt2@littleboy2 WPS]$ echo $LD_LIBRARY_PATH
/data/opt/hyperworks/2022.3/altair/mpi/linux64/intel-mpi/libfabric/lib:/data/opt/hyperworks/2022.3/altair/mpi/linux64/intel-mpi/lib/release:/data/opt/hyperworks/2022.3/altair/mpi/linux64/intel-mpi/lib:/data/opt/hyperworks/2022.3/altair/feko/bin:/data/opt/hyperworks/2022.3/altair/mpi/linux64/intel-mpi/lib:/data/opt/hyperworks/2022.3/altair/mpi/linux64/mpich/lib:/opt/rh/gcc-toolset-13/root/usr/lib64:/opt/rh/gcc-toolset-13/root/usr/lib:/home/jt2/BUILD_WRF/LIBRARIES/libs/lib:/home/jt2/BUILD_WRF/LIBRARIES/libs/grib2/lib:/home/jt2/BUILD_WRF/LIBRARIES/libs/netcdf/lib

I added both the netcdf top-level directory and the netcdf/lib directory to my $PATH. I still get the error.

It's also apparently still picking up lnetcdf from /lib64 instead of my netcdf directory

[jt2@littleboy2 WPS]$ ldd fort_netcdf
linux-vdso.so.1 (0x00007fffd91f8000)
libnetcdff.so.7 => not found
libnetcdf.so.15 => /lib64/libnetcdf.so.15 (0x00007fce337ac000)
 
Try issuing the command 'env' which should show you all the environment variables and paths set. Perhaps it will show one that points to the lib64 location? It seems like, regardless of your specific settings, there is still some underlying setting that's overriding what you're doing. Unfortunately this seems to be a problem specific to your environment. If you aren't able to solve it, I would suggest trying to speak to a systems administrator at your institution to see if they are able to help you figure it out. Other than that, recompiling everything over again, from scratch (including WRF), may be another option.
 
Try issuing the command 'env' which should show you all the environment variables and paths set. Perhaps it will show one that points to the lib64 location? It seems like, regardless of your specific settings, there is still some underlying setting that's overriding what you're doing. Unfortunately this seems to be a problem specific to your environment. If you aren't able to solve it, I would suggest trying to speak to a systems administrator at your institution to see if they are able to help you figure it out. Other than that, recompiling everything over again, from scratch (including WRF), may be another option.
Bash:
env | sort

will list the environment in order. Can you post the output from that command @jaytee

For example I need to export these variables for my environment, I do it outside of the bashrc file. Sometimes if the bashrc file has the exports it can override the command line exports


Bash:
export LD_LIBRARY_PATH=/home/workhorse/WRF/Libs/NETCDF/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/workhorse/WRF/Libs/grib2/lib:$LD_LIBRARY_PATH
export PATH=/home/workhorse/WRF/Libs/MPICH/bin:$PATH
export PATH=/home/workhorse/WRF/Libs/grib2/lib:$PATH
 
I have compiled a large number of versions of WRF and WPS, among which the oneAPI version and gcc version are used by different accounts to avoid conflicts. I encountered a similar issue while compiling gcc V4.6WPS, and I manually typed env every time to solve it.
Like this:

export WRF_LIBS_DIR=/opt/Build_WRF/support_gcc/
export LD_LIBRARY_PATH="$WRF_LIBS_DIR/grib2/lib:$WRF_LIBS_DIR/netcdf/lib:$WRF_LIBS_DIR/hdf5/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$WRF_LIBS_DIR/grib2/lib:$WRF_LIBS_DIR/netcdf/lib:$WRF_LIBS_DIR/hdf5/lib:$LIBRARY_PATH"
export C_INCLUDE_PATH="$WRF_LIBS_DIR/grib2/include:$WRF_LIBS_DIR/netcdf/include:$WRF_LIBS_DIR/hdf5/include:$C_INCLUDE_PATH"
export CPLUS_INCLUDE_PATH="$WRF_LIBS_DIR/grib2/include:$WRF_LIBS_DIR/netcdf/include:$WRF_LIBS_DIR/hdf5/include:$CPLUS_INCLUDE_PATH"
export PATH=$WRF_LIBS_DIR/netcdf/bin:$PATH
export NETCDF=$WRF_LIBS_DIR/netcdf
export JASPERLIB=$WRF_LIBS_DIR/grib2/lib
export JASPERINC=$WRF_LIBS_DIR/grib2/include

Perhaps you can perform a similar operation or a better automatic environment loading operation
 
Top