[Wrf-users] Errors in compiling geogrid.exe in WPS

ashwinD12 . winash12 at gmail.com
Thu Jul 17 00:23:44 MDT 2014


Great catch Dominikus. That removed those errors but I ultimately had
to settle with these linking instructions -

WRF_LIB             = $(WRF_DIR)/external/io_grib1/libio_grib1.a \
                      $(WRF_DIR)/external/io_grib_share/libio_grib_share.a \
                      $(WRF_DIR)/external/io_int/libwrfio_int.a \
                      $(WRF_DIR)/external/io_netcdf/libwrfio_nf.a \
                      $(NETCDF)/lib/libnetcdff.a                   \
                      $(NETCDF)/lib/libnetcdf.a                    \
                      $(NETCDF)/lib/libhdf5_hl.a                   \
                      $(NETCDF)/lib/libhdf5.a                      \
                      $(NETCDF)/lib/libz.a

On 7/17/14, Dominikus Heinzeller <climbfuji at ymail.com> wrote:
> Hi,
>
> I might be wrong but it looks like the order of the netcdf libraries is
> wrong:
>
> ...
> WRF_LIB             = $(WRF_DIR)/external/io_grib1/libio_grib1.a \
>                       $(WRF_DIR)/external/io_grib_share/libio_grib_share.a
> \
>                       $(WRF_DIR)/external/io_int/libwrfio_int.a \
>                       $(WRF_DIR)/external/io_netcdf/libwrfio_nf.a \
>                       $(NETCDF)/lib/libnetcdf.a                   \
>                       $(NETCDF)/lib/libnetcdff.a
> ..
>
> try instead:
>
> ...
> WRF_LIB             = $(WRF_DIR)/external/io_grib1/libio_grib1.a \
>                       $(WRF_DIR)/external/io_grib_share/libio_grib_share.a
> \
>                       $(WRF_DIR)/external/io_int/libwrfio_int.a \
>                       $(WRF_DIR)/external/io_netcdf/libwrfio_nf.a \
>                       $(NETCDF)/lib/libnetcdff.a                   \
>                       $(NETCDF)/lib/libnetcdf.a
> ...
>
> Cheers
>
> Dom
>
>
> On 16/07/2014, at 4:21 pm, ashwinD12 . <winash12 at gmail.com> wrote:
>
>> Since WRF 3.6 compiled correctly why do I get these linking errors in WPS
>> 's geogrid.exe -
>>
>> SUFFIXES: .F .f .c .o
>>
>> SHELL                   =       /bin/sh
>>
>> NCARG_LIBS              =       -L$(NCARG_ROOT)/lib -lncarg -lncarg_gks
>> -lncarg_
>> c \
>>                                 -L/usr/X11R6/lib -lX11
>>
>> NCARG_LIBS2             =       # May be overridden by architecture
>> specific val
>> ue below
>>
>> FDEFS                   =       -DUSE_JPEG2000 -DUSE_PNG
>>
>> # Listing of options that are usually independent of machine type.
>> # When necessary, these are over-ridden by each architecture.
>>
>> ARFLAGS                 =
>>
>> PERL                    =       perl
>>
>> RANLIB                  =       echo
>>
>> COMPILING_ON_CYGWIN_NT = yes
>>
>> WRF_INCLUDE     =       -I$(WRF_DIR)/external/io_netcdf \
>>                         -I$(WRF_DIR)/external/io_grib_share \
>>                         -I$(WRF_DIR)/external/io_grib1 \
>>                         -I$(WRF_DIR)/external/io_int \
>>                         -I$(WRF_DIR)/inc \
>>                         -I$(NETCDF)/include
>>
>> WRF_LIB         =       -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
>>                         -L$(WRF_DIR)/external/io_grib_share
>> -lio_grib_share \
>>                         -L$(WRF_DIR)/external/io_int -lwrfio_int \
>>                         -L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
>>                         -L$(NETCDF)/lib -lnetcdff -lnetcdf
>>
>>
>> COMPRESSION_LIBS        =  # intentionally left blank, fill in
>> COMPRESSION_LIBS
>> below
>>
>> COMPRESSION_INC         =  # intentionally left blank, fill in
>> COMPRESSION_INC b
>> elow
>>
>> #
>> #   Settings for CYGWIN_NT i686 x86_64 PGI compiler on Windows    (serial)
>>
>> #
>> #
>> COMPRESSION_LIBS    = -L/usr/local/lib -ljasper -lpng -lz
>> COMPRESSION_INC     = -I/usr/local/include/jasper
>> FDEFS               = -DUSE_JPEG2000 -DUSE_PNG
>> #NCARG_LIBS2        = -L${PGI}/linux86/6.1/lib -lpgftnrtl -lpgc \
>> #                     -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.3 -lg2c
>> WRF_LIB             = $(WRF_DIR)/external/io_grib1/libio_grib1.a \
>>                       $(WRF_DIR)/external/io_grib_share/libio_grib_share.a
>> \
>>                       $(WRF_DIR)/external/io_int/libwrfio_int.a \
>>                       $(WRF_DIR)/external/io_netcdf/libwrfio_nf.a \
>>                       $(NETCDF)/lib/libnetcdf.a                   \
>>                       $(NETCDF)/lib/libnetcdff.a
>> SFC                 = gfortran
>> SCC                 = gcc
>> DM_FC               = mpif90 -f90=$(SFC)
>> DM_CC               = mpicc  -cc=$(SCC)
>> FC                  = $(SFC)
>> CC                  = $(SCC)
>> LD                  = $(SFC)
>> FFLAGS              = -ffree-form -ffree-line-length-none -O
>> -fconvert=big-endia
>> n  -frecord-marker=4
>> F77FLAGS            = -ffree-form -O -fconvert=big-endian
>> -frecord-marker=4
>> FCSUFFIX            =
>> FNGFLAGS            = $(FFLAGS)
>> LDFLAGS             = -g
>> CFLAGS              = -g
>> CPP                 = /lib/cpp -C -P
>> CPPFLAGS            = -D_UNDERSCORE -DBYTESWAP -DWIN32 -DIO_NETCDF
>> -DIO_BINARY -
>> DIO_GRIB1 -DBIT32
>> ARFLAGS             =
>>
>> ################################################################################
>> ########################################
>> #
>> #       Macros, these should be generic for all machines
>>
>> LN              =       ln -sf
>> MAKE            =       make -i -r
>> RM              =       /bin/rm -f
>> CP              =       /bin/cp
>> AR              =       ar ru
>>
>> .IGNORE:
>> .SUFFIXES: .c .f .F .o
>>
>> #       There is probably no reason to modify these rules
>>
>> .c.o:
>>         $(RM) $@
>>         $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
>>
>> .f.o:
>>         $(RM) $@ $*.mod
>>         $(FC) $(F77FLAGS) -c $< $(WRF_INCLUDE)
>>
>> .F.o:
>>         $(RM) $@ $*.mod
>>         $(CPP) $(CPPFLAGS) $(FDEFS) $(WRF_INCLUDE) $< > $*.f90
>>         $(FC) $(FFLAGS) -c $*.f90 $(WRF_INCLUDE)
>> #       $(RM) $*.f90
>>
>>
>>
>> And here is my log file
>>
>>
>> gfortran -g -o geogrid.exe cio.o wrf_debug.o bitarray_module.o
>> constants_module.o module_stringutil.o geogrid.o gridinfo_module.o
>> hash_module.o interp_module.o list_module.o llxy_module.o
>> misc_definitions_module.o module_debug.o module_map_utils.o
>> output_module.o parallel_module.o process_tile_module.o
>> proc_point_module.o queue_module.o read_geogrid.o smooth_module.o
>> source_data_module.o \
>> 	../../../WRFV3/frame/module_driver_constants.o \
>> 	../../../WRFV3/frame/pack_utils.o ../../../WRFV3/frame/module_machine.o
>> \
>> 	../../../WRFV3/frame/module_internal_header_util.o \
>> 	-I../../../WRFV3/external/io_netcdf
>> -I../../../WRFV3/external/io_grib_share -I../../../WRFV3/external/io_grib1
>> -I../../../WRFV3/external/io_int -I../../../WRFV3/inc
>> -I/home/lenovo/gz/WPS/netcdf_links/include \
>> 	../../../WRFV3/external/io_grib1/libio_grib1.a
>> ../../../WRFV3/external/io_grib_share/libio_grib_share.a
>> ../../../WRFV3/external/io_int/libwrfio_int.a
>> ../../../WRFV3/external/io_netcdf/libwrfio_nf.a
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdf.a
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a \
>> 	
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-misc.o): In
>> function `nf_inq_libvers_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-misc.c:20: undefined
>> reference to `nc_inq_libvers'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-misc.o): In
>> function `nf_strerror_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-misc.c:36: undefined
>> reference to `nc_strerror'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In
>> function `nf_put_vara_text_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:22: undefined
>> reference to `nc_put_vara_text'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In
>> function `nf_get_vara_text_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:29: undefined
>> reference to `nc_get_vara_text'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In
>> function `nf_put_vara_int1_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:37: undefined
>> reference to `nc_put_vara_schar'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In
>> function `nf_get_vara_int1_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:55: undefined
>> reference to `nc_get_vara_schar'
>> /home/lenovo/gz/WPS/netcdf_links/lib/libnetcdff.a(fort-varaio.o): In
>> function `nf_put_vara_int2_':
>> /home/lenovo/gz/netcdf-fortran-4.2/fortran/fort-varaio.c:73: undefined
>> reference to `nc_put_vara_short'
>> _______________________________________________
>> Wrf-users mailing list
>> Wrf-users at ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/wrf-users
>
>


More information about the Wrf-users mailing list