Do you have any guides for compiling the Navy’s COAMPS mesoscale met model using PGI on a single processor Linux box?
Unfortunately we don’t have the source. Can you point us to the source? Is it open source?
The code is available to the public after registering at the following site:
I got it to build. I don’t know about running it, though, that seems pretty complicated. Here is what I did:
The code comes with pretty good instructions for building it with PGI compilers. They do seem a little bit out of date, though. And they are building for 32 bit architectures, using the -tp p6 flag. So, that is the first thing to look out for. I would suggest you set your path to the PGI compilers external to this build procedure.
The other thing to look out for is hardcoded paths to mpi libraries and
include files. In our 7.1 Workstation product, we ship a version of MPICH1 which I am using here. But your paths will have to change according to your setup.
I edited config.user to look like this:
to run single precision, uncomment below
PGI_SINGLE = -DSINGLE
PGI_DOUBLE = -Mr8
PGI_PRECISION = $(PGI_SINGLE)
#PGI_PRECISION = $(PGI_DOUBLE)
PGI_FFLAGSM = -fastsse $(PGI_PRECISION) -byteswapio -DPGF -DLINUX -DDTGNL
PGI_FFLAGSA = -fastsse $(PGI_PRECISION) -byteswapio -DPGF -DLINUX -DDTGNL
PGI_FFLAGS_OI = -fastsse $(PGI_PRECISION) -DPGF -DLINUX -DDTGNL
PGI_FFLAGSM = -g -tp p6 $(PGI_PRECISION) -byteswapio -DPGF -DLINUX
PGI_FFLAGSA = -g -tp p6 $(PGI_PRECISION) -byteswapio -DPGF -DLINUX
PGI_FFLAGS_OI = -g -tp p6 $(PGI_PRECISION) -DPGF -DLINUX
Note: MPI_INCLUDE_DIR is the directory where the mpif.h and mpiof.h files
reside. For MPICH this will be PGI_MPI_HOME, and for LAM this will be the
coamps3 include directory.
To switch from LAM to MPICH you need to do three things, uncomment the
appropriate lines for PGI_MPI_INCLUDE_DIR and EXTRALIBS. Also fill in the
correct values for PGI_MPI_HOME and PGI_COMP_HOME for your installation.
With MPICH, uncomment this
With LAM, uncomment and edit this:
"FFLAGSM= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGSA= $(PGI_FFLAGSA) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGS_OI= $(PGI_FFLAGS_OI) -I$(PGI_MPI_INCLUDE_DIR) "
“FFLAGSC= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) -D_OPENMP”
"FFLAGSG= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
"FFLAGSO= $(PGI_FFLAGSM) -I$(PGI_MPI_INCLUDE_DIR) "
“CFLAGS= -O1 -DLINUX -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE”
"LDFLAGS= -Bstatic "
“EXTRALIBS= -L$(PGI_MPI_HOME)/lib -lmpichf90 -lmpich -lacml”
Note that I have simplified the compiler names, removed some libraries that are unnecessary when using pgf90 to link, and changed the blas libraries to use acml instead.
Using these changes, it seemed to build correctly for me by typing