f90main.o error

Hi folks,

I am having trouble trying to compile my LES code with netcdf and MPI on a Linux cluster. I wonder if anyones has any insight into the error message below. Thanks for your time, Cheers,

Craig Smith
College of Oceanic and Atmospheric Science, Oregon State University
csmith@coas.oregonstate.edu


Error message

/usr/pgi/linux86/bin/pgf90 -o alem1920x250_400w *.o -L/usr/pgi/linux86/6.0/lib -lpgf90 -L/usr/local/mpich/lib -lmpich -L/usr/local/netcdf/lib -lnetcdf -L/home/csmith/fftw-3.1.2/.libs -lfftw3 -I/usr/local/netcdf/include -I/usr/local/mpich/include
/usr/pgi/linux86/6.0/lib/f90main.o: In function main': /usr/pgi/linux86/6.0/lib/f90main.o(.text+0x77): undefined reference to MAIN_’
make: *** [olem] Error 2



\


Makefile

CPP=/usr/bin/cpp
FC=/usr/pgi/linux86/bin/pgf90

FC=/home/gerrits/.mpich/bin/mpif90

FC=/home/gerrits/.mpich/bin/mpif77

set model compilation options (lines should be <= 60 chars)

MODFLAGS1= -DUVWFLUX -DLEER -DCONRES

old flag uses mpi

MODFLAGS2= -DSNGLSALT -DANALY -DUSEMPI

MODFLAGS2= -DSNGLSALT -DANALY

MODFLAGS3 = -DBOTTOM -DRADIATE

MODFLAGS3= -DHBOT -DOPENBC -DOPENR

MODFLAGS3= -DHBOT -DOPENBC -DOPENR -DRECIRC

set fortran compilation options

ROOT_DIR=/usr/local

FFLAGS= -u -C -g -qstrict -bmaxdata:2000000000 -bmaxstack:256000000 -q32

old flags

FFLAGS= -u -O2 -qstrict -bmaxdata:2000000000 -bmaxstack:256000000 -q32

comflo flags

FFLAGS= --o2 --dbl --staticlink

FFLAGS= -u -fast -01

FFLAGS= -u

FFLAGS=

MODFLAGS4=$(FFLAGS)

LIBS=

LIBS= -L/usr/pgi/linux86/6.0/lib -lpgf90 -L$(ROOT_DIR)/mpich/lib -lmpich -L$(ROOT_DIR)/netcdf/lib -lnetcdf -L/home/csmith/fftw-3.1.2/.libs -lfftw3 -I$(ROOT_DIR)/netcdf/include -I$(ROOT_DIR)/mpich/include

LNFLAGS=
CPPFLAGS= $(MODFLAGS1) $(MODFLAGS2) $(MODFLAGS3) -I$(ROOT_DIR)/netcdf/include -I$(ROOT_DIR)/mpich/include

SOURCES = bcinit.F bc_read.F bc_update.F cycelim.F conres.F dag_create.F
dag_write.F date.F deardorff.F deltime.F density.F
denupdte.F filter.F filtlap.F fld_create.F flt_upmpi.F
flt_create.F flt_read.F flt_wrtmpi.F fmetais.F
hostnme.F ic_read.F icemod.F icinit.F ies80.F imag2p.F imag2.F
image.F in_read.F indexx.F initrad.F intg.F
leerdan.F leernew.F leerdp.F lnblk.F
loop3dan.F mks.F myhandler.F olem_init.F obcmom.F obcscal.F
parse.F poisson.F ran2.F restart.F
sig_handler.F slb_create.F
slb_write.F smag.F topbotbn.F topbotdp.F unix.F
upper.F uvwenst.F volbotpr.F varcde.F wrparm.F zmixed.F

MPI_SOURCES = global.F iompi.F setupmpi.F shifts.F

ALL_SOURCES = $(SOURCES) $(MPI_SOURCES)

OBJECTS= $(ALL_SOURCES:.F=.o)

olem: info $(OBJECTS)
$(FC) $(LNFLAGS) $(FFLAGS) -o alem1920x250_400w *.o $(LIBS)

olem.o: olem.F
@sed -e “s;MODEL_FLAGS1;$(MODFLAGS1);” olem.F |
sed -e “s;MODEL_FLAGS2;$(MODFLAGS2);” |
sed -e “s;MODEL_FLAGS3;$(MODFLAGS3);” |
sed -e “s;MODEL_FLAGS4;$(MODFLAGS4);” > foo.F
$(FC) $(FFLAGS) $(CPPFLAGS) -c foo.F
@mv foo.o olem.o

\

Hi Craig,

This error occurs when your application is missing a “main” program. Since you’re using “*.o” to link, perhaps not all the object were built?

  • Mat