I am using Fedora 10, and I am trying to compile the source code for the Wave Watch III model. There are two scripts called "comp" and "link" that need to be editing before running the w3_make script (which invokes a bunch of other scripts to essentially compile the entire model). w3_make calls upon the comp/link scripts for compiler definition and linker call. Below are the edits I have made to the comp and link scripts, respectively...
__________________________________________________ _________________________
# 2.b Perform compilation - - - - - - - - - - - - - - - - - - - - - - - - - -
# Save compiler exit code in $OK
# Generic --------------------------------------------------------------------
gfortran -c $name.$fext -o $name.o > $name.out 2> $name.err
OK="$?"
__________________________________________________ _________________________
# 3. Link all things #
# --------------------------------------------------------------------------- #
# Add here the correct linker call including switches
#
# Generic -------------------------------------------------------------------
gfortran -o $prog $name lib.a > link.out 2> link.err
OK="$?"
__________________________________________________ _________________________
When I run w3_make to compile the grid preprocessor it returns the error...
wriwx@wri-> w3_make ww3_grid
*****************************
*** compiling WAVEWATCH-III ***
*****************************
Scratch directory : /home/wriwx/scratch
Save source codes : yes
Save listings : yes
Processing ww3_grid
---------------------
ad3 : processing ww3_grid
*** compile error ***
file ww3_grid.o not found
mv: cannot stat `ww3_grid.o': No such file or directory
make: *** [/home/wriwx/ww3/obj/ww3_grid.o] Error 5
**********************
*** end of compilation ***
**********************
This shows that the object file cannot be found, but the compiler should be creating it, as it passes a test that I'm running prior that passes and produces the file ctest.o in the proper directory. All directories and variables are correctly defined in the scripts, though I am unsure if I am inserting the correct variables/options after calling gfortran in the "link" script...therefore, I think the error may be in the "link" script. I have set-up error listing, which outputs the following error...
ww3_grid.f90:243.19:
USE CONSTANTS
1
Fatal Error: Can't open module file 'constants.mod' for reading at (1): No such file or directory
I have no idea what this is about.
I do not have much experience with compiling code, but I think the problem is in the "link" script. If anyone more familiar with compiling can help or has any idea what may be wrong here, it would be greatly appreciated. If more info is needed, post a reply and I will give my e-mail address. I have attached the "comp" and "link" scripts as they were before my above edits. Thank You.