Mountain Lion 10.8.5, Xcode-4.6.3 and PGI 13.10

Dear all,

I’m building WRF against PGI compilers and I’ve never had problems. I upgraded both Xcode (from 4.5.2) and the PGI suite (from 13.9) and this is what’s happening:


gcc -I. -I…/MEL_grib1 -DMACOS -DDM_PARALLEL -DMAX_HISTORY=25 -c alloc_2d.c
PGC-S-0040-Illegal use of symbol, __BEGIN_DECLS (/usr/include/stdio.h: 164)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier __BEGIN_DECLS by ‘;’ (/usr/include/stdio.h: 238)
PGC-W-0156-Type not specified, ‘int’ assumed (/usr/include/stdio.h: 238)
PGC-S-0036-Syntax error: Recovery attempted by inserting keyword typeof before ‘(’ (/usr/include/stdio.h: 250)
PGC-S-0138-Missing identifier for declarator in function prototype definition (/usr/include/stdio.h: 250)
PGC-S-0138-Missing identifier for declarator in function prototype definition (/usr/include/stdio.h: 250)
PGC-S-0040-Illegal use of symbol, __DARWIN_ALIAS_STARTING (/usr/include/stdio.h: 250)
PGC-S-0033-Missing declarator for dummy argument (/usr/include/stdio.h: 250)
PGC-S-0035-Syntax error: Recovery attempted by replacing typedef id __printflike by ‘=’ (/usr/include/stdio.h: 252)
PGC-S-0072-Initializer not allowed in this context (/usr/include/stdio.h: 252)
PGC-S-0140-Declaration for formal fprintf found in prototype function definition (/usr/include/stdio.h: 252)
PGC-S-0070-fprintf is not a dummy argument (/usr/include/stdio.h: 252)
PGC-S-0072-Initializer not allowed in this context (/usr/include/stdio.h: 252)
PGC-W-0095-Type cast required for this conversion (/usr/include/stdio.h: 252)
PGC-W-0155-Pointer value created from a nonlong integral type (/usr/include/stdio.h: 252)


Any idea of what’s happening? stdio.h has changed from previous versions?

Best,

Luis

Hi Luis,

I’ll pass this on to our Mac folks but I know there have been lots of problems when using upgraded version of Xcode. Apple made some major, largely incompatible changes, which caused problems.

  • Mat

Thanks Mat. Could you tell which versions of Xcode and PGI compilers (13.X) could work with MLion?

For which PGI versions support which OSX versions, please see our FAQ page: http://www.pgroup.com/support/install.htm#osx_info

  • Mat

Ok, but it doesn’t say nothing about the Xcode version. I’ve read in this forum that 4.5.2, others say 4.6.3…
I could understand that PGI 13.9 -not 13.10- together with Mountain Lion (latest version?) are ok, but which Xcode?

We worked through the Xcode/Mavericks problems
http://www.pgroup.com/products/freepgi/getxcode.pdf

and we built WRFv3 with the following configure.txt

mountainlion% ./configure
checking for perl5… no
checking for perl… found /usr/local/bin/perl (perl)
** WARNING: No path to NETCDF and environment variable NETCDF not set.
** would you like me to try to fix? [y]
n
Will configure for use without NetCDF
PHDF5 not set in environment. Will configure WRF for use without.
$JASPERLIB or $JASPERINC not found in environment, configuring to build without grib2 I/O…

Please select from among the following supported platforms.

  1. Darwin (MACOS) PGI compiler with pgcc (serial)
  2. Darwin (MACOS) PGI compiler with pgcc (smpar)
  3. Darwin (MACOS) PGI compiler with pgcc (dmpar)
  4. Darwin (MACOS) PGI compiler with pgcc (dm+sm)
  5. Darwin (MACOS) intel compiler with icc (serial)
  6. Darwin (MACOS) intel compiler with icc (smpar)
  7. Darwin (MACOS) intel compiler with icc (dmpar)
  8. Darwin (MACOS) intel compiler with icc (dm+sm)
  9. Darwin (MACOS) intel compiler with cc (serial)
  10. Darwin (MACOS) intel compiler with cc (smpar)
  11. Darwin (MACOS) intel compiler with cc (dmpar)
  12. Darwin (MACOS) intel compiler with cc (dm+sm)
  13. Darwin (MACOS) g95 with gcc (serial)
  14. Darwin (MACOS) g95 with gcc (dmpar)
  15. Darwin (MACOS) gfortran with gcc (serial)
  16. Darwin (MACOS) gfortran with gcc (smpar)
  17. Darwin (MACOS) gfortran with gcc (dmpar)
  18. Darwin (MACOS) gfortran with gcc (dm+sm)
  19. Darwin (MACOS) xlf (serial)
  20. Darwin (MACOS) xlf (dmpar)

Enter selection [1-20] : 3

Compile for nesting? (1=basic, 2=preset moves, 3=vortex following) [default 1]: 1

Configuration successful. To build the model type compile .

testing for MPI_Comm_f2c and MPI_Comm_c2f
MPI_Comm_f2c and MPI_Comm_c2f are not supported
testing for fseeko and fseeko64
fseeko is supported and handles 64 bit offsets


And here is configure.wrf

configure.wrf

This file was automatically generated by the configure script in the

top level directory. You may make changes to the settings in this

file but be aware they will be overwritten each time you run configure.

Ordinarily, it is necessary to run configure once, when the code is

first installed.

To permanently change options, change the settings for your platform

in the file arch/configure.defaults then rerun configure.

SHELL = /bin/sh
DEVTOP = pwd
LIBINCLUDE = .
.SUFFIXES: .F .i .o .f90 .c

Get core settings from environment (set in compile script)

Note to add a core, this has to be added to.

COREDEFS = -DEM_CORE=$(WRF_EM_CORE)
-DNMM_CORE=$(WRF_NMM_CORE) -DNMM_MAX_DIM=2600
-DCOAMPS_CORE=$(WRF_COAMPS_CORE)
-DDA_CORE=$(WRF_DA_CORE)
-DEXP_CORE=$(WRF_EXP_CORE)

Single location for defining total number of domains. You need

at least 1 + 2*(number of total nests). For example, 1 coarse

grid + three fine grids = 1 + 2(3) = 7, so MAX_DOMAINS=7.

MAX_DOMAINS = 21

DM buffer length for the configuration flags.

CONFIG_BUF_LEN = 32768

Size of bitmasks (in 4byte integers) of stream masks for WRF I/O

MAX_HISTORY = 25

IWORDSIZE = 4
DWORDSIZE = 8
LWORDSIZE = 4

##############################################################################

The settings in this section are defaults that may be overridden by the

architecture-specific settings in the next section.

##############################################################################

##############################################################################

NOTE: Do not modify these default values here. To override these

values, make changes after “Architecture specific settings”.

##############################################################################

Native size (in bytes) of Fortran REAL data type on this architecture

Note: to change real wordsize (for example, to promote REALs from

4-byte to 8-byte), modify the definition of RWORDSIZE in the

section following “Architecture specific settings”. Do not

change NATIVE_RWORDSIZE as is it architecture-specific.

NATIVE_RWORDSIZE = 4

Default sed command and script for Fortran source files

#SED_FTN = sed -f $(WRF_SRC_ROOT_DIR)/arch/standard.sed
SED_FTN = $(WRF_SRC_ROOT_DIR)/tools/standard.exe

Hack to work around $(PWD) not changing during OSF1 build.

$(IO_GRIB_SHARE_DIR) is reset during the OSF1 build only.

IO_GRIB_SHARE_DIR =

ESMF switches

These are set up by Config.pl

switch to use separately installed ESMF library for coupling: 1==true

ESMF_COUPLING = 0

select dependences on module_utility.o

ESMF_MOD_DEPENDENCE = $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90/module_utility.o

select -I options for external/io_esmf vs. external/esmf_time_f90

ESMF_IO_INC = -I$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90

select -I options for separately installed ESMF library, if present

ESMF_MOD_INC = $(ESMF_IO_INC)

select cpp token for external/io_esmf vs. external/esmf_time_f90

ESMF_IO_DEFS =

select build target for external/io_esmf vs. external/esmf_time_f90

ESMF_TARGET = esmf_time

ESMFINCLUDEGOESHERE



##############################################################################

LIBWRFLIB = libwrflib.a

\

Architecture specific settings

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 -f90=$(SFC)
DM_CC = mpicc -cc=$(SCC) -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 -fast
FCREDUCEDOPT = $(FCOPTIM)
FCNOOPT = -O0
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

###########################################################
######################

POSTAMBLE

FGREP = fgrep -iq

ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE)
$(ARCH_LOCAL)
$(DA_ARCHFLAGS)
-DDM_PARALLEL










-DUSE_ALLOCATABLES
-DGRIB1
-DINTIO
-DLIMIT_ARGS
-DCONFIG_BUF_LEN=$(CONFIG_BUF_LEN)
-DMAX_DOMAINS_F=$(MAX_DOMAINS)
-DMAX_HISTORY=$(MAX_HISTORY)
-DNMM_NEST=$(WRF_NMM_NEST)
CFLAGS = $(CFLAGS_LOCAL) -DDM_PARALLEL
-DMAX_HISTORY=$(MAX_HISTORY)
FCFLAGS = $(FCOPTIM) $(FCBASEOPTS)
ESMF_LIB_FLAGS =

ESMF 5 – these are defined in esmf.mk, included above

ESMF_IO_LIB = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
ESMF_IO_LIB_EXT = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time
INCLUDE_MODULES = $(MODULE_SRCH_FLAG)
$(ESMF_MOD_INC) $(ESMF_LIB_FLAGS)
-I$(WRF_SRC_ROOT_DIR)/main
-I$(WRF_SRC_ROOT_DIR)/external/io_netcdf
-I$(WRF_SRC_ROOT_DIR)/external/io_int
-I$(WRF_SRC_ROOT_DIR)/frame
-I$(WRF_SRC_ROOT_DIR)/share
-I$(WRF_SRC_ROOT_DIR)/phys
-I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc
-I$(NETCDFPATH)/include \

REGISTRY = Registry

LIB_BUNDLED =
$(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5/libfftpack.a
$(WRF_SRC_ROOT_DIR)/external/io_grib1/libio_grib1.a
$(WRF_SRC_ROOT_DIR)/external/io_grib_share/libio_grib_share.a
$(WRF_SRC_ROOT_DIR)/external/io_int/libwrfio_int.a
$(ESMF_IO_LIB)
$(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a
$(WRF_SRC_ROOT_DIR)/frame/module_internal_header_util.o
$(WRF_SRC_ROOT_DIR)/frame/pack_utils.o

LIB_EXTERNAL =


LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL)
LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL)
ENVCOMPDEFS =
WRF_CHEM = 0
CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG)
NETCDFPATH =
PNETCDFPATH =

bundled: wrf_ioapi_includes wrfio_grib_share wrfio_grib1 wrfio_int esmf_time fftpack
external: $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a gen_comms_rsllite module_dm_rsllite $(ESMF_TARGET)

######################
externals: bundled external

gen_comms_serial :
( /bin/rm -f $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c )

module_dm_serial :
( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ; cat module_dm_stubs.F >> module_dm.F ; fi )

gen_comms_rsllite :
( if [ ! -e $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ] ; then
/bin/cp $(WRF_SRC_ROOT_DIR)/tools/gen_comms_warning $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ;
cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/gen_comms.c >> $(WRF_SRC_ROOT_DIR)/tools/gen_comms.c ; fi )

module_dm_rsllite :
( if [ ! -e module_dm.F ] ; then /bin/cp module_dm_warning module_dm.F ;
cat $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/module_dm.F >> module_dm.F ; fi )

wrfio_nf :
( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdf ;
make NETCDFPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)"
CC="$(SCC)" CFLAGS="$(CFLAGS)"
FC="$(SFC) $(PROMOTION) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

wrfio_pnf :
( cd $(WRF_SRC_ROOT_DIR)/external/io_pnetcdf ;
make NETCDFPATH="$(PNETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)"
FC="$(FC) $(PROMOTION) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

wrfio_grib_share :
( cd $(WRF_SRC_ROOT_DIR)/external/io_grib_share ;
make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)"
FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive)

wrfio_grib1 :
( cd $(WRF_SRC_ROOT_DIR)/external/io_grib1 ;
make CC="$(SCC)" CFLAGS="$(CFLAGS)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)"
FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" archive)

wrfio_grib2 :
( cd $(WRF_SRC_ROOT_DIR)/external/io_grib2 ;
make CC="$(SCC)" CFLAGS="$(CFLAGS) " RM="$(RM)" RANLIB="$(RANLIB)"
CPP="$(CPP)"
FC="$(SFC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="-traditional" AR="$(AR)" ARFLAGS="$(ARFLAGS)"
FIXED="$(FORMAT_FIXED)" archive)

wrfio_int :
( cd $(WRF_SRC_ROOT_DIR)/external/io_int ;
make CC="$(CC)" RM="$(RM)" RANLIB="$(RANLIB)" CPP="$(CPP)"
FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" FGREP="$(FGREP)"
TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ARCHFLAGS="$(ARCHFLAGS)" all )

esmf_time :
( cd $(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 ;
make FC="$(SFC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)"
CPP="$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc -I. $(ARCHFLAGS) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

fftpack :
( cd $(WRF_SRC_ROOT_DIR)/external/fftpack/fftpack5 ;
make FC="$(SFC)" FFLAGS="$(PROMOTION) $(FCDEBUG) $(FCBASEOPTS)" RANLIB="$(RANLIB)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

atm_ocn :
( cd $(WRF_SRC_ROOT_DIR)/external/atm_ocn ;
make CC="$(SCC)" CFLAGS="$(CFLAGS) " RM="$(RM)" RANLIB="$(RANLIB)"
CPP="$(CPP)"
FC="$(DM_FC) $(PROMOTION) -I. $(FCDEBUG) $(FCBASEOPTS) $(FCSUFFIX)" TRADFLAG="-traditional" AR="$(AR)" ARFLAGS="$(ARFLAGS)"
FIXED="$(FORMAT_FIXED)" )

$(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a :
( cd $(WRF_SRC_ROOT_DIR)/external/RSL_LITE ; make CC="$(CC) $(CFLAGS)"
FC="$(FC) $(FCFLAGS) $(PROMOTION) $(BYTESWAPIO)"
CPP="$(CPP) -I. $(ARCHFLAGS) $(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" ;
$(RANLIB) $(WRF_SRC_ROOT_DIR)/external/RSL_LITE/librsl_lite.a )

######################

Macros, these should be generic for all machines

LN = ln -sf
MAKE = make -i -r
RM = rm -f

\

These sub-directory builds are identical across all architectures

wrf_ioapi_includes :
( cd $(WRF_SRC_ROOT_DIR)/external/ioapi_share ;
$(MAKE) NATIVE_RWORDSIZE="$(NATIVE_RWORDSIZE)" RWORDSIZE="$(RWORDSIZE)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

wrfio_esmf :
( cd $(WRF_SRC_ROOT_DIR)/external/io_esmf ;
make FC="$(FC) $(PROMOTION) $(FCDEBUG) $(FCBASEOPTS) $(ESMF_MOD_INC)"
RANLIB="$(RANLIB)" CPP="$(CPP) $(POUND_DEF) " AR="$(AR)" ARFLAGS="$(ARFLAGS)" )

There is probably no reason to modify these rules

.F.i:
$(RM) $@
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $.F > $@
mv $
.i $(DEVTOP)/pick/$.f90
cp $
.F $(DEVTOP)/pick

.F.o:
$(RM) $@
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $.F > $.bb
$(SED_FTN) $.bb | $(CPP) > $.f90
$(RM) $.b $.bb
@ if echo $(ARCHFLAGS) | $(FGREP) ‘DVAR4D’; then
echo COMPILING $.F for 4DVAR ;
$(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $
.f90 > $.f90.tmp ;
mv $
.f90.tmp $.f90 ;
fi
if $(FGREP) ‘!$$OMP’ $
.f90 ; then
if [ -n “$(OMP)” ] ; then echo COMPILING $.F WITH OMP ; fi ;
$(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $
.f90 ;
else
if [ -n “$(OMP)” ] ; then echo COMPILING $.F WITHOUT OMP ; fi ;
$(FC) -o $@ -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $
.f90 ;
fi


.F.f90:
$(RM) $@
$(SED_FTN) $.F > $.b
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $.b > $@
$(RM) $
.b

.f90.o:
$(RM) $@
$(FC) -o $@ -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90

setfeenv.o : setfeenv.c
$(RM) $@
$(CCOMP) -o $@ -c $(CFLAGS) $(OMPCC) $*.c

.c.o:
$(RM) $@
$(CC) -o $@ -c $(CFLAGS) $*.c

A little more adventurous. Allow full opt on

mediation_integrate.o \

shift_domain_em.o \

solve_em.o <-- gets a little kick from SOLVE_EM_SPECIAL too, if defined

mediation_feedback_domain.o : mediation_feedback_domain.F

mediation_force_domain.o : mediation_force_domain.F

mediation_interp_domain.o : mediation_interp_domain.F

compile these without high optimization to speed compile

convert_nmm.o : convert_nmm.F
init_modules_em.o : init_modules_em.F
input_wrf.o : input_wrf.F
module_io.o : module_io.F
module_comm_dm.o : module_comm_dm.F
module_comm_dm_0.o : module_comm_dm_0.F
module_comm_dm_1.o : module_comm_dm_1.F
module_comm_dm_2.o : module_comm_dm_2.F
module_comm_dm_3.o : module_comm_dm_3.F
module_comm_nesting_dm.o : module_comm_nesting_dm.F
module_configure.o : module_configure.F
module_dm.o : module_dm.F
module_domain.o : module_domain.F
module_domain_type.o : module_domain_type.F
module_alloc_space_0.o : module_alloc_space_0.F
module_alloc_space_1.o : module_alloc_space_1.F
module_alloc_space_2.o : module_alloc_space_2.F
module_alloc_space_3.o : module_alloc_space_3.F
module_alloc_space_4.o : module_alloc_space_4.F
module_alloc_space_5.o : module_alloc_space_5.F
module_alloc_space_6.o : module_alloc_space_6.F
module_alloc_space_7.o : module_alloc_space_7.F
module_alloc_space_8.o : module_alloc_space_8.F
module_alloc_space_9.o : module_alloc_space_9.F
module_tiles.o : module_tiles.F
module_fddaobs_rtfdda.o : module_fddaobs_rtfdda.F
module_initialize.o : module_initialize.F
module_physics_init.o : module_physics_init.F
module_initialize_b_wave.o : module_initialize_b_wave.F
module_initialize_hill2d_x.o : module_initialize_hill2d_x.F
module_initialize_quarter_ss.o : module_initialize_quarter_ss.F
module_initialize_real.o : module_initialize_real.F
module_initialize_real.o: module_initialize_real.F
module_initialize_squall2d_x.o : module_initialize_squall2d_x.F
module_initialize_squall2d_y.o : module_initialize_squall2d_y.F
module_integrate.o : module_integrate.F
module_io_mm5.o : module_io_mm5.F
module_io_wrf.o : module_io_wrf.F
module_si_io.o : module_si_io.F
module_state_description.o : module_state_description.F
output_wrf.o : output_wrf.F
solve_interface.o : solve_interface.F
start_domain.o : start_domain.F
start_domain_nmm.o : start_domain_nmm.F
start_em.o : start_em.F
wrf_bdyin.o : wrf_bdyin.F
wrf_bdyout.o : wrf_bdyout.F
wrf_ext_read_field.o : wrf_ext_read_field.F
wrf_ext_write_field.o : wrf_ext_write_field.F
wrf_fddaobs_in.o : wrf_fddaobs_in.F
wrf_histin.o : wrf_histin.F
wrf_histout.o : wrf_histout.F
wrf_inputin.o : wrf_inputin.F
wrf_inputout.o : wrf_inputout.F
wrf_restartin.o : wrf_restartin.F
wrf_restartout.o : wrf_restartout.F
wrf_tsin.o : wrf_tsin.F
nl_get_0_routines.o : nl_get_0_routines.F
nl_get_1_routines.o : nl_get_1_routines.F
nl_set_0_routines.o : nl_set_0_routines.F
nl_set_1_routines.o : nl_set_1_routines.F

convert_nmm.o
init_modules_em.o
module_dm.o
module_fddaobs_rtfdda.o
module_initialize.o
module_initialize_b_wave.o
module_initialize_hill2d_x.o
module_initialize_quarter_ss.o
module_initialize_real.o
module_initialize_squall2d_x.o
module_initialize_squall2d_y.o
module_integrate.o
module_io_mm5.o
module_io_wrf.o
module_si_io.o
module_tiles.o
output_wrf.o
solve_interface.o
start_domain.o
start_domain_nmm.o
shift_domain_nmm.o
start_em.o
wrf_fddaobs_in.o
wrf_tsin.o :
$(RM) $@
$(SED_FTN) $.F > $.b
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $.b > $.f90
$(RM) $.b
@ if echo $(ARCHFLAGS) | $(FGREP) ‘DVAR4D’; then
echo COMPILING $
.F for 4DVAR ;
$(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $.f90 > $.f90.tmp ;
mv $.f90.tmp $.f90 ;
fi
if $(FGREP) ‘!$$OMP’ $.f90 ; then
if [ -n “$(OMP)” ] ; then echo COMPILING $
.F WITH OMP ; fi ;
$(FC) -c $(PROMOTION) $(FCNOOPT) $(FCBASEOPTS) $(MODULE_DIRS) $(FCSUFFIX) $(OMP) $.f90 ;
else
if [ -n “$(OMP)” ] ; then echo COMPILING $
.F WITHOUT OMP ; fi ;
$(FC) -c $(PROMOTION) $(FCNOOPT) $(FCBASEOPTS) $(MODULE_DIRS) $(FCSUFFIX) $*.f90 ;
fi

#solve_em.o :

$(RM) $@

$(SED_FTN) $.F > $.b

$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $.b > $.f90

$(RM) $*.b

$(FC) -o $@ -c $(FCFLAGS) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $(SOLVE_EM_SPECIAL) $(OMP) $*.f90

module_sf_ruclsm.o : module_sf_ruclsm.F

module_sf_ruclsm.o :
$(RM) $@
$(SED_FTN) $.F > $.b
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $.b > $.f90
$(RM) $.b
if $(FGREP) ‘!$$OMP’ $
.f90 ; then
echo COMPILING $.F WITH OMP ;
if [ -n “$(OMP)” ] ; then echo COMPILING $
.F WITH OMP ; fi ;
$(FC) -c $(PROMOTION) $(FCREDUCEDOPT) $(FCBASEOPTS) $(MODULE_DIRS) $(FCSUFFIX) $(OMP) $.f90 ;
else
if [ -n “$(OMP)” ] ; then echo COMPILING $
.F WITHOUT OMP ; fi ;
$(FC) -c $(PROMOTION) $(FCREDUCEDOPT) $(FCBASEOPTS) $(MODULE_DIRS) $(FCSUFFIX) $*.f90 ;
fi

compile without OMP

input_wrf.o
module_domain.o
module_domain_type.o
module_physics_init.o
module_io.o
wrf_bdyin.o
wrf_bdyout.o
wrf_ext_read_field.o
wrf_ext_write_field.o
wrf_histin.o
wrf_histout.o
wrf_inputin.o
wrf_inputout.o
wrf_restartin.o
wrf_restartout.o
module_state_description.o
module_alloc_space.o
module_alloc_space_0.o
module_alloc_space_1.o
module_alloc_space_2.o
module_alloc_space_3.o
module_alloc_space_4.o
module_alloc_space_5.o
module_alloc_space_6.o
module_alloc_space_7.o
module_alloc_space_8.o
module_alloc_space_9.o
module_comm_dm.o
module_comm_dm_0.o
module_comm_dm_1.o
module_comm_dm_2.o
module_comm_dm_3.o
module_comm_nesting_dm.o
module_configure.o :
$(RM) $@
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $.F > $.bb
$(SED_FTN) $.bb | $(CPP) > $.f90
@ if echo $(ARCHFLAGS) | $(FGREP) ‘DVAR4D’; then
echo COMPILING $.F for 4DVAR ;
$(WRF_SRC_ROOT_DIR)/var/build/da_name_space.pl $
.f90 > $.f90.tmp ;
mv $
.f90.tmp $.f90 ;
fi
$(RM) $
.b $.bb
$(FC) -c $(PROMOTION) $(FCSUFFIX) $(FCNOOPT) $(FCBASEOPTS) $(MODULE_DIRS) $
.f90

i’ve got os 10.8.5, xcode 4.6.3, and pgi 13.10-0. i’ve gotten fortran programs to compile ok, but no c programs yet - i get the same errors as the original poster of this thread. is there a version of xcode that works with pgi 13.10 and os 10.8.5? xcode is the only part of this system i have any control over.

thanks.

Hi Nancy,

After you upgraded your system and Xcode, did you reinstall PGI 13.10?

We have tested on the exact the same system configuration: Xcode version 4.6.3 and OS 10.8.5 here and it works fine with WRFV3 when compiling with pgcc.

Does a simple “hello world” program work?

#include <stdio.h>
int main()
{
printf(“Hello\n”);
}
  • Mat

hi mat,

without any settings, i can’t compile anything that uses stdio.h. i get:

pgcc hello.c -o hello
PGC-S-0040-Illegal use of symbol, __BEGIN_DECLS (/usr/include/stdio.h: 164)
PGC-S-0035-Syntax error: Recovery attempted by replacing identifier __BEGIN_DECLS by ‘;’ (/usr/include/stdio.h: 238)
PGC-W-0156-Type not specified, ‘int’ assumed (/usr/include/stdio.h: 238)
PGC-S-0036-Syntax error: Recovery attempted by inserting keyword typeof before ‘(’ (/usr/include/stdio.h: 250)

< lots of error lines trimmed - full set is in the first post of this thread>

PGC/x86-64 OSX 13.10-0: compilation aborted

however, this works:

pgcc -I/opt/pgi/osx86-64/13.10/include-osx86-64-108 hello.c -o hello

i’ve set PGI to /opt/pgi, which is where it’s installed. shouldn’t it find the include files on it’s own? i see it’s the replacement sys/cdefs.h that seems to be critical.

n.

hi -

i was a bit hasty in my last post. this is actually what i had to do in order to both compile and link hello world:

pgcc hello.c -I/opt/pgi/osx86-64/13.10/include-osx86-64-108 -tp=nehalem -L/opt/local/lib/gcc48/gcc/x86_64-apple-darwin12/4.8.2 -o hello

without the -I flag i get complaints about __BEGIN_DECLS being unrecognized in stdio.h, as the original poster of this thread said.

without the -L flag it can’t find the gcc lib. i used macports to install both gcc 4.7 and 4.8 because i needed to test some other software - but i’ve used port-select to make 4.8 the current version of the gnu tools and both gcc and gfortran work fine for me.

without the -tp flag i get copious complaints:

no such instruction: `vzeroupper’

even though i’m running on a relatively new mac air which i believe has a sandy bridge chip (about this mac says ‘1.7 GHz Intel Core i7’). i looked around in other discussion posts and the recommendation was that this depended on the assembler that comes with xcode and to wait for a later version. but i’m at the most current version of xcode (4.6.3) for my os (10.8) so i tell it i’ve got a nehalem and then it links.

i’m trying to build both netcdf and openmpi with this compiler. by adding the -I and -L flags i got a lot further, but the netcdf fortran lib failed because it was unable to find ‘float.h’ so i’m going to go see what that’s about.

n.

Hi Nancy,

You shouldn’t need to do all this. Engineering is requesting the following information:

  1. Can she send us her localrc file? She should not need to use –I… include-osx86-64-108 at all.
  2. I would also like to see the output of: gcc –print-search-dirs
  3. Did she install the Xcode command line tools for Xcode 4.6.3? It is a separately package and she needs to make sure to get the command line tools version according to her Xcode version.

Though, I’m thinking it might be better to take this off line since there might be some back and forth. Please send the above information to PGI Customer Service (trs@pgroup.com) and ask them to forward it to me.

Thanks,
Mat

hi mat -

i’d be happy to send you the info engineering requested. thanks for your help on this.

n.

after some email exchanges with user support, they sent me a ‘localrc’ file which i copied to /opt/pgi/osx86-64/13.10/bin. there wasn’t one there before, just a ‘localrc.error’ which didn’t really contain any error information. now i’m able to use the compiler, so thank you!