PGI Workstation (Mac OsX 10.8.2) and WRF-3.3.1

Dear all,
after building netcdf 4.1.3 against PGI compilers, I’m trying to build WRFV3.3.1
I’ve modified configure.wrf to match my computer:

===============

Settings for Darwin (MACOS) PGI compiler with pgcc (dmpar)

DMPARALLEL = 1
OMPCPP = # -D_OPENMP
OMP = # -mp -Minfo=mp -Mrecursive
OMPCC = # -mp
SFC = pgf90
SCC = pgcc
CCOMP = pgcc
DM_FC = mpif90
DM_CC = mpicc -DMPI2_SUPPORT
FC = $(DM_FC)
CC = $(DM_CC) -DFSEEKO_OK
LD = $(FC)
RWORDSIZE = $(NATIVE_RWORDSIZE)
PROMOTION = -r$(RWORDSIZE) -i4
ARCH_LOCAL = -DMACOS -DNONSTANDARD_SYSTEM_SUBR
CFLAGS_LOCAL = -DMACOS
LDFLAGS_LOCAL =
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O2 -tp penryn-64
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0 -tp penryn-64
FCDEBUG = # -g $(FCNOOPT)
FORMAT_FIXED = -Mfixed
FORMAT_FREE = -Mfree
FCSUFFIX =
BYTESWAPIO = -byteswapio
FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) $(OMP)
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG = -module $(WRF_SRC_ROOT_DIR)/main
TRADFLAG = -traditional
CPP = cpp -C -P -xassembler-with-cpp
AR = ar
ARFLAGS = ru
M4 = m4 -B 14000
RANLIB = ranlib
CC_TOOLS = cc

===============

I’m using the MPI version shipped together with PGI 12.10. After lots of warnings, I finally get these errors: (no executables produced)

\

mpif90 -DMPI2_SUPPORT -o wrf.exe -O2 -tp penryn-64 -w -Mfree -byteswapio wrf.o …/main/module_wrf_top.o libwrflib.a /Users/lcana/WRFV3/external/fftpack/fftpack5/libfftpack.a /Users/lcana/WRFV3/external/io_grib1/libio_grib1.a /Users/lcana/WRFV3/external/io_grib_share/libio_grib_share.a /Users/lcana/WRFV3/external/io_int/libwrfio_int.a -L/Users/lcana/WRFV3/external/esmf_time_f90 -lesmf_time /Users/lcana/WRFV3/external/RSL_LITE/librsl_lite.a /Users/lcana/WRFV3/frame/module_internal_header_util.o /Users/lcana/WRFV3/frame/pack_utils.o -L/Users/lcana/WRFV3/external/io_netcdf -lwrfio_nf -L/usr/local/lib -lnetcdf -L/Users/lcana/WRFV3/external/io_grib2 -lio_grib2 -L/usr/local/lib -ljasper -L/usr/local/lib -lgfortran
Undefined symbols for architecture x86_64:
nccre”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncddef”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncdid”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncopn”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncsfil”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
nctlen”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncvdef”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
ncvid”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)
nf__create”, referenced from:
.C89_772 in libwrfio_nf.a(wrf_io.o)
.C4_284 in libwrfio_nf.a(field_routines.o)

and much more…

Any idea of what’s going on? Is it a problem with netcdf libraries?
Thanks in advance,

Luis

To me, it looks like you aren’t linking in the Netcdf libraries. What you’ll have to do is figure out how to pass the correct link string to WRF.

The string you’ll want to send is the output of ‘nc-config --flibs’ (since you are using NetCDF 4.1.3 and seem to be using a fortran interface: “nf__create”). This will output the correct list of libraries you need to link with it. (Note, if that nf_create isn’t a NetCDF call, then ‘nc-config --libs’ would be enough.)

If you need to get the include directory for NetCDF as well, ‘nc-config --includedir’ will give you that.

Thanks a lot!

You were right: nc-config --flibs pointed towards three missing libraries:
-lnetcdff -lm -lcurl

I’ve included them in the path and all went smooth this time.

Thanks again!