Compiling problems (netcdf?)

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
nrecord
Posts: 11
Joined: Thu May 27, 2010 3:19 pm
Location: University of Maine

Compiling problems (netcdf?)

#1 Unread post by nrecord »

Hi, maybe someone can help me getting ROMS (Upwelling example) to compile. I think it's a problem with netcdf. I've been following the tutorial on the roms site (Tutorial: Installing ROMS on a Macintosh). Here's the error I get trying to compile:

mod_netcdf.f90:19.16:

USE netcdf
1
Fatal Error: Wrong module version '4' (expected '5') for file 'netcdf.mod' opened at (1)


I've also tried netcdf-4.1.1, with the HDF5 turned off. I make it past the error above, but I run into problems later in the compile, with and error that says:

Undefined symbols:
(then it lists a page or so of stuff referencing libnetcdf.a)
ld: symbol(s) not found
collect2: ld returned 1 exit status


Does anyone have advice?

Thanks.
-Nick

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

Re: Compiling problems (netcdf?)

#2 Unread post by kate »

A first guess is that netcdf was compiled with another version/compiler than you are currently using to compile ROMS (first problem).

For the second problem, you aren't giving us (or perhaps the linker) enough information about where the new library got installed. On the link line, do you see it pointing to the directory where you installed netcdf? Or do you need to add a -lnetcdff?

OK, I updated this: https://www.myroms.org/wiki/index.php/F ... _link_time

User avatar
nrecord
Posts: 11
Joined: Thu May 27, 2010 3:19 pm
Location: University of Maine

Re: Compiling problems (netcdf?)

#3 Unread post by nrecord »

Thanks for the response Kate. I'll be digging into this again today, and hopefully I'll make some progress.

On the second error, this was the preceding line:

/usr/local/bin/gfortran -frepack-arrays -O3 -ffast-math /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/esmf_roms.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/master.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/ocean_control.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/ocean_coupler.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/propagator.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/roms_export.o /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/roms_import.o -o /Users/nickrecord/Work/ROMS/Projects/Upwelling/oceanS /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libNLM.a /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libNLM_bio.a /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libNLM_sed.a /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libANA.a /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libUTIL.a /Users/nickrecord/Work/ROMS/Projects/Upwelling/Build/libMODS.a -L/opt/gfortran/serial/netcdf4/lib -lnetcdf

User avatar
nrecord
Posts: 11
Joined: Thu May 27, 2010 3:19 pm
Location: University of Maine

Re: Compiling problems (netcdf?)

#4 Unread post by nrecord »

Hi again Kate,

Just to update... I think your first instinct was right. I'm not sure exactly where the crossed lines were, but ROMS has compiled and is running.

Thanks again.
-Nick

Post Reply