about f951: error: unrecognized command line option

Hello,

I am attempting to make a makefile on an ubuntu 10.04 system (64 bit), but I have some error message as following:

on the other hand, I have install PGI 11.9, mpich2, netcdf, parallel-netcdf …

makefile:
CPP = cpp -P
FC = mpif90
LD = mpif90
CLEAN = rm

Set libraries and include files

NETCDFINC = -I/usr/local/parallel-netcdf/include
NETCDFLIB = -L/usr/local/parallel-netcdf/lib
FFLAGS = -i4 -r4 $(NETCDFINC)
FFLAGA = $(NETCDFINC)
LIBS = $(NETCDFLIB) -lpnetcdf

BIN = test.exe
SRCDIR = mode

#-----------------------------------------------------------------------

Define objects

#-----------------------------------------------------------------------
OBJS = parallel_mpi.o
io_pnetcdf.o
solver.o \

VPATH = $(SRCDIR)

#-----------------------------------------------------------------------

Set implicit rules for compilation

#-----------------------------------------------------------------------
%.o: %.f
@echo
$(FC) -c $(FFLAGS) $<

#-----------------------------------------------------------------------

Set implicit rules for dependencies

#-----------------------------------------------------------------------
%.f: %.F
@echo
$(CPP) $(FFLAGS) $< > $*.f

#-----------------------------------------------------------------------

Create the executable

#-----------------------------------------------------------------------
$(BIN): $(OBJS)
@echo
$(LD) $(FFLAGS) -o $(BIN) $(OBJS) $(LIBS)

#-----------------------------------------------------------------------

Cleaning target

#-----------------------------------------------------------------------
clean:
@rm -f *.o *.mod


This is when trying to run
$ make

But to no avail…producing the same errors:
mpif90 -c -i4 -r4 -I/usr/local/parallel-netcdf/include /parallel_mpi.f
gfortran: unrecognized option ‘-r4’
f951: error: unrecognized command line option “-i4”
make: *** [parallel_mpi.o] Error 1

any advice and suggestions ?

Hi hou1375,

These errors are coming from gfortran since the GNU Fortran compiler doesn’t recognize the “-r4 -i4” command line options.

You will either need to use gfortran command line options or use a MPICH2 configured for use with PGI.

PGI does ship a debug version MPICH2 which is optionally installed under the “$PGI/linux86-64/2011/” directory. Alternatively you can build your own MPICH2. The following link provides instructions: Account Login | PGI.

Hope this helps,
Mat

Hi Mat,

Thank you for your prompt reply.

I changed MPICH2 path and reinstall PGI, but I still have this error

Maybe I miss anything?

Are you downloading mpich2, netcdf, etc, from newer PGI releases?

That probably won’t work, and we certainly are not going to try to make a
5 year old release work with current netcdf libs and mpi packages.
netcdf may work, or it may have instructions that the 11.9 compilers
did not support because the cpus did not exist in 2011.

mpi drivers like mpif90 are built for specific versions of Fortran, C, and C++,
and are not generic, where you can add links to mpi libs and headers at
runtime and everything plays together perfectly.

If you try to use a modfile from a 2016 PGI release with a 2011 compiler,
11.9 may fail to fully read the newer modfile. So do not use modfiles in your mpi code.

Reinstalling only helps if you are installing the mpi that came with 11.9.
For mpich versions you want but we never built, you may need to build them with your current compilers.

See

dave