Error while compiling ROMS - gfortran

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
KamilaWisniewska
Posts: 8
Joined: Tue Feb 01, 2011 7:04 pm
Location: LMAR, Hunter College, CUNY

Error while compiling ROMS - gfortran

#1 Unread post by KamilaWisniewska »

Hello Everyone,

I am trying to compile ROMS and since my netCDF4 was built with gfortran i tried to use it to compile ROMS, but I get the following error. Dose anyone has any idea how to solve this?

exchange_2d.f90: In function 'exchange_v2d_tile':
exchange_2d.f90:217: internal compiler error: Segmentation fault

Platform: Linux Red Hat 5
NetCDF v : 4.1.1

Since ROMS should be compiled with the same compiler that was used to built netCDF libraries i would like to ask if there is any specific disadvantage to using gfortran instead of ifort?

The error message is also attached.

Thank you,
Kamila Wisniewska
Attachments
Roms_gfortran_error.txt
(10.02 KiB) Downloaded 290 times

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Error while compiling ROMS - gfortran

#2 Unread post by m.hadfield »

The only significant disadvantage in using GFortran instead of Intel Fortran, in my opinion, is in the area of run-time performance, rather than ability to compile the code. I regularly use Gfortran, amongst other compilers. I have run into problems & glitches with all of them, but I wouldn't say Gfortran is particularly troublesome.

Your compiler problem is possibly triggered by something wrong with the code that's been produced by the preprocessor, so your first step should be to look at line 217 of exchange_2d.f90. (That said, a compiler should never crash on bad code, and the fact that it has indicates a bug.)

I note that the options "-g -fbounds-check" are being passed to the compiler, which means you are defining the macro USE_DEBUG in the make file. What happens if you disable this?

What version of gfortran are you using by the way? You can establish this with the command

Code: Select all

/usr/local/bin/gfortran -v
Perhaps you have an old version. I am using 4.1.2 (Jan 2007) and 4.3.4 (Aug 2009) regularly.

KamilaWisniewska
Posts: 8
Joined: Tue Feb 01, 2011 7:04 pm
Location: LMAR, Hunter College, CUNY

Re: Error while compiling ROMS - gfortran

#3 Unread post by KamilaWisniewska »

Hi,

Thank you for the response.

The gfortran version installed on my machine is gcc version 4.0.0 20041201 (experimental).
I'll try to compile it without USE_DEBUG and update the gfortran compiler.

Kamila

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: Error while compiling ROMS - gfortran

#4 Unread post by m.hadfield »

KamilaWisniewska wrote:Hi,

Thank you for the response.

The gfortran version installed on my machine is gcc version 4.0.0 20041201 (experimental).
I'll try to compile it without USE_DEBUG and update the gfortran compiler.

Kamila
That's old. I'm sure that's the problem. According to my records, Gfortran wouldn't compile ROMS 2.x/3.x successfully until some time in late 2005. Don't bother fiddling with USE_DEBUG.

Updating the Gfortran compiler to anything recent will require rebuilding the netCDF library, as there have been a few changes in the Fortran 90 module (.mod) file format since 2004. So if you're considering trying Intel Fortran, then your path of least resistance might be to use that and build netCDF with it. And it generates faster code. Your call.

But I can reassure you that recent versions of Gfortran can generally be used to build ROMS with no dramas.

Post Reply