An error when I do the test case of upwelling

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
fengfengsister
Posts: 14
Joined: Fri Sep 25, 2009 12:19 am
Location: Xiamen University

An error when I do the test case of upwelling

#1 Unread post by fengfengsister »

Hi,I am a beginner, and at first I do the test case of upwelling on my own PC with Linux operating system, after I run "./build.bash", I get the following error which I translate from Chinese:

f951: error: cannot identify "-fno-strict-overflow"
make: ***[/home/roms/projects/upwelling/Build/ran_state.o] error 1

Does anybody know what is the problem? Thank you in advance.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: An error when I do the test case of upwelling

#2 Unread post by kate »

What compiler did you ask for with the FORT variable? It is telling you that that compiler does not know of the -fno-strict-overflow option which is coming from one of the gfortran files in the Compilers directory. Did you ask for gfortran or does your gfortran not recognize that option? What version do you have? You can ask it "gfortran --version" to get that information.

fengfengsister
Posts: 14
Joined: Fri Sep 25, 2009 12:19 am
Location: Xiamen University

Re: An error when I do the test case of upwelling

#3 Unread post by fengfengsister »

kate wrote:What compiler did you ask for with the FORT variable? It is telling you that that compiler does not know of the -fno-strict-overflow option which is coming from one of the gfortran files in the Compilers directory. Did you ask for gfortran or does your gfortran not recognize that option? What version do you have? You can ask it "gfortran --version" to get that information.
I am very happy to get your reply Kate, and thank you very much. I've installed gcc_2012-02-29 and I have already use it in a simple .f90 program that I wrote.In the file of build.bash I set FORT=gfortran. I don't know whether "my gfortran recognize that option" or not. And after I implement "gfortran --version", it is coming out the following infomation:
GNU Fortran (GCC) 4.1.2 20080704 (Red hat 4.1.2-46)
Copyright(C) 2007 Free Software Foundation. Inc.

So Kate do you know where the problem is? Look forward to hearing from you again,thank you.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: An error when I do the test case of upwelling

#4 Unread post by kate »

I was going to suggest that you try compiling your simple test with that option, but I tried it first:

Code: Select all

delta.arsc.edu 291% gfortran -fno-strict-overflow testio.f
f951: error: unrecognized command line option "-fno-strict-overflow"
delta.arsc.edu 292% gfortran --version
GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
Copyright (C) 2007 Free Software Foundation, Inc.
I get the same trouble you do with ROMS. Next is to look in Compilers/Linux-gfortran.mk:

Code: Select all

#
# Allow integer overflow in ran_state.F.  This is not allowed
# during -O3 optimization. This option should be applied only for
# Gfortran versions >= 4.2.
#

FC_TEST := $(findstring $(shell ${FC} --version | head -1 | cut -d " " -f 5 | \
                              cut -d "." -f 1-2),4.0 4.1)

ifeq "${FC_TEST}" ""
$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
endif
Simplest would be to comment out the last three lines here:

Code: Select all

#ifeq "${FC_TEST}" ""
#$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
#endif
Otherwise, you could fix the shell script test with the cut statements.

Edit: the fix is simple: change -f 5 to -f 4:

Code: Select all

FC_TEST := $(findstring $(shell ${FC} --version | head -1 | cut -d " " -f 4 | \
                              cut -d "." -f 1-2),4.0 4.1)

fengfengsister
Posts: 14
Joined: Fri Sep 25, 2009 12:19 am
Location: Xiamen University

Re: An error when I do the test case of upwelling

#5 Unread post by fengfengsister »

kate wrote:I was going to suggest that you try compiling your simple test with that option, but I tried it first:

Code: Select all

delta.arsc.edu 291% gfortran -fno-strict-overflow testio.f
f951: error: unrecognized command line option "-fno-strict-overflow"
delta.arsc.edu 292% gfortran --version
GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
Copyright (C) 2007 Free Software Foundation, Inc.
I get the same trouble you do with ROMS. Next is to look in Compilers/Linux-gfortran.mk:

Code: Select all

#
# Allow integer overflow in ran_state.F.  This is not allowed
# during -O3 optimization. This option should be applied only for
# Gfortran versions >= 4.2.
#

FC_TEST := $(findstring $(shell ${FC} --version | head -1 | cut -d " " -f 5 | \
                              cut -d "." -f 1-2),4.0 4.1)

ifeq "${FC_TEST}" ""
$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
endif
Simplest would be to comment out the last three lines here:

Code: Select all

#ifeq "${FC_TEST}" ""
#$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
#endif
Otherwise, you could fix the shell script test with the cut statements.

Edit: the fix is simple: change -f 5 to -f 4:

Code: Select all

FC_TEST := $(findstring $(shell ${FC} --version | head -1 | cut -d " " -f 4 | \
                              cut -d "." -f 1-2),4.0 4.1)

I get it.Thank you so much Kate.

Post Reply