Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Thu Nov 23, 2017 4:59 pm




Post new topic Reply to topic  [ 5 posts ] 

All times are UTC

Author Message
 Post subject: Build Error
PostPosted: Tue Sep 12, 2017 4:35 pm 
Offline

Joined: Fri Jan 20, 2017 5:29 pm
Posts: 37
Location: Graduate School of Oceanography,URI
Hi All
It seems that I compile ROMS with error about FLAGS with gfortran, the error is as below:
Code:
ROMS/Bin/cpp_clean Build/mod_strings.f90
cd ./Build; /opt/openmpi/bin/mpif90 -c -frepack-arrays -g -fbounds-check -I/home/zhou/COAWST/install/include -I/usr/include -ffree-form mod_strings.f90
mod_strings.f90:165.43:

        character (len=160) :: my_fflags = "-frepack-arrays -g -fbounds-check -
                                           1
Error: Unterminated character constant beginning at (1)
mod_strings.f90:165.132:

ys -g -fbounds-check -I/home/zhou/COAWST/install/include -I/usr/include -ff
                                                                           1                                                         
Warning: Line truncated at (1)
make: *** [Build/mod_strings.o] Error 1

Did anyone know how to solve it?


Top
 Profile  
Reply with quote  
 Post subject: Re: Build Error
PostPosted: Tue Sep 12, 2017 4:56 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3254
Location: IMS/UAF, USA
The file mod_strings.F contains "character (len=160) :: my_fflags = MY_FFLAGS" and it is counting on the environment variable MY_FFLAGS being substituted by this part of the makefile:
Code:
$(SCRATCH_DIR)/mod_strings.f90: CPPFLAGS += -DMY_OS='"$(OS)"' \
              -DMY_CPU='"$(CPU)"' -DMY_FORT='"$(FORT)"' \
              -DMY_FC='"$(FC)"' -DMY_FFLAGS='"$(FFLAGS)"'
It looks like FFLAGS string has been corrupted - it is coming from your file in Compilers. For me, Linux-gfortran.mk contains:
Code:
           FFLAGS := -frepack-arrays
then
Code:
           FFLAGS += -O3 -ffast-math
and so on. There should be no newlines in it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Build Error
PostPosted: Tue Sep 12, 2017 5:32 pm 
Offline

Joined: Fri Jan 20, 2017 5:29 pm
Posts: 37
Location: Graduate School of Oceanography,URI
Hi Kate,
I modified the Linux-gfortran.mk file. But it did not work. The same error still occurred, My Linux-gfortran.mk file contains the FFLAGS as:
[code]ifdef USE_OpenMP
CPPFLAGS += -D_OPENMP
FFLAGS += -fopenmp
endif

ifdef USE_DEBUG
FFLAGS += -g -fbounds-check
CFLAGS += -g
CXXFLAGS += -g
else
FFLAGS += -O3 -ffast-match
FFLAGS += -ftree-vectorize -ftree-loop-linear -funroll-loops -w -ffree-form -ffree-line-length-none -frecord-marker=4 -fconvert=big-endian
## -fconvert=big-endian
endif
/code]


Top
 Profile  
Reply with quote  
 Post subject: Re: Build Error
PostPosted: Tue Sep 12, 2017 5:53 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3254
Location: IMS/UAF, USA
So your debug flags are short compared to your optimize flags. You might run off the end of the 160 character limit for that string. It looks like I increased the size of it on a branch at some point:
Quote:
character (len=512) :: my_fflags = "-heap-arrays -fp-model precise -g -check uninit -ftrapuv -traceback -check bounds -fpe0 -free -free"
You might need not only:
Quote:
$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form
but
Quote:
$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form -ffree-line-length-none

Anyway, look at the file in your build directory to see exactly what's there (see my my_fflags above).


Top
 Profile  
Reply with quote  
 Post subject: Re: Build Error
PostPosted: Wed Sep 13, 2017 1:59 am 
Offline

Joined: Fri Jan 20, 2017 5:29 pm
Posts: 37
Location: Graduate School of Oceanography,URI
Hi Kate
Thank you so much. I fixed this problem with your help. What I did is modified Compilers/Linux-gfortran.mk (170.1)
Code:
$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form
to
Code:
$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form -ffree-line-length-none

Xiaohui


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group