PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

PGI Workstation (Mac OsX 10.8.2) and WRF-3.3.1

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
lcana



Joined: 16 Jun 2006
Posts: 10

PostPosted: Tue Nov 13, 2012 4:45 am    Post subject: PGI Workstation (Mac OsX 10.8.2) and WRF-3.3.1 Reply with quote

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
Back to top
View user's profile
TheMatt



Joined: 06 Jul 2009
Posts: 306
Location: Greenbelt, MD

PostPosted: Tue Nov 13, 2012 6:20 am    Post subject: Reply with quote

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.
Back to top
View user's profile
lcana



Joined: 16 Jun 2006
Posts: 10

PostPosted: Wed Nov 14, 2012 4:37 am    Post subject: I got it! Reply with quote

TheMatt wrote:
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!
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group