Build Error

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
okami_zxh

Build Error

#1 Unread post by okami_zxh »

Hi All
It seems that I compile ROMS with error about FLAGS with gfortran, the error is as below:

Code: Select all

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?

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

Re: Build Error

#2 Unread post by kate »

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: Select all

$(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: Select all

           FFLAGS := -frepack-arrays
then

Code: Select all

           FFLAGS += -O3 -ffast-math
and so on. There should be no newlines in it.

okami_zxh

Re: Build Error

#3 Unread post by okami_zxh »

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: Select all

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]

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

Re: Build Error

#4 Unread post by kate »

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:
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:
$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form
but
$(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).

okami_zxh

Re: Build Error

#5 Unread post by okami_zxh »

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: Select all

$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form
to

Code: Select all

$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form -ffree-line-length-none
Xiaohui

Post Reply