- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all, appreciate your perspective :
I have just started to use WRF V3.6 and opened my idb to find that I can only see some *.c or *.h files, but no FORTRAN source files at all (please see the attached figure).
The flags from the CONFIGURE.WRF are as follows -
====================
DMPARALLEL = 1
OMPCPP = # -D_OPENMP
OMP = # -openmp -fpp -auto
OMPCC = # -openmp -fpp -auto
SFC = ifort
SCC = icc
CCOMP = icc
DM_FC = mpif90 -f90=$(SFC)
DM_CC = mpicc -cc=$(SCC) -DMPI2_SUPPORT
FC = $(DM_FC)
CC = $(DM_CC) -DFSEEKO64_OK
LD = $(FC)
RWORDSIZE = $(NATIVE_RWORDSIZE)
PROMOTION = -i4
ARCH_LOCAL = -DNONSTANDARD_SYSTEM_FUNC -DWRF_USE_CLM
CFLAGS_LOCAL = -w -O3 -ip #-xHost -fp-model fast=2 -no-prec-div -no-prec-sqrt -ftz -no-multibyte-chars
LDFLAGS_LOCAL = -ip #-xHost -fp-model fast=2 -no-prec-div -no-prec-sqrt -ftz -align all -fno-alias -fno-common
CPLUSPLUSLIB =
ESMF_LDFLAG = $(CPLUSPLUSLIB)
FCOPTIM = -O3
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0 -fno-inline -fno-ip
FCDEBUG = # -g $(FCNOOPT) -traceback # -fpe0 -check all -ftrapuv -unroll0 -u
FORMAT_FIXED = -FI
FORMAT_FREE = -FR
FCSUFFIX =
BYTESWAPIO = -convert big_endian
FCBASEOPTS_NO_G = -ip -fp-model precise -w -ftz -align all -fno-alias $(FORMAT_FREE) $(BYTESWAPIO) #-xHost -fp-model fast=2 -no-heap-arrays -no-prec-div -no-prec-sqrt -fno-common
FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
MODULE_SRCH_FLAG =
TRADFLAG = -traditional
CPP = /lib/cpp -P
AR = ar
ARFLAGS = ru
M4 = m4
RANLIB = ranlib
CC_TOOLS = $(SCC)
=========================
Am I doing something wrong here ?
Thanks in advance,
Jack.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
it seems you're not generating debug information when compiling FORTRAN:
FCDEBUG = # -g $(FCNOOPT) -traceback # -fpe0 -check all -ftrapuv -unroll0 -u
(note the "#" in front, which discards the rest of the line)
You can look at the (verbose?) build log. It should show you icc/icpc/ifort/mpiicc/mpiifort with "-g" for both C/C++ & FORTRAN compilations. Also the linker step should be using "-g".
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Georg,
Appreciate your answer.
I have compiled the same test case (i.e., em_quarter_ss) with the same configure file but without the # comment, but I still cannot see all the FORTRAN source code dependencies of the model.
I'm attaching the CONFIGURE.WRF and COMPILE.LOG file.
Please let me know if you see somthing that need to be checked.
Thanks in advance,
Jack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the build log is not complete. I don't see where the FORTRAN source files are compiled. However, looking at the configuration file it seems that there's some manual pre-processing carried out. This means that the FORTRAN source files are temporarily generated and removed right after compilation. Hence the debugger is not able to find them anymore... and won't display them.
Could you please check this?
Thank you & best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Georg,
Thank again.
I'm not sure what you meant by manual pre-processing. I'm configuring and compiling the test cases absolutely straight forward. The simulation is running OK while outside the IDB debugger. Can you please suggest some wise ways of checking the pre-processing hypothesis ?
It may be related to the my WRFV3.6 build directory (and corresponding dependencies, i.e., NetCDF, etc - with respect to the IDB installation place) , however I'm not sure how/what to check ...
Thanks in advance,
Jack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I was mostly referring to this:
.F.f90: $(RM) $@ $(SED_FTN) $*.F > $*.b $(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.b > $@ $(RM) $*.b
This means that sources are temporarily created before compilation and removed right afterwards. The debug information will then reference the *.b files and the debugger fails in finding them, obviously.
However, I'm not sure whether this rule is really used during the build. I'd need a build log which documents how exactly the FORTRAN sources are built. In the previous logs I only see other Makefiles being called and then all objects/libraries being linked.
So, what I'd be interested in are compiler calls like:
ifort -c foo.f90 ... -o foo.o
or
mpi(i)fort -c foo.f90 ... -o foo.o
I made a quick test and C/C++ and FORTRAN mixed code works well with IDB. So it either is a bug of the debugger or the sources are not available as stored in the debug information. You could use the tool "dwarfdump <exe>" to search for the sources yourself. Maybe you find the FORTRAN files as *.b there and they are not anymore on your filesystem.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Georg,
Thanks.
I observed that the IDB doesn't open the main WRFV3 directory, but the NetCDF directory which is in the same level. So, in the IDB I see :
/home/XYZ/netcdf-4.1.3/ - and than I see only *.c or *.h files - which makes sense.
I might have problems in defining the NetCDF (or NetCDF environment variable) properly.
Jack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
one more thing to add, provided that debug information exists with the NetCDF library and its source files are unchanged and available:
The library might be loaded dynamically at runtime at a single point in time. Once the according "dlopen(...)" was called to load the library you should be able to see the sources.
IDB has a special handling to detect when libraries are loaded/unloaded. You can simply set a breakpoint on a symbol (function) which will be called within NetCDF. In the beginning the breakpoint will be "pending" because the library is not yet mapped to the memory. Once it is, the debugger will also set the breakpoint to the corresponding address(es).
Depending on how you compiled you might need to append a "_" (underscore) at the end of FORTRAN subroutine names because the default language will be C/C++. Once IDB is in FORTRAN context (current PC is at FORTRAN source file) the debugger won't need that.
Best regards,
Georg Zitzlsberger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks George,
I still did not succeed in focus on where is the IDB get its linkage to the NetCDF library.
Am currentley trying to bypass this problem by re-install the required libraries for the WRFV3 model.
Thanks for your time,
Jack.
![](/skins/images/7FC17B7B85029576C25F1E43CE255B51/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page