bartbrashers
New member
I'm trying to compile WRF-4.1.3 on CentOS 7.4 with netCDF libs that are different from the defaults for the system (which are defined in /etc/profile.d/netcdf.csh). Here's my compile script:
I've set the correct paths in configure.wrf:
After it's done, ldd says:
Do I have to manipulate $LD_LIBRARY_PATH to eliminate the system version?
Any hints for me as to what I'm missing in my compile script?
Code:
# cat my.compile
#!/bin/csh -f
setenv NETCDF /usr/local/src/wrf/netcdf-4.3.0/build
setenv NETCDFHOME $NETCDF
setenv NETCDF_DIR $NETCDF
if !($?LD_LIBRARY_PATH) then
setenv LD_LIBRARY_PATH $NETCDF_DIR/lib
else
if ( "$LD_LIBRARY_PATH" !~ *$NETCDF_DIR/lib* ) then
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:$NETCDF_DIR/lib
endif
endif
setenv NETCDF4 0
setenv WRFIO_NCD_LARGE_FILE_SUPPORT 1
echo "Cleaning"
clean -a >& /dev/null
if (-e my.configure.wrf) then
cp my.configure.wrf configure.wrf
echo "Using existing my.configure.wrf"
else
configure
cp configure.wrf my.configure.wrf
echo "Edit my.configure.wrf and re-run $0:t"
exit
endif
echo "Compiling"
./compile em_real >&! compile.out.`date +%Y-%m-%d`
echo "Done"
I've set the correct paths in configure.wrf:
Code:
# grep /usr/local my.configure.wrf
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/loca/src/wrf/netcdf-4.3.0/build/lib -lnetcdff -lnetcdf -L/usr/local/src/hdf5-1.8.20.pgi.sandybridge/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lm -lz
NETCDFPATH = /usr/local/src/wrf/netcdf-4.3.0/build
HDF5PATH = /usr/local/src/hdf5-1.8.20.pgi.sandybridge
After it's done, ldd says:
Code:
# ldd run/wrf.exe | grep netcdf
libnetcdff.so.5 => not found
libnetcdf.so.7 => not found
Do I have to manipulate $LD_LIBRARY_PATH to eliminate the system version?
Code:
# echo $LD_LIBRARY_PATH | tr ":" "\n"
/usr/local/src/szip-2.1.1/lib
/usr/local/lib
/opt/ohpc/pub/compiler/gcc/7.3.0/lib64
/usr/local/src/hdf5-1.8.20.pgi/lib
/usr/local/src/netcdf-c-4.7.2.pgi.sandybridge/build/lib
/usr/local/pgi/linux86-64/2019/lib
/usr/local/pgi/linux86-64/2019/libso
/usr/lib64
/usr/local/src/netcdf-c-4.7.2.pgi.sandybridge/build/lib
Any hints for me as to what I'm missing in my compile script?