errors when compiling test

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
anzhe0629

errors when compiling test

#1 Unread post by anzhe0629 »

Hi all

When I try to compile test in ROMS, for examples ~/test/bl_test or ~/test/kelvin. I meet the same error message.

Code: Select all

cd /media/jason/Program/ROMS/ocean/repository/test/bl_test/Build;  -c -heap-arrays -fp-model precise -ip -O3 mod_kinds.f90
/bin/sh: 1: -c: not found
ROMS/Modules/Module.mk:15: recipe for target '/media/jason/Program/ROMS/ocean/repository/test/bl_test/Build/mod_kinds.o' failed
make: *** [/media/jason/Program/ROMS/ocean/repository/test/bl_test/Build/mod_kinds.o] Error 127
my nc-config is as follows.

Code: Select all

  --cc        -> gcc
  --cflags    ->  -I/usr/include -DgFortran
  --libs      -> -L/usr/lib -lnetcdf

  --cxx       -> g++
  --has-c++   -> yes

  --fc        -> gfortran
  --fflags    -> -g -O2 -I/usr/include
  --flibs     -> -L/usr/lib -lnetcdff -lnetcdf
  --has-f77   -> yes
  --has-f90   -> yes

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-pnetcdf-> no
  --has-szlib -> 

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF 4.1.3
I even can not figure out what kind of message it is. Any comments and suggestions are appreciated! Thanks

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

Re: errors when compiling test

#2 Unread post by kate »

From the FAQ:
Errors like this:
cd Build; -c -O3 mod_kinds.f90
/bin/sh: -c: not found
The command:
FC := $(shell which ${FC})
in the Compilers/xxx-xxx.mk file has failed to find the compiler you specified, setting FC to the null string. You need to find out which compiler you were asking it to look for and to make sure it is in your path. If the flag USE_MPIF90 is set, it will be looking for "mpif90". What do you get from the command "which mpif90"? If you are trying for a serial run first, what does "which gfortran" give you?
How did you set FORT?

anzhe0629

Re: errors when compiling test

#3 Unread post by anzhe0629 »

I think it is gfortran

the follows is from ~/trunk/ROMS/Bin/build.sh

Code: Select all

#setenv FORT                ifort
  setenv FORT                gfortran
 #setenv FORT                pgi
 
  setenv USE_DEBUG           on          # use Fortran debugging flags
  setenv USE_LARGE           on          # activate 64-bit compilation
 #setenv USE_NETCDF4         on          # compile with NetCDF-4 library
 #setenv USE_PARALLEL_IO     on          # Parallel I/O with NetCDF-4/HDF5 
 #setenv USE_MY_LIBS         on          # use my library paths below
Is this helpful? what other file should I change to compile ROMS except ~/trunk/ROMS/Bin/build.sh?


Thanks for your reply.






kate wrote:From the FAQ:
Errors like this:
cd Build; -c -O3 mod_kinds.f90
/bin/sh: -c: not found
The command:
FC := $(shell which ${FC})
in the Compilers/xxx-xxx.mk file has failed to find the compiler you specified, setting FC to the null string. You need to find out which compiler you were asking it to look for and to make sure it is in your path. If the flag USE_MPIF90 is set, it will be looking for "mpif90". What do you get from the command "which mpif90"? If you are trying for a serial run first, what does "which gfortran" give you?
How did you set FORT?

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

Re: errors when compiling test

#4 Unread post by kate »

If the flag USE_MPIF90 is set, it will be looking for "mpif90".
Is USE_MPIF90 set?
What do you get from the command "which mpif90"?
If you are trying for a serial run first, what does "which gfortran" give you?

anzhe0629

Re: errors when compiling test

#5 Unread post by anzhe0629 »

kate wrote:
If the flag USE_MPIF90 is set, it will be looking for "mpif90".
Is USE_MPIF90 set?
USE_MPI90 is off.
In ~/Bin/build.sh

# setenv USE_MPI on
# setenv USE_MPI90 on
# setenv which_MPI mpich
# setenv which_MPI mpich2
# setenv which_MPI openmpi

Also, the USE_OpenMP is turned off.


What do you get from the command "which mpif90"?
When I run which mpi90, it shows
/usr/bin/mpif90
If you are trying for a serial run first, what does "which gfortran" give you?
it shows
/usr/bin/gfortran

Post Reply