[Wrf-users] Re: Compilation Problem (Rafik Djouad)

Rafik Djouad rdjouad at senes.ca
Tue Jan 18 14:45:54 MST 2005


Steve:

I did what you suggested and I still have this problem when compiling in 
src/f90/  (the make test).

make[2]: Entering directory `/home/oper/NETCDF/netcdf-3.6.0/src/f90'
pgf90 -o netcdf_test   netcdf_test.f90 netcdf.o typeSizes.o 
../libsrc/libnetcdf.a
netcdf_test.f90:

netcdf.o(.text+0x29): In function `netcdf_nf90_inq_libvers_':
: undefined reference to `nf_inq_libvers_'
netcdf.o(.text+0x80): In function `netcdf_nf90_strerror_':
: undefined reference to `nf_strerror_'
netcdf.o(.text+0xd4): In function `netcdf_nf90_inq_base_pe_':
: undefined reference to `nf_inq_base_pe_'
netcdf.o(.text+0x104): In function `netcdf_nf90_set_base_pe_':
: undefined reference to `nf_set_base_pe_'
netcdf.o(.text+0x16a): In function `netcdf_nf90_create_':
........................................etc


Apparently, there are missing libraries or some similar problem.
Anyway, if I use the produced libraries to compile WRF I get this:

make[2]: Entering directory `/home/oper/WRF/WRFV2/external/io_netcdf'
/lib/cpp -C -P -traditional -C -P  diffwrf.F90 > diffwrf.f
pgf90 -w -byteswapio -Mfree -tp p6  -c  -I/usr/local/include diffwrf.f

diffwrf is being built now.
wrf_io.o(.text+0x23cc): In function `ext_ncd_support_routines_gettimeindex_':
: undefined reference to `nf_put_vara_text_'
wrf_io.o(.text+0x3c42): In function `ext_ncd_support_routines_netcdf_err_':
: undefined reference to `nf_strerror_'
wrf_io.o(.text+0xb44a): In function `ext_ncd_open_for_read_begin_':
: undefined reference to `nf_open_'
wrf_io.o(.text+0xb5fc): In function `ext_ncd_open_for_read_begin_':
: undefined reference to `nf_inq_varid_'


Any hint would be much appreciated..
Regards
Rafik



On Tuesday 18 January 2005 16:23, Steven G Decker wrote:
> Rafik Djouad wrote:
> > Thanks Steve,
> >
> > I use PGF compiler for both NETCDF and WRF as well.
> > When I install NETCDF the configure script generates a macro.make that
> > has CPPFLAGS = $(INCLUDES) $(DEFINES)  -Df2cFortran
> >
> > WRF helpdesk mentioned to me earlier that I should be using -DpgiFortan
> > instead of -Df2cFortran.
> >
> > How did you handle this one?
> >
> > Rafik
> >
> > On Tuesday 18 January 2005 14:49, Steven G Decker wrote:
> >>wrf-users-request at ucar.edu wrote:
> >>>Send Wrf-users mailing list submissions to
> >>>	wrf-users at ucar.edu
> >>>
> >>>To subscribe or unsubscribe via the World Wide Web, visit
> >>>	http://mailman.ucar.edu/mailman/listinfo/wrf-users
> >>>or, via email, send a message with subject or body 'help' to
> >>>	wrf-users-request at ucar.edu
> >>>
> >>>You can reach the person managing the list at
> >>>	wrf-users-owner at ucar.edu
> >>>
> >>>When replying, please edit your Subject line so it is more specific
> >>>than "Re: Contents of Wrf-users digest..."
> >>>
> >>>
> >>>Today's Topics:
> >>>
> >>>   1. Compilation Problem (Rafik Djouad)
> >>>
> >>>
> >>>----------------------------------------------------------------------
> >>>
> >>>Message: 1
> >>>Date: Tue, 18 Jan 2005 11:32:21 -0500
> >>>From: Rafik Djouad <rdjouad at senes.ca>
> >>>Subject: [Wrf-users] Compilation Problem
> >>>To: wrf-users at ucar.edu
> >>>Cc: WRF Help <wrfhelp at ucar.edu>
> >>>Message-ID: <200501181132.21207.rdjouad at senes.ca>
> >>>Content-Type: text/plain;  charset="us-ascii"
> >>>
> >>>
> >>>Hi folks!
> >>>
> >>>I have a serious problem when trying to compile WRF on my Linux machine.
> >>>The WRF guys say it is due to NETcdf libraries but I have a doubt about
> >>>it since this is happening even when I use pre-compiled netcdf binaries.
> >>>Please take a quick look at the message below and let me know if you see
> >>>anything:
> >>>
> >>>
> >>>diffwrf is being built now.
> >>>
> >>>wrf_io.o(.text+0x23cc): In function
> >
> > `ext_ncd_support_routines_gettimeindex_':
> >>>: undefined reference to `nf_put_vara_text_'
> >>>
> >>>wrf_io.o(.text+0x3c42): In function
> >
> > `ext_ncd_support_routines_netcdf_err_':
> >>>: undefined reference to `nf_strerror_'
> >>>
> >>>wrf_io.o(.text+0xb44a): In function `ext_ncd_open_for_read_begin_':
> >>>: undefined reference to `nf_open_'
> >>>
> >>>wrf_io.o(.text+0xb5fc): In function `ext_ncd_open_for_read_begin_':
> >>>: undefined reference to `nf_inq_varid_'
> >>>
> >>>................................ETC
> >>>
> >>>
> >>>AND
> >>>
> >>>ranlib libwrflib.a
> >>>pgf90 -o wrf.exe -fast -w -byteswapio -Mfree -tp p6  -byteswapio wrf.o
> >>>libwrflib.a -L../external/io_netcdf -lwrfio_nf
> >>>-L/home/oper/NETCDF/downloads/exe/netcdf-3.6.0/lib -lnetcdf
> >>>-L../external/io_grib1 -lio_grib1 ../frame/module_internal_header_util.o
> >>>../frame/pack_utils.o -L../external/esmf_time_f90 -lesmf_time
> >>>
> >>>../external/io_netcdf/libwrfio_nf.a(wrf_io.o)(.text+0x23cc): In function
> >>>
> >>>`ext_ncd_support_routines_gettimeindex_':
> >>>: undefined reference to `nf_put_vara_text_'
> >>>
> >>>../external/io_netcdf/libwrfio_nf.a(wrf_io.o)(.text+0x3c42): In function
> >>>
> >>>`ext_ncd_support_routines_netcdf_err_':
> >>>: undefined reference to `nf_strerror_'
> >>>
> >>>../external/io_netcdf/libwrfio_nf.a(wrf_io.o)(.text+0xb44a): In function
> >>>
> >>>`ext_ncd_open_for_read_begin_':
> >>>: undefined reference to `nf_open_'
> >>>
> >>>................................ETC
> >>>
> >>>I appreciate your comments!
> >>>Rafik
> >>
> >>I believe you're supposed to use the same compiler for compiling both
> >>the netCDF libraries and WRF. In my case, I used the Portland Group
> >>compiler in both cases, and it works fine. Could this be the problem?
> >>
> >>Another possibility might be your NETCDF environment variable, which
> >>should be set to the parent directory of your netCDF libraries. (So, for
> >>example, if your libraries are in /usr/local/netcdf/lib, and your
> >>include files are in /usr/local/netcdf/include, NETCDF should be set to
> >>/usr/local/netcdf.)
> >>
> >>Hope this helps,
> >>Steve
> >>_______________________________________________
> >>Wrf-users mailing list
> >>Wrf-users at ucar.edu
> >>http://mailman.ucar.edu/mailman/listinfo/wrf-users
>
> That's right, now I remember. I think if you change f2cFortran to
> pgiFortran in the CPPFLAGS that would work, but what I did was a bit
> different.
>
> In the file cfortran.h in the netCDF source code, I added
> #define pgiFortran
> at line 129, right after the two lines that repeat
> #endif /* ...Fortran */
> #endif /* ...Fortran */
>
> If you make either of the above changes, recompile netCDF, and then
> compile WRF, I think it will work.
>
> Hope this helps,
> Steve
> _______________________________________________
> Wrf-users mailing list
> Wrf-users at ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/wrf-users

-- 
Rafik DJOUAD, Ph.D, B.Eng 

SENES Consultants Limited 
121 Granton Drive, Unit 12 Richmond Hill, 
Ontario CANADA L4B 3N4 
Tel: (905) 764-9380 
Fax: (905) 764-9386 
Email Address: rdjouad at senes.ca 
Web Site: http://www.senes.ca/ 

This transmission is intended only for the addressee and may contain 
PRIVILEGED or CONFIDENTIAL information. Any unauthorized disclosure, use or 
retention is strictly prohibited. SENES does not accept liability for any 
errors, omissions, corruption or virus in contents or attachments. 
Information is provided for use "as is" by the addressee. Revised documents 
must not be represented as SENES work product, without express, written 
permission of a SENES Director. 



More information about the Wrf-users mailing list