Re: Undefined References to _gfortran_*

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 02 2011 - 12:39:44 MDT

Hi Ronnie,

Since NCAR Graphics was compiled with gfortran, you need to include "-
lgfortran" on your compile line.

If g95 can't find "libgfortran.a" then see this FAQ:

http://www.ncl.ucar.edu/FAQ/#err_msgs_008

This is for the WRAPIT program, but the same information applies here.

--Mary

On Sep 1, 2011, at 2:43 PM, Ronnie Leeper wrote:

> he binary distribution "ncl_ncarg-6.0.0.Linux_RedHat_x86_64_gcc412"
> seems to not work well on a 64bit RedHat Linux with gcc version
> 4.1.2 cluster. I am attempting to install some WRF related
> graphical programs. WRF was installed using g95, which may or may
> not be the root of this issue. The error messages I get are mainly
> undefined references to ncl function calls. Some of the error
> messages are provided below in blue:
>
> make[1]: Entering directory `/home/ronnieleeper/WRFv3.3/WPS/util/src'
> /bin/rm -f module_map_utils.o module_map_utils.mod
> /usr/bin/cpp -C -P -traditional -D_UNDERSCORE -DBYTESWAP -DLINUXG95 -
> DIO_NETCDF -DBIT32 -D_MPI -D_UTIL -I/home/ronnieleeper/WRFv3.3/
> WPS/../WRFV3/external/io_netcdf -I/home/ronnieleeper/WRFv3.3/WPS/../
> WRFV3/external/io_grib_share -I/home/ronnieleeper/WRFv3.3/WPS/../
> WRFV3/external/io_grib1 -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/
> external/io_int -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/inc
> module_map_utils.F > module_map_utils.f90
> mpif90 -ffree-form -g -fno-second-underscore -fendian=big -c
> module_map_utils.f90 -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/
> external/io_netcdf -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/
> external/io_grib_share -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/
> external/io_grib1 -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/external/
> io_int -I/home/ronnieleeper/WRFv3.3/WPS/../WRFV3/inc
> /bin/cp plotgrids.F plotgrids.f90
> g95 -ffree-form -g -fno-second-underscore -fendian=big -c
> plotgrids.f90
> g95 -o plotgrids.exe -g module_map_utils.o module_debug.o cio.o
> constants_module.o misc_definitions_module.o \
> plotgrids.o -L/home/ronnieleeper/prgfiles/ncl/lib -
> lncarg -lncarg_gks -lncarg_c -L/usr/lib64 -lX11
> /home/ronnieleeper/prgfiles/ncl/lib/libncarg.a(mdpit.o): In function
> `mdpit_':
> mdpit.f:(.text+0x47a): undefined reference to `_gfortran_pow_r8_i4'
> mdpit.f:(.text+0x4f4): undefined reference to `_gfortran_pow_r8_i4'
> /home/ronnieleeper/prgfiles/ncl/lib/libncarg.a(mdsetc.o): In
> function `mdsetc_':
> mdsetc.f:(.text+0x58): undefined reference to
> `_gfortran_compare_string'
> mdsetc.f:(.text+0x75): undefined reference to
> `_gfortran_compare_string'
> /home/ronnieleeper/prgfiles/ncl/lib/libncarg.a(mdsetd.o): In
> function `mdsetd_':
> mdsetd.f:(.text+0x50): undefined reference to
> `_gfortran_compare_string'
> mdsetd.f:(.text+0x6d): undefined reference to
> `_gfortran_compare_string'
> mdsetd.f:(.text+0xab): undefined reference to
> `_gfortran_compare_string'
> /home/ronnieleeper/prgfiles/ncl/lib/libncarg.a(mdsetd.o):mdsetd.f:
> (.text+0xc8): more undefined references to
> `_gfortran_compare_string' follow
>
> When I "nm /home/ronnieleeper/prgfiles/ncl/lib/libncarg.a | grep
> _gfortran_pow_r8_i4"
>
> The function is found and I get
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
> U _gfortran_pow_r8_i4
>
> I am not sure what the "U" means, but does anyone have any
> suggestions as to why ncl or gfortran commands aren't defined?
>
> Thanks,
>
> Ronald David Leeper
> USCRN Quality Assurance Specialist, NCDC
> Research Associate, CICS-NC
> Global Climate Applications Division
> National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> ronald.leeper@noaa.gov
> leeperd@gmail.com
> Office: (828) 257-3185
> Fax: (828) 271-4022
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install

_______________________________________________
ncl-install mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-install
Received on Fri Sep 2 12:39:50 2011

This archive was generated by hypermail 2.1.8 : Mon Sep 19 2011 - 13:57:26 MDT