Undefined reference to flush during compilation

Frequently Asked Questions about ROMS usage

Moderators: arango, kate, robertson

Post Reply

Undefined reference to flush during compilation

#1 Unread post by Guest »

I'm a first-time ROMS 2.1 user. My computer system is a 2-cpu AMD Athlon Linux box and the compiler is absoft fortran 90. I already installed the NetCDF 3.5 library. However when I compiled with Makefile.absoft, I get the following error:

Code: Select all

ranlib libocean.a
f90 -cpu:athlon -O3 -w -M11 -YEXT_NAMES=LCS -YEXT_SFX=_ -YCFRL=1 -O3 -I/usr/local/netcdf-3.5.0/include  -o /home/roms-2.1/oceanS libocean.a /usr/local/netcdf-3.5.0/lib/libnetcdf.a 
libocean.a(mp_routines.o): In function `my_flush_':
mp_routines.o(.text+0x91): undefined reference to `flush_' 
Can you tell me how to solve this error?

User avatar
Site Admin
Posts: 1337
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University

#2 Unread post by arango »

The routine flush is a standard Unix routine that flushes any output that has been buffered. The name of this routine may change in different Unix operating systems. ROMS/TOMS has its own flush routine, my_flush, which is declared in mp_routines.F, to allow easy change to other routines names with identical functionality.

Notice that whole pupose of the file mp_routines.F is to provide an interface for all kinds of standard Unix routines that may change their name across operating systems. For example, the function to get arguments from the comand-line is getarg in mostly all Unix systems but on the Cray is pxfgetarg. Similar construction is possible for the flush routine. Already, there is a construction for AIX systems where the routine name is flush_ instead.

You need to look the appropiate name for this routine in your operating system and provide the CPP structure in my_flush (file mp_routines.F). Notice that each computer has it own environmental name flag. Use this name in the #if CPP structure. I usually put this name in the Makefile CPPFLAGS macro. If there is not a flush routine in you system, you can leave this entry blank so nothing is done to flush the output buffer.

Good luck, :)

Post Reply