Hi,
I'm trying to compile ROMS for the upwelling case using build.bash with gfortran. I'm getting the following error:
/usr/local/bin/gfortran -frepack-arrays -g -fbounds-check /Users/Maggie/ROMS/Projects/upwelling/Build/esmf_roms.o /Users/Maggie/ROMS/Projects/upwelling/Build/master.o /Users/Maggie/ROMS/Projects/upwelling/Build/ocean_control.o /Users/Maggie/ROMS/Projects/upwelling/Build/ocean_coupler.o /Users/Maggie/ROMS/Projects/upwelling/Build/propagator.o /Users/Maggie/ROMS/Projects/upwelling/Build/roms_export.o /Users/Maggie/ROMS/Projects/upwelling/Build/roms_import.o -o /Users/Maggie/ROMS/Projects/upwelling/oceanG /Users/Maggie/ROMS/Projects/upwelling/Build/libNLM.a /Users/Maggie/ROMS/Projects/upwelling/Build/libNLM_bio.a /Users/Maggie/ROMS/Projects/upwelling/Build/libNLM_sed.a /Users/Maggie/ROMS/Projects/upwelling/Build/libANA.a /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a /Users/Maggie/ROMS/Projects/upwelling/Build/libMODS.a -L/Users/Maggie/src/netcdf-3.6.3/f90 -lnetcdf
ld: library not found for -lnetcdf
collect2: ld returned 1 exit status
make: *** [/Users/Maggie/ROMS/Projects/upwelling/oceanG] Error 1
I know it's having trouble finding the netcdf library, but I'm not sure where to direct it. Is there a way to find it? I've tried:
/netcdf-3.6.3/libsrc
/netcdf-3.6.3/f90
Thanks for your help!
Compiling Trouble: Netcdf Library Location
Re: Compiling Trouble: Netcdf Library Location
It is going to look for a file called libnetcdf.a and it's going to look in the /Users/Maggie/src/netcdf-3.6.3/f90 directory. If you compile netcdf and leave things in the source tree, the library should be in perhaps a lib directory, not in the f90 directory. Try:-L/Users/Maggie/src/netcdf-3.6.3/f90 -lnetcdf
Code: Select all
find Users/Maggie/src/netcdf-3.6.3/ -name libnetcdf.a
Re: Compiling Trouble: Netcdf Library Location
Wonderful, thanks!
Two more questions:
1. It seemed to mostly compile ok, in that it generated an oceanG executable file. I say "mostly" because there were a bunch of these types of errors:
ld: warning: can't find atom for N_GSYM stabs mran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
ld: warning: can't find atom for N_GSYM stabs kran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
Should I ignore them? What do they mean?
2. What is the benefit to using build scripts over makefiles?
Thank you for your help!
Two more questions:
1. It seemed to mostly compile ok, in that it generated an oceanG executable file. I say "mostly" because there were a bunch of these types of errors:
ld: warning: can't find atom for N_GSYM stabs mran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
ld: warning: can't find atom for N_GSYM stabs kran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
Should I ignore them? What do they mean?
2. What is the benefit to using build scripts over makefiles?
Thank you for your help!
Re: Compiling Trouble: Netcdf Library Location
Does it run? Then ignore them.mamckeon wrote:Wonderful, thanks!
Two more questions:
1. It seemed to mostly compile ok, in that it generated an oceanG executable file. I say "mostly" because there were a bunch of these types of errors:
ld: warning: can't find atom for N_GSYM stabs mran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
ld: warning: can't find atom for N_GSYM stabs kran0:G(0,8) in /Users/Maggie/ROMS/Projects/upwelling/Build/libUTIL.a(ran_state.o)
Should I ignore them? What do they mean?
Haha! This is a religious issue, like vim vs emacs. Either way, you want to copy the distributed one and make changes in the copy, plus make sure that changes to the distributed one get propagated to yours. The script fanatics claim the distributed script is cleaner and changes less frequently.2. What is the benefit to using build scripts over makefiles?
Thank you for your help!
Edit: make a copy for each system, each project.