Hello there, I am new to ROMS and I am having troubles with the compiling of ROMS for the first time. I am working on a windows 10 pc.
After several unsuccessful tries with Cygwin, I decided to use Ubuntu following the steps here: http://modb.oce.ulg.ac.be/wiki/upload/OCEA0036/ROMS/
With Ubuntu and the required software install, I followed the steps in https://www.myroms.org/wiki/ROMS_Cygwin to download ROMS and customize build_roms.sh (previously known as build.bash) and my_build_path.sh.
When typing "./build_roms.sh" I seems to work fine for around 5 minutes with lots of text but no apparent errors until I get the following:
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libUTIL.a(lbc.o): in function `lbc_getatt_':
lbc.f90:(.text+0x2446): undefined reference to `__netcdf_MOD_nf90_get_att_text'
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libUTIL.a(lbc.o): in function `lbc_putatt_':
lbc.f90:(.text+0x301f): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libUTIL.a(def_info.o): in function `def_info_':
def_info.f90:(.text+0x6d4): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_info.f90:(.text+0x861): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_info.f90:(.text+0x8e8): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_info.f90:(.text+0x96f): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libUTIL.a(def_info.o):def_info.f90:(.text+0x9f6): more undefined references to `__netcdf_MOD_nf90_put_att_text' follow
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libUTIL.a(def_var.o): in function `__def_var_mod_MOD_def_var':
def_var.f90:(.text+0x248): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
/usr/bin/ld: def_var.f90:(.text+0x3c2): undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0x499): undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0x620): undefined reference to `__netcdf_MOD_nf90_put_att_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0x768): undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0x83b): undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0x913): undefined reference to `__netcdf_MOD_nf90_put_att_one_eightbytereal'
/usr/bin/ld: def_var.f90:(.text+0xb9d): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_var.f90:(.text+0xc41): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_var.f90:(.text+0xe29): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_var.f90:(.text+0xeef): undefined reference to `__netcdf_MOD_nf90_put_att_text'
/usr/bin/ld: def_var.f90:(.text+0xf69): undefined reference to `__netcdf_MOD_nf90_put_att_text'[/b][/b][/b]
The error list continues with around 250-300 lines of undefined references, all of them related with the files libUTIL.a and libMODS.a inside the newly created "Build_roms" folder. The last lines of the output are the following:
/usr/bin/ld: /home/xegone/roms/Projects/Upwelling/Build_roms/libMODS.a(mod_netcdf.o): in function `__mod_netcdf_MOD_netcdf_get_dim':
mod_netcdf.f90:(.text+0x184e7): undefined reference to `__netcdf_MOD_nf90_inquire'
/usr/bin/ld: mod_netcdf.f90:(.text+0x185a9): undefined reference to `__netcdf_MOD_nf90_inquire_dimension'
/usr/bin/ld: mod_netcdf.f90:(.text+0x186bc): undefined reference to `__netcdf_MOD_nf90_strerror'
collect2: error: ld returned 1 exit status
make: *** [Master/Module.mk:22: /home/xegone/roms/Projects/Upwelling/romsS] Error 1
Did anyone have this issue or a similar one? Any ideas of how can I fix it?
gfortran version: GNU Fortran 9.3.0
NetCDF version:
--> netCDF-Fortran 4.5.2 (nf config)
--> netCDF 4.7.3 (nc config)
Best regards
Xegone
Undefined reference in libUTIL.a and libMODS.a running build_roms.sh (build.bash) for ROMS compiling (upwelling case)
Re: Undefined reference in libUTIL.a and libMODS.a running build_roms.sh (build.bash) for ROMS compiling (upwelling case
We need to see the command that came right before all your undefined references. Also, do you have "USE_NETCDF4" set to on your build_roms.sh?
Re: Undefined reference in libUTIL.a and libMODS.a running build_roms.sh (build.bash) for ROMS compiling (upwelling case
You are amazing robertson! That was my mistake, "USE_NETCDF4" was commented. I know it is a simple thing for you but you made my day, and saved me hours of work.
Have a good day
Xegone
Have a good day
Xegone