Intel Compiler, Red Hat Linux, and ROMS/TOMS 2.1 Makefile

Frequently Asked Questions about ROMS usage

Moderators: arango, kate, robertson

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

Intel Compiler, Red Hat Linux, and ROMS/TOMS 2.1 Makefile

#1 Unread post by arango »

Seems that some users continue having problems with the Intel compiler (ifc and/or ifort), Red Hat Linux, and ROMS/TOMS 2.1 Makefile. I have never been able to reproduce the reported problem which is more acute with our users in Asia. This is not a ROMS/TOMS problem but a problem with the compiler when libraries are used. Recall that in version 2.1, the Makefile rules were changed from objects to a library structure to allow full coupling between ocean and atmospheric models. Currently, we can couple ROMS and WRF via the master program: master.F. We also use this master program to run the ocean model only.

The undefined reference to MAIN__ has been resolved in newer versions of the Intel compiler. You perhaps need to update your Intel compiler. Alternatively, you can fix your compilation problem by adding an object file (say, master.o) to the compilation rule in the Makefile. That is,

Code: Select all

$(BIN):	$(MYLIB)
          $(LDR) $(FFLAGS) $(LDFLAGS) -o $(BIN) master.o $(MYLIB) $(LIBS)
This should fix the problem. There is a redundancy here in the specification of the object master.o explicitly and by the ROMS library MYLIB, but it really does not matter. Many thanks to Rob Hetland for suggesting this simple and temporary fix.

Good luck, :)

Posts: 4
Joined: Mon Apr 26, 2004 3:50 pm
Location: HKUST

another way to deal with 'undefined MAIN_' error

#2 Unread post by Jingcs »

Use the makefile.ifort to compile the model, the error 'undefined for_main' will appear. Hernan supplied one way to solve this problem, here provides another way to deal with it.
Change the FFLAGS in file Makefile.ifort to

Code: Select all

 FFLAGS = -ip -03 -nofor_main -tpp7 -xW 
try it.

Posts: 6
Joined: Mon Aug 09, 2004 1:54 am
Location: New York University Abu Dhabi

ROMS2.1 in Linux cluster with mpich

#3 Unread post by praveen »

hi ROMS users,

I succesfully compiled ROMS2.1 in linux cluster with ifort and MPICH libraries. :lol:

Thanks for the suggestions :)

Post Reply