roms-3.0 with gfortran

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
nageswararao

roms-3.0 with gfortran

#1 Unread post by nageswararao »

Hi all,
I am trying to install ROMS-3.0 with gfortran compiler. I got the following error:
: No such file or directory
makefile:230: INCLUDING FILE /shared/ROMS-3.0/Compilers/make_macros.mk WHICH
CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
gmake: svnversion: Command not found
./ROMS/Bin/sfmakedepend --cpp --fext=f90 --file=-
--objdir=/shared/ROMS-3.0/Build -DROMS_HEADER="upwelling.h" -I ROMS/Include -I
ROMS/Nonlinear -I ROMS/SeaIce -I ROMS/Utility -I ROMS/Drivers -I
ROMS/Functionals -I Master -I Compilers --silent --moddir
/shared/ROMS-3.0/Build ROMS/Nonlinear/bulk_flux.F
ROMS/Nonlinear/exchange_2d.F ROMS/Nonlinear/exchange_3d.F
ROMS/Nonlinear/get_idata.F ROMS/Nonlinear/gls_corstep.F
ROMS/Nonlinear/gls_prestep.F ROMS/Nonlinear/ini_fields.F
ROMS/Nonlinear/interp_floats.F ROMS/Nonlinear/lmd_swfrac.F
ROMS/Nonlinear/mpdata_adiff.F ROMS/Nonlinear/my25_corstep.F
ROMS/Nonlinear/my25_prestep.F ROMS/Nonlinear/obc_volcons.F
ROMS/Nonlinear/pre_step3d.F ROMS/Nonlinear/radiation_stress.F
ROMS/Nonlinear/set_depth.F ROMS/Nonlinear/set_massflux.F
ROMS/Nonlinear/set_tides.F ROMS/Nonlinear/step3d_uv.F
ROMS/Nonlinear/step_floats.F ROMS/Nonlinear/wvelocity.F
ROMS/Functionals/analytical.F ROMS/Utility/back_cost.F
ROMS/Utility/back_step.F ROMS/Utility/cgradient.F ROMS/Utility/checkdefs.F
ROMS/Utility/checkvars.F ROMS/Utility/cost_grad.F ROMS/Utility/cost_norm.F
ROMS/Utility/def_diags.F ROMS/Utility/def_floats.F ROMS/Utility/def_hessian.F
ROMS/Utility/def_impulse.F ROMS/Utility/def_station.F ROMS/Utility/def_tides.F
ROMS/Utility/distribute.F ROMS/Utility/dotproduct.F ROMS/Utility/extract_obs.F
ROMS/Utility/extract_sta.F ROMS/Utility/frc_adjust.F ROMS/Utility/get_2dfld.F
ROMS/Utility/get_2dfldr.F ROMS/Utility/get_3dfld.F ROMS/Utility/get_3dfldr.F
ROMS/Utility/get_bounds.F ROMS/Utility/get_cycle.F ROMS/Utility/get_ngfld.F
ROMS/Utility/get_ngfldr.F ROMS/Utility/get_state.F
ROMS/Utility/get_varcoords.F ROMS/Utility/grid_coords.F
ROMS/Utility/ini_adjust.F ROMS/Utility/interpolate.F
ROMS/Utility/mp_exchange.F ROMS/Utility/mp_routines.F
ROMS/Utility/nf_fread2d.F ROMS/Utility/nf_fread3d.F ROMS/Utility/nf_fread4d.F
ROMS/Utility/nf_fwrite2d.F ROMS/Utility/nf_fwrite3d.F
ROMS/Utility/nf_fwrite4d.F ROMS/Utility/normalization.F
ROMS/Utility/obs_depth.F ROMS/Utility/obs_initial.F ROMS/Utility/obs_scale.F
ROMS/Utility/obs_write.F ROMS/Utility/oi_update.F ROMS/Utility/ran_state.F
ROMS/Utility/set_2dfld.F ROMS/Utility/set_2dfldr.F ROMS/Utility/set_3dfld.F
ROMS/Utility/set_3dfldr.F ROMS/Utility/set_diags.F ROMS/Utility/set_ngfld.F
ROMS/Utility/set_ngfldr.F ROMS/Utility/set_scoord.F ROMS/Utility/set_weights.F
ROMS/Utility/state_addition.F ROMS/Utility/state_copy.F
ROMS/Utility/state_dotprod.F ROMS/Utility/state_initialize.F
ROMS/Utility/state_scale.F ROMS/Utility/stats_modobs.F
ROMS/Utility/stiffness.F ROMS/Utility/white_noise.F ROMS/Utility/wrt_diags.F
ROMS/Utility/wrt_floats.F ROMS/Utility/wrt_hessian.F
ROMS/Utility/wrt_station.F ROMS/Utility/wrt_tides.F ROMS/Modules/mod_arrays.F
ROMS/Modules/mod_average.F ROMS/Modules/mod_biology.F
ROMS/Modules/mod_boundary.F ROMS/Modules/mod_clima.F
ROMS/Modules/mod_coupling.F ROMS/Modules/mod_diags.F
ROMS/Modules/mod_eclight.F ROMS/Modules/mod_eoscoef.F
ROMS/Modules/mod_floats.F ROMS/Modules/mod_forces.F
ROMS/Modules/mod_fourdvar.F ROMS/Modules/mod_iounits.F
ROMS/Modules/mod_kinds.F ROMS/Modules/mod_mixing.F ROMS/Modules/mod_ncparam.F
ROMS/Modules/mod_nesting.F ROMS/Modules/mod_netcdf.F ROMS/Modules/mod_ocean.F
ROMS/Modules/mod_parallel.F ROMS/Modules/mod_param.F
ROMS/Modules/mod_scalars.F ROMS/Modules/mod_sediment.F
ROMS/Modules/mod_sources.F ROMS/Modules/mod_stepping.F
ROMS/Modules/mod_storage.F ROMS/Modules/mod_strings.F ROMS/Modules/mod_tides.F
Master/ocean_control.F Master/ocean_coupler.F Master/propagator.F >
/shared/ROMS-3.0/Build/MakeDepend
: No such file or directory
gmake: *** [/shared/ROMS-3.0/Build/MakeDepend] Error 127
When I again run gmake I got the following error.
: No such file or directory
makefile:230: INCLUDING FILE /shared/ROMS-3.0/Compilers/make_macros.mk WHICH
CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
make: svnversion: Command not found
cd /shared/ROMS-3.0/Build; gfortran -c -frepack-arrays -O3 -ffast-math
exchange_2d.f90
exchange_2d.f90:613.19:

USE mod_param
1
Fatal Error: Can't open module file 'mod_param.mod' for reading at (1): No
such file or directory
make: *** [/shared/ROMS-3.0/Build/exchange_2d.o] Error 1

I am not understanding what causes this error.
Can anyone help in this aspect.

Thanks in advance.

With best regards,
G.NageswaraRao.

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

#2 Unread post by kate »

You are getting an empty string where most of us would have the name of our header file. In your top makefile, what do you have for:

Code: Select all

ROMS_APPLICATION := NEP5
This is used later in the makefile to set ROMS_HEADER:

Code: Select all

ROMS_CPPFLAGS += -D'ROMS_HEADER="$(HEADER)"'
where HEADER should have nep5.h in this case.

nageswararao

#3 Unread post by nageswararao »

I am running test case Upwelling. So I gave UPWELLING for ROMS_APPLICATION.
I had given the path of the Include directory below also. Then also the same error came.
I downloaded the code in windows, is it causing any problem?
What may be the cause?

Thanks in advance.

With best regards,
G.NageswaraRao.

nageswararao

#4 Unread post by nageswararao »

I solved that problem and I am compiling successfully the code with some problems. Actually the problem is I had dowloaded the code in windows. When I opened in linux some files are with .f extensions and some are .F extensions. I changed them to .F files and executed dos2unix command. Then I could solve the problem. But some errors are there which I couldn't find the solution.

When I execute gmake I am getting an error which looks for make_macros.mk in Compilers directory. But code is creating that file with limited permissions and it cannot open that file further. But when I execute gmake command again it is executing well with some netcdf error at the end as below.
/shared/gfortran/gcc-4.2/bin/gfortran -frepack-arrays -O3 -ffast-math
/shared/ROMS-3.0/trunk/Build/ocean_control.o
/shared/ROMS-3.0/trunk/Build/ocean_coupler.o
/shared/ROMS-3.0/trunk/Build/propagator.o -o
/shared/ROMS-3.0/trunk/Projects/Upwelling/oceanS
/shared/ROMS-3.0/trunk/Build/libNLM.a /shared/ROMS-3.0/trunk/Build/libANA.a
/shared/ROMS-3.0/trunk/Build/libICE.a /shared/ROMS-3.0/trunk/Build/libUTIL.a
/shared/ROMS-3.0/trunk/Build/libMODS.a -L/shared/netcdf/lib -lnetcdf
/shared/netcdf/lib/libnetcdf.a(netcdf.o)(.text+0x2f): In function
`__netcdf__nf90_inq_libvers':
/shecky/netcdf/n3_shecky/netcdf-3.6.2/f90/netcdf_file.f90:5: undefined
reference to `_gfortran_copy_string'
/shared/netcdf/lib/libnetcdf.a(netcdf.o)(.text+0x7f): In function
`__netcdf__nf90_strerror':
/shecky/netcdf/n3_shecky/netcdf-3.6.2/f90/netcdf_file.f90:12: undefined
reference to `_gfortran_copy_string'
/shared/netcdf/lib/libnetcdf.a(netcdf.o)(.text+0x43a): In function
`__netcdf__nf90_inquire_dimension':
/shecky/netcdf/n3_shecky/netcdf-3.6.2/f90/netcdf_dims.f90:43: undefined
reference to `_gfortran_copy_string'
/shared/netcdf/lib/libnetcdf.a(netcdf.o)(.text+0x685): In function
`__netcdf__nf90_get_att_text':
/shecky/netcdf/n3_shecky/netcdf-3.6.2/f90/netcdf_attributes.f90:75: undefined
reference to `_gfortran_copy_string'
/shared/netcdf/lib/libnetcdf.a(netcdf.o)(.text+0x1a08): In function
`__netcdf__nf90_inquire_variable':
/shecky/netcdf/n3_shecky/netcdf-3.6.2/f90/netcdf_variables.f90:67: undefined
reference to `_gfortran_copy_string'
/shared/gfortran/gcc-4.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.4/libgfortranbegin.a(fmain.o)(.text+0xa):
In function `main':
/projects/tob/gcc-4_2-branch/libgfortran/fmain.c:18: undefined reference to
`MAIN__'
collect2: ld returned 1 exit status
gmake: *** [/shared/ROMS-3.0/trunk/Projects/Upwelling/oceanS] Error 1
Actually I installed machine dependent netcdf-3.6.2, i.e., x86_64 version i.e., precompiled version (I just untar and unzipped it). Will it making the problem? and why it could not create make_macros.mk file with full permissions when I executed in root also.....? Why it is again compiling when I retype gmake without 'gmake clean' ?

I am having these many questions in mind and I am unable to get answers for that.

Any help is appreciated.

With best regards,
G.NageswaraRao.

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

#5 Unread post by kate »

Somewhere there's a library with "_gfortran_copy_string" on the system where they compiled netcdf. You need to link to this library. If you have a library with a similar but different name in it as part of your gfortran installation, you would be better off recompiling netcdf.

DTokarev

Re: roms-3.0 with gfortran

#6 Unread post by DTokarev »

Hi all,

I have the same problem with roms-3 and ifort (fedora 8-64):

# make
makefile:230: INCLUDING FILE Compilers/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
which: invalid option -- f
which: invalid option -- p
which: invalid option -- p
which: invalid option -- 2
which: invalid option -- o
which: invalid option -- p
which: invalid option -- e
which: invalid option -- n
which: invalid option -- m
which: invalid option -- p
which: invalid option -- p
which: invalid option -- c
which: invalid option -- 8
which: invalid option -- 0
which: invalid option -- x
which: invalid option -- P
which: invalid option -- l
which: invalid option -- g
which: invalid option -- n
which: invalid option -- u
which: invalid option -- t
which: invalid option -- o
which: invalid option -- s
which: invalid option -- t
which: invalid option -- c
which: invalid option -- k
which: invalid option -- _
which: invalid option -- t
which: invalid option -- e
which: invalid option -- m
which: invalid option -- p
which: --read-alias, -i: Warning: stdin is a tty.


with changes in the Linux-ifort.mk file:

OMP_FLAG := -fpp2 -openmp
FC := ifort $(OMP_FLAG) -pc80 -axP -align dcommon -auto -stack_temp

Can anyone help in this aspect.

Thanks in advance,

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

Re: roms-3.0 with gfortran

#7 Unread post by kate »

That's very odd and I don't know what is going on. However, I suggest that you stick with the original:

Code: Select all

FC := ifort
then modify the FFLAGS. My version of the Compilers/Linux-ifort.mk has:

Code: Select all

ifdef USE_OpenMP
         CPPFLAGS += -D_OPENMP
           FFLAGS += -openmp
endif
Have you gotten it to work in serial mode? Perhaps start with a clean copy of the latest ROMS and try again?

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

Re: roms-3.0 with gfortran

#8 Unread post by m.hadfield »

# make
makefile:230: INCLUDING FILE Compilers/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
which: invalid option -- f
which: invalid option -- p
which: invalid option -- p
which: invalid option -- 2
That's very odd but strangely familiar :?. I know I have encountered errors like this myself, but can't recall how. Your compiler switches are being passed to the which command, presumably because make is passing them to the shell as if they were commands.

Like Kate, I suggest you be less creative in modifying your Linux-ifort.mk file. The ROMS make system already has a system for specifying the compiler (FC) and its flags (FFLAGS), with variants for OpenMP and MPI. Use this system rather than fighting against it.

DTokarev

Re: roms-3.0 with gfortran

#9 Unread post by DTokarev »

Hi
Thanks for your help.
I just want to use both core.
The only one core is working now
with standard options in the Linux-ifort.mk file.
What can i do?
Thanks in advance.

DTokarev

Re: roms-3.0 with gfortran

#10 Unread post by DTokarev »

Oops! I have the USE_OpenMP ? in the makefile is off ...... :oops:
Thanks

Post Reply