ROMS compiling error, netcdf

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
edith
Posts: 19
Joined: Thu Jun 15, 2006 2:25 pm
Location: Tallinn University of Tecnology Marinsystem ins.

ROMS compiling error, netcdf

#1 Unread post by edith »

hi,
I hope that somebody might be able to help me with my problem.
i am using ROMS (agrif version) and i try to compile my files. I use linux and g95. it keeps giving me error that looks like it cant find netcdf library or something.
i have set path for libnetcdf.a and netcdf.inc files in jobcomp file NETCDFLIB=-L and NETCDFLIB=-I. is there any other place where i have to set path for netcdf library? is there different netcdf.inc files for different versions of netcdf? (if so then where i can get them?)
I have read some posts here where people talked about double underscore conflict and checke my libnetcdf.a file with nm and i dont seam to have any double underscores, so that is also not reason.
any idea what could be reason for this errors?

That is the end of error i get:

nf_read_bry.o(.data+0x340): undefined reference to `nf_put_att_real_'
nf_read_bry.o(.data+0x344): undefined reference to `nf_put_att_int2_'
nf_read_bry.o(.data+0x348): undefined reference to `nf_open_'
nf_read_bry.o(.data+0x34c): undefined reference to `nf_put_att_text_'
nf_read_bry.o(.data+0x350): undefined reference to `nf_put_var1_int1_'
nf_read_bry.o(.data+0x354): undefined reference to `nf_put_var1_int2_'
nf_read_bry.o(.data+0x358): undefined reference to `nf_put_var1_int_'
nf_read_bry.o(.data+0x35c): undefined reference to `nf_put_var1_double_'
nf_read_bry.o(.data+0x360): undefined reference to `nf_put_var1_real_'
nf_read_bry.o(.data+0x364): undefined reference to `nf_put_var_int_'
nf_read_bry.o(.data+0x368): undefined reference to `nf_put_var_double_'
nf_read_bry.o(.data+0x36c): undefined reference to `nf_put_var1_text_'
nf_read_bry.o(.data+0x370): undefined reference to `nf_inq_varid_'
nf_read_bry.o(.data+0x374): undefined reference to `nf_put_var_real_'
nf_read_bry.o(.data+0x378): undefined reference to `nf_put_var_int2_'
nf_read_bry.o(.data+0x37c): undefined reference to `nf_put_vara_double_'
nf_read_bry.o(.data+0x380): undefined reference to `nf_put_var_text_'
nf_read_bry.o(.data+0x384): undefined reference to `nf_put_vara_int2_'
nf_read_bry.o(.data+0x388): undefined reference to `nf_put_vara_real_'
nf_read_bry.o(.data+0x38c): undefined reference to `nf_put_vara_int1_'
nf_read_bry.o(.data+0x390): undefined reference to `nf_put_vara_int_'
nf_read_bry.o(.data+0x394): undefined reference to `nf_put_varm_int1_'
nf_read_bry.o(.data+0x398): undefined reference to `nf_put_varm_int2_'
nf_read_bry.o(.data+0x39c): undefined reference to `nf_put_varm_int_'
nf_read_bry.o(.data+0x3a0): undefined reference to `nf_put_varm_double_'
nf_read_bry.o(.data+0x3a4): undefined reference to `nf_put_varm_text_'
nf_read_bry.o(.data+0x3a8): undefined reference to `nf_put_varm_real_'
nf_read_bry.o(.data+0x3ac): undefined reference to `nf_put_vars_int1_'
nf_read_bry.o(.data+0x3b0): undefined reference to `nf_put_vars_int_'
nf_read_bry.o(.data+0x3b4): undefined reference to `nf_put_vars_int2_'
nf_read_bry.o(.data+0x3b8): undefined reference to `nf_put_vars_real_'
nf_read_bry.o(.data+0x3bc): undefined reference to `nf_put_vars_text_'
nf_read_bry.o(.data+0x3c0): undefined reference to `nf_redef_'
nf_read_bry.o(.data+0x3c4): undefined reference to `nf_put_vars_double_'
nf_read_bry.o(.data+0x3c8): undefined reference to `nf_put_vara_text_'
nf_read_bry.o(.data+0x3cc): undefined reference to `nf_rename_dim_'
nf_read_bry.o(.data+0x3d0): undefined reference to `nf_rename_var_'
nf_read_bry.o(.data+0x3d4): undefined reference to `nf_set_fill_'
nf_read_bry.o(.data+0x3d8): undefined reference to `nf_set_base_pe_'
nf_read_bry.o(.data+0x3dc): undefined reference to `nf_sync_'
nf_read_bry.o(.data+0x3e0): undefined reference to `nf_rename_att_'
nf_read_bry.o(.data+0x3e4): undefined reference to `nf_put_var_int1_'
nf_read_bry.o(.data+0x3e8): undefined reference to `nf_inq_attlen_'
nf_read_bry.o(.data+0x3ec): undefined reference to `nf_get_att_int1_'

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

#2 Unread post by kate »

I don't know how the Makefile works for the agrif ROMS. So you did nm on the netcdf library and it matches the names in this list? nf_open_ looks like nf_open_? You don't show us the actual link command. Does it have -L/path/to/lib/directory as you think it should?

RubenDiez-Lazaro

#3 Unread post by RubenDiez-Lazaro »

You are use a different compiler for compile the netcdf library and the roms-agrif stuff....

If you use g95 for compile roms, get an netcdf library compiled by g95...

Use different compilers is also possible, but it require use some options about the way the compiler put the name to the object code... (second underscore related...)
The easy way is use the same compiler for the netcdf and roms....

Note that you can put in your system different versions of netcdf. Use the "--prefix=xxxx" option with the configure script when you compile netcdf in order to put the specific version in the dir you like.... Then edit the makefiles of roms to say it whe the netcdf library is....

The FC and F90 environment vars is useful to chose the compiler you desire...

Post Reply