Page 1 of 1

Error compiling ARWpost Ubuntu

PostPosted: Sun Jun 05, 2011 1:32 pm
by chrisc
Dear all
I've got a problem that seems similar to other posts here but for the life of me I can't figure out a solution based on previous posts. I have successfully compiled and run WPS and WRF but when it comes to ARWpost I get this error when compiling.

module_interp.f:(.text+0xc429): undefined reference to `nf_inq_varid_'
module_interp.f:(.text+0xc5af): undefined reference to `nf_inq_varid_'
module_interp.f:(.text+0xc67d): undefined reference to `nf_inq_var_'
module_interp.f:(.text+0xc95a): undefined reference to `ncvgt_'
module_interp.f:(.text+0xcca7): undefined reference to `ncvgt_'
module_interp.f:(.text+0xcf87): undefined reference to `ncvgt_'
make: [ARWpost.exe] Error 1 (ignored)

I have tried older versions of netcdf, no luck. I've tried the older version of ARWpost but that doesn't work either. I've tried with gfortran and intel fortran. I am working on Ubuntu 10.10. Please can anyone help, any suggestions welcome :)
best regards
Chris

Re: Error compiling ARWpost Ubuntu

PostPosted: Tue Jun 07, 2011 6:50 am
by chrisc
This problem seems solved by using the pre-compiled binaries for netcdf:
netcdf-3.6.2.tar.gz - Binary distribution of netcdf-3.6.2 on linux_2.6-x86_64.
Using these the compilation of ARWpost with gfortran successfully produces ARWpost.exe but then I get errors when I try to run ARWpost.
*** glibc detected *** ./ARWpost.exe: malloc(): memory corruption: 0x0000000001354500 ***

HOWEVER re-configuring and compiling ARWpost with intel fortran while continuing to use netcdf-3.6.2 appears to solve this problem. I hope this helps someone.

Re: Error compiling ARWpost Ubuntu

PostPosted: Wed Sep 14, 2011 10:20 am
by jrm16020
If necessary, recompile NetCDF, still using NetCDF-4 functionality, but make detailed notes regarding any optimization flags used when NetCDF is compiled, specifically a CPPFLAG that looks like -O2 or -O3. I had the exact same problem with ARWpost, receiving the "undefined reference ..." message, but edited the configure.arwp file to change all of the default -O flags to match the -O2 used by my NetCDF compilation. In addition, I added the CPPFLAG -I/path/to/netcdf/include, and the LDFLAG "-L/path/to/netcdf/lib -lnetcdf -lnetcdff". This may be a little overkill, but it did the trick for me and I now have the ARWpost.exe program in my directory.

Re: Error compiling ARWpost Ubuntu

PostPosted: Sun Sep 18, 2011 8:04 pm
by jrm16020
It should be noted that you may have to link the NetCDF libraries to the ARWpost, WPS and/or WRF directories for everything to work.