make file problem

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
mashinde
Posts: 135
Joined: Mon Jun 22, 2009 3:46 pm
Location: Indian Institute of Tropical Meteorology, Pune, INDIA

make file problem

#1 Unread post by mashinde »

when i running make second time it gives me following errors.........

cd Build; /usr/bin/gfortran -c -frepack-arrays -g -fbounds-check master.f90
/usr/bin/gfortran -frepack-arrays -g -fbounds-check Build/esmf_roms.o Build/master.o Build/ocean_control.o Build/ocean_coupler.o Build/propagator.o Build/roms_export.o Build/roms_import.o -o oceanG Build/libNLM.a Build/libANA.a Build/libUTIL.a Build/libMODS.a -L/usr/local/netcdf4/lib -lnetcdf -L/usr/local/hdf5/lib -lhdf5_hl -lhdf5 -lz
Build/libUTIL.a(close_io.o): In function `close_io':
/home/mashinde/ROMS/src/Build/close_io.f90:101: undefined reference to `__netcdf_MOD_nf90_strerror'
/home/mashinde/ROMS/src/Build/close_io.f90:103: undefined reference to `__netcdf_MOD_nf90_strerror'
Build/libUTIL.a(def_dim.o): In function `def_dim':
/home/mashinde/ROMS/src/Build/def_dim.f90:56: undefined reference to `__netcdf_MOD_nf90_def_dim'
Build/libUTIL.a(def_info.o): In function `def_info':
/home/mashinde/ROMS/src/Build/def_info.f90:153: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_info.f90:165: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_info.f90:179: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_info.f90:228: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_info.f90:240: undefined reference to `__netcdf_MOD_nf90_put_att_text'
Build/libUTIL.a(def_info.o):/home/mashinde/ROMS/src/Build/def_info.f90:249: more undefined references to `__netcdf_MOD_nf90_put_att_text' follow
Build/libUTIL.a(def_var.o): In function `def_var':
/home/mashinde/ROMS/src/Build/def_var.f90:113: undefined reference to `__netcdf_MOD_nf90_def_var_scalar'
/home/mashinde/ROMS/src/Build/def_var.f90:116: undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
/home/mashinde/ROMS/src/Build/def_var.f90:133: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:150: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:168: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:186: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:204: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:207: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:210: undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:230: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:233: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:236: undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:258: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:263: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:289: undefined reference to `__netcdf_MOD_nf90_put_att_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:292: undefined reference to `__netcdf_MOD_nf90_put_att_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:295: undefined reference to `__netcdf_MOD_nf90_put_att_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:301: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:325: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:342: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:359: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:376: undefined reference to `__netcdf_MOD_nf90_put_att_text'
Build/libUTIL.a(def_var.o):/home/mashinde/ROMS/src/Build/def_var.f90:393: more undefined references to `__netcdf_MOD_nf90_put_att_text' follow
Build/libUTIL.a(def_var.o): In function `def_var':
/home/mashinde/ROMS/src/Build/def_var.f90:428: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:431: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:434: undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:454: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:457: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:460: undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:480: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/def_var.f90:483: undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:486: undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/def_var.f90:505: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:522: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:589: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:607: undefined reference to `__netcdf_MOD_nf90_put_att_text'
/home/mashinde/ROMS/src/Build/def_var.f90:624: undefined reference to `__netcdf_MOD_nf90_put_att_text'
Build/libUTIL.a(nf_fread2d.o): In function `nf_fread2d':
/home/mashinde/ROMS/src/Build/nf_fread2d.f90:185: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
Build/libUTIL.a(nf_fread3d.o): In function `nf_fread3d':
/home/mashinde/ROMS/src/Build/nf_fread3d.f90:157: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
Build/libUTIL.a(nf_fread4d.o): In function `nf_fread4d':
/home/mashinde/ROMS/src/Build/nf_fread4d.f90:160: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
Build/libUTIL.a(nf_fwrite2d.o): In function `nf_fwrite2d':
/home/mashinde/ROMS/src/Build/nf_fwrite2d.f90:143: undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
Build/libUTIL.a(nf_fwrite3d.o): In function `nf_fwrite3d':
/home/mashinde/ROMS/src/Build/nf_fwrite3d.f90:155: undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_sync':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:4067: undefined reference to `__netcdf_MOD_nf90_sync'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_redef':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:4013: undefined reference to `__netcdf_MOD_nf90_redef'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_open':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3897: undefined reference to `__netcdf_MOD_nf90_open'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3899: undefined reference to `__netcdf_MOD_nf90_open'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3901: undefined reference to `__netcdf_MOD_nf90_open'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_enddef':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3840: undefined reference to `__netcdf_MOD_nf90_enddef'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_create':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3788: undefined reference to `__netcdf_MOD_nf90_create'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_close':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3723: undefined reference to `__netcdf_MOD_nf90_get_att_text'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3731: undefined reference to `__netcdf_MOD_nf90_close'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_svar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3634: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3652: undefined reference to `__netcdf_MOD_nf90_put_var_1d_text'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_svar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3527: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3543: undefined reference to `__netcdf_MOD_nf90_put_var_text'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_lvar_2d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3409: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3436: undefined reference to `__netcdf_MOD_nf90_put_var_2d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_lvar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3289: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3314: undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_lvar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3166: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3190: undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3193: undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_ivar_2d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3056: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:3070: undefined reference to `__netcdf_MOD_nf90_put_var_2d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_ivar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2951: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2965: undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_ivar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2841: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2856: undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2859: undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_fvar_4d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2735: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2749: undefined reference to `__netcdf_MOD_nf90_put_var_4d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_fvar_3d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2630: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2644: undefined reference to `__netcdf_MOD_nf90_put_var_3d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_fvar_2d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2525: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2539: undefined reference to `__netcdf_MOD_nf90_put_var_2d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_fvar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2416: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2430: undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_put_fvar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2306: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2321: undefined reference to `__netcdf_MOD_nf90_put_var_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2324: undefined reference to `__netcdf_MOD_nf90_put_var_1d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_svar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2203: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2206: undefined reference to `__netcdf_MOD_nf90_get_var_1d_text'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2208: undefined reference to `__netcdf_MOD_nf90_get_var_1d_text'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_svar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2098: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2101: undefined reference to `__netcdf_MOD_nf90_get_var_text'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2103: undefined reference to `__netcdf_MOD_nf90_get_var_text'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_ivar_2d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1997: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2000: undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:2002: undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_ivar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1890: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1893: undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1895: undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_ivar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1784: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1787: undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1790: undefined reference to `__netcdf_MOD_nf90_get_var_fourbyteint'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fvar_4d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1673: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1676: undefined reference to `__netcdf_MOD_nf90_get_var_4d_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1678: undefined reference to `__netcdf_MOD_nf90_get_var_4d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fvar_3d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1553: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1556: undefined reference to `__netcdf_MOD_nf90_get_var_3d_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1558: undefined reference to `__netcdf_MOD_nf90_get_var_3d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fvar_2d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1435: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1438: undefined reference to `__netcdf_MOD_nf90_get_var_2d_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1440: undefined reference to `__netcdf_MOD_nf90_get_var_2d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fvar_1d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1314: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1317: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1319: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fvar_0d':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1192: undefined reference to `__netcdf_MOD_nf90_inq_varid'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1195: undefined reference to `__netcdf_MOD_nf90_get_var_1d_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1198: undefined reference to `__netcdf_MOD_nf90_get_var_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_fatt':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1064: undefined reference to `__netcdf_MOD_nf90_inquire_variable'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1067: undefined reference to `__netcdf_MOD_nf90_inq_attname'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:1071: undefined reference to `__netcdf_MOD_nf90_get_att_one_eightbytereal'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_inq_varid':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:986: undefined reference to `__netcdf_MOD_nf90_inq_varid'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_inq_var':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:712: undefined reference to `__netcdf_MOD_nf90_inquire'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:724: undefined reference to `__netcdf_MOD_nf90_inquire_variable'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:728: undefined reference to `__netcdf_MOD_nf90_inq_attname'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:816: undefined reference to `__netcdf_MOD_nf90_inquire_dimension'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:827: undefined reference to `__netcdf_MOD_nf90_inq_attname'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:832: undefined reference to `__netcdf_MOD_nf90_inquire_attribute'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:837: undefined reference to `__netcdf_MOD_nf90_get_att_one_fourbyteint'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:852: undefined reference to `__netcdf_MOD_nf90_get_att_one_eightbytereal'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:866: undefined reference to `__netcdf_MOD_nf90_get_att_text'
Build/libMODS.a(mod_netcdf.o): In function `netcdf_get_dim':
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:218: undefined reference to `__netcdf_MOD_nf90_inquire'
/home/mashinde/ROMS/src/Build/mod_netcdf.f90:228: undefined reference to `__netcdf_MOD_nf90_inquire_dimension'
collect2: ld returned 1 exit status
make: *** [oceanG] Error 1

*************************************************+++

please help how to solve this problem

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

Re: make file problem

#2 Unread post by kate »

You've got a problem linking with your netcdf library. Run something like:

Code: Select all

nm libnetcdf.a | grep nf90_strerror
to see how the result compares with what the linker is looking for:

Code: Select all

undefined reference to `__netcdf_MOD_nf90_strerror
Is it missing entirely? Is it there with different underscores? Worst case is you'll have to recompile the netcdf library and ensure that it builds the f90 component.

fancer
Posts: 45
Joined: Fri Feb 06, 2009 5:20 pm
Location: NNSTU, The Nizhniy Novgorod State Technical University named after R.E.Alekseev, Russia

Re: make file problem

#3 Unread post by fancer »

If you build netcdf with shared libraries, configure-script will include --enable-separate-fortran option automatically. When all the fortran-functions will be in libnetcdff.a(.so). You must correct {Platform}-{compiler}.mk file with next:
...
LIBS := -L{NETCDF_LIBDIR} -lnetcdff
...
ie replace -lnetcdf -lnetcdff
But the netcdf must be configured with the following options:
FC=gfortran
F77=gfortran
--enable-shared
--enable-static
--enable-f77
--enable-fortran
--enable-f90
--enable-netcdf4
--enable-netcdf-4

PS This is for future similar issues))

Gabriel_Carvalho
Posts: 9
Joined: Tue Jul 05, 2011 2:47 pm
Location: Prooceano

Re: make file problem

#4 Unread post by Gabriel_Carvalho »

hello,
fancer, I'm having the same problem, and I've made your sugestion changing the -lnetcdf by -lnetcdff.

But I don't understand what do you mean by configuring the netcdf. How can I do this?

thanks in advance,
Gabriel Carvalho

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

Re: make file problem

#5 Unread post by kate »

fancer was listing all the arguments to give to the configure script when building the NetCDF library. I expect the last two mean the same thing - i.e., you only need one.

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

Re: make file problem

#6 Unread post by m.hadfield »

By the way, if you're using netCDF4 (USE_NETCDF4=on) with an up-to-date copy of Rutgers ROMS, then the makefile should be able to infer the options required to link with netCDF. It does this by invoking a utility called nc-config, via the following lines in the platform-specific make file:

Code: Select all

ifdef USE_NETCDF4
        NC_CONFIG ?= nc-config
    NETCDF_INCDIR ?= $(shell $(NC_CONFIG) --prefix)/include
             LIBS := $(shell $(NC_CONFIG) --flibs)
else
    NETCDF_INCDIR ?= /usr/local/include
    NETCDF_LIBDIR ?= /usr/local/lib
             LIBS := -L$(NETCDF_LIBDIR) -lnetcdf
endif
For this to work, you need to ensure nc-config is on the PATH, or provide its location in an environment variable called NC_CONFIG. If you do it right, quietly muttering the correct magic spells, then you don't need to know the details of how netCDF was configured and built.

AlexisEspinosa
Posts: 23
Joined: Fri May 24, 2013 3:05 am
Location: UWA

Re: make file problem

#7 Unread post by AlexisEspinosa »

I have installed
netCDF

Code: Select all

:)>>>nc-config --version
netCDF 4.2.1.1
and netCDF-Fortran

Code: Select all

:)>>>nf-config --version
netCDF-Fortran 4.2
I'm using ubuntu and gfortran compiler, so I needed to edit the file:
~.~/Trunk/Compilers/Linux-gfortran.mk
and use nf-config instead of nc-config

Code: Select all

###Doesn't work       NC_CONFIG ?= nc-config
        NC_CONFIG ?= nf-config
This was really confusing to catch, and I do not know if ROMS developers may do something in their scripts to adapt for the usage of netCDF-Fortran, which I understand is the current way netCDF is installed. Am I right?

Cheers,
Alexis Espinosa-Gayosso
UWA

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

Re: make file problem

#8 Unread post by kate »

Properly installed, both "nc-config --flibs" and "nf-config --flibs" give the same response. A few here have found that not to be the case for their installation. One could check the first and if it fails, try the second. People with Netcdf versions before Netcdf-fortran forked off would only have the first. Hernan is still trying to support Netcdf 3 from before nc-config was created.

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

Re: make file problem

#9 Unread post by m.hadfield »

You don't need to edit the makefile. You can override the NC_CONFIG make variable by setting an environment variable with the same name before running make, eg:

Code: Select all

export NC_CONFIG=nf-config
Perhaps the make variable should now be renamed NF_CONFIG and point to nf-config by default.

Post Reply