WRF Compilation Issue Related to netCDF pre-built binary

Hi,

I was trying to compile WRF 3.2 on PGI Workstation 10.6 (64-bit). I was following the instructions found here.
During the compilation for real cases (./compile em_real), I got the following errors. After googling for sometime I figured that, this issue can be related to the pre-build netCDF binary that I got from here . Can some one please help me to resolve this issue?

pgf90 -o wrf.exe -mp -Minfo=mp -fastsse -Mvect=noaltcode -Mprefetch=distance:8 -Mfprelaxed -tp core2-64 -w -Mfree -byteswapio Ws2_32.lib wrf.o …/main/module_wrf_top.o libwrflib.a …/external/fftpack/fftpack5/libfftpack.a …/external/io_grib1/libio_grib1.a …/external/io_grib_share/libio_grib_share.a …/external/io_int/libwrfio_int.a …/external/esmf_time_f90/libesmf_time.a …/external/RSL_LITE/librsl_lite.a …/frame/module_internal_header_util.o …/frame/pack_utils.o …/external/io_netcdf/libwrfio_nf.a /e/Scratch_For_Eran/NETCDF401/lib/libnetcdf.lib
LINK : warning LNK4044: unrecognized option ‘/e/Scratch_For_Eran/NETCDF401/lib/libnetcdf.lib’; ignored
Creating library wrf.lib and object wrf.exp
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_vara_text_ referenced in function ext_ncd_support_routines_gettimeindex_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_strerror_ referenced in function ext_ncd_support_routines_uppercase_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_open_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_varid_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_var_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_dimlen_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_vara_text_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_nvars_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_varname_ referenced in function ext_ncd_open_for_read_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_create_ referenced in function ext_ncd_open_for_write_begin_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_def_dim_ referenced in function ext_ncd_open_for_write_begin_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_def_var_ referenced in function ext_ncd_open_for_write_begin_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_enddef_ referenced in function ext_ncd_open_for_write_commit_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_close_ referenced in function ext_ncd_ioclose_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_sync_ referenced in function ext_ncd_iosync_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_redef_ referenced in function ext_ncd_redef_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_att_ referenced in function ext_ncd_get_dom_ti_real_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_att_real_ referenced in function ext_ncd_get_dom_ti_real_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_att_int_ referenced in function ext_ncd_get_dom_ti_integer_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_att_double_ referenced in function ext_ncd_get_dom_ti_double_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_att_text_ referenced in function ext_ncd_get_dom_ti_char_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_att_real_ referenced in function ext_ncd_put_dom_ti_real_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_att_int_ referenced in function ext_ncd_put_dom_ti_integer_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_att_double_ referenced in function ext_ncd_put_dom_ti_double_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_att_text_ referenced in function ext_ncd_put_dom_ti_char_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_vara_real_ referenced in function ext_ncd_put_var_td_real_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_put_vara_real_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_vara_double_ referenced in function ext_ncd_put_var_td_double_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_put_vara_double_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_put_vara_int_ referenced in function ext_ncd_put_var_td_integer_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_put_vara_int_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_vara_real_ referenced in function ext_ncd_get_var_td_real_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_get_vara_real_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_vara_double_ referenced in function ext_ncd_get_var_td_double_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_get_vara_double_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_get_vara_int_ referenced in function ext_ncd_get_var_td_integer_
libwrfio_nf.a(field_routines.o) : error LNK2001: unresolved external symbol nf_get_vara_int_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_dimname_ referenced in function ext_ncd_read_field_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_vartype_ referenced in function ext_ncd_get_var_info_
libwrfio_nf.a(wrf_io.o) : error LNK2019: unresolved external symbol nf_inq_vardimid_ referenced in function ext_ncd_get_var_info_
wrf.exe : fatal error LNK1120: 34 unresolved externals
make[1]: [em_wrf] Error 2 (ignored)
make[1]: Leaving directory `/e/Scratch_For_Eran/WRFV3/main’
( cd run ; /bin/rm -f wrf.exe ; ln -s …/main/wrf.exe . )

You just need the netcdf for Fortran.

Hongyon

I’m sorry what do you mean by that? Do you think the pre-built binary I got is not good?

Hi Eran,

This is the problem:

/e/Scratch_For_Eran/NETCDF401/lib/libnetcdf.lib
LINK : warning LNK4044: unrecognized option ‘/e/Scratch_For_Eran/NETCDF401/lib/libnetcdf.lib’; ignored

LINK is the Microsoft linker so doesn’t recognize the Cygwin PATH “/e/”. Instead, use the DOS PATH “E:\Scratch_For_Eran/NETCDF401/lib/libnetcdf.lib”.

Hope this helps,
Mat