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.
An error when I do the test case of upwelling
-
- Posts: 14
- Joined: Fri Sep 25, 2009 12:19 am
- Location: Xiamen University
Re: An error when I do the test case of upwelling
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.
-
- Posts: 14
- Joined: Fri Sep 25, 2009 12:19 am
- Location: Xiamen University
Re: An error when I do the test case of upwelling
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: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.
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.
Re: An error when I do the test case of upwelling
I was going to suggest that you try compiling your simple test with that option, but I tried it first:
I get the same trouble you do with ROMS. Next is to look in Compilers/Linux-gfortran.mk:
Simplest would be to comment out the last three lines here:
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
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.
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
Code: Select all
#ifeq "${FC_TEST}" ""
#$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow
#endif
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)
-
- Posts: 14
- Joined: Fri Sep 25, 2009 12:19 am
- Location: Xiamen University
Re: An error when I do the test case of upwelling
kate wrote:I was going to suggest that you try compiling your simple test with that option, but I tried it first:I get the same trouble you do with ROMS. Next is to look in Compilers/Linux-gfortran.mk: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.
Simplest would be to comment out the last three lines here: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
Otherwise, you could fix the shell script test with the cut statements.Code: Select all
#ifeq "${FC_TEST}" "" #$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow #endif
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.