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

Steven G Decker sgdecker at aos.wisc.edu
Tue Jan 18 14:23:35 MST 2005


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


More information about the Wrf-users mailing list