Test case compile

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
bperfect
Posts: 11
Joined: Fri Feb 19, 2016 4:05 pm
Location: University of Washington

Test case compile

#1 Unread post by bperfect »

I'm trying to run one of the template cases, and I'm running into what seems to be a classic library linking error:

Code: Select all

/usr/bin/gfortran -frepack-arrays -O3 -ffast-math  
...
/home/bperfect/roms/roms_templates/seamount/Build/libANA.a /home/bperfect/roms/roms_templates/seamount/Build/libUTIL.a /home/bperfect/roms/roms_templates/seamount/Build/libMODS.a -L/usr/local/lib -lnetcdf
/home/bperfect/roms/roms_templates/seamount/Build/libUTIL.a(close_io.o): In function `close_out_':
close_io.f90:(.text+0x106e): undefined reference to `__netcdf_MOD_nf90_strerror'
Followed by a ton of errors.

The wiki tells me that I appear to be missing a -lnetdcff flag on the final line before the error. The problem is that there isn't any direction on how to make that flag appear. I've played around in the basic build.bash file that came with ROMS, but to no avail. When I change around the system variables within that default build file to reflect the locations of my own installations, I get the same failure, but without either the -L/usr/local/lib or -lnetcdf flag.

My nc-config is as follows:

Code: Select all

bperfect@fourier:seamount $ nc-config --all

This netCDF 4.4.0 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include -I/usr/local/include
  --libs      -> 

  --has-c++   -> no
  --cxx       -> 
  --has-c++4  -> no
  --cxx4      -> 

  --fc        -> 
  --fflags    -> 
  --flibs     -> 
  --has-f90   -> no

  --has-dap   -> no
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-pnetcdf-> no

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF 4.4.0
It seems to me the the --libs flag should have something, but again, I have no idea how to make that happen.

As far as the installation goes, I've installed and tested, to the best of my knowledge, everything that ROMS requires.

Any wisdom on how to fix this?

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

Re: Test case compile

#2 Unread post by kate »

--has-f90 -> no
You need to have netcdf-fortran as well as the C netcdf library. It became a separate package since some of the ROMS documentation was written.

bperfect
Posts: 11
Joined: Fri Feb 19, 2016 4:05 pm
Location: University of Washington

Re: Test case compile

#3 Unread post by bperfect »

Thanks,

I have the netcdf fortran library installed as well (perhaps something is configured incorrectly?)

Code: Select all

bperfect@fourier:Downloads $ nf-config --all

This netCDF-Fortran 4.4.3 has been built with the following features: 

  --cc        -> gcc
  --cflags    ->  -I/usr/local/include -I/usr/local/include

  --fc        -> gfortran
  --fflags    -> -I/usr/local/include
  --flibs     -> -L/usr/local/lib -lnetcdff -L/usr/local/lib -lnetcdf -lnetcdf 
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /usr/local
  --includedir-> /usr/local/include
  --version   -> netCDF-Fortran 4.4.3

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

Re: Test case compile

#4 Unread post by kate »

Simply change "nc-config" to "nf-config" in the the appropriate Compilers/xxx file.

Note - I don't know why installing the Fortran part doesn't always update nc-config, but I have experienced that too.

Post Reply