Make error

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Make error

#1 Unread post by justina0622 »

Hi, I am a beginner in ROMS. And I am trying to install ROMS in the cluster. Here is the error:
master jus/ROMS> make
makefile:235: INCLUDING FILE /home/jus/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
which: no ifort in (/opt/kde3/bin:/opt/gnome/bin:/usr/games:/usr/bin/X11:/usr/bin:/bin:/usr/sbin:/sbin:/opt/pathscale/bin)
cp -f /opt/intelsoft/netcdf4/include/netcdf.mod Build
cp: cannot stat `/opt/intelsoft/netcdf4/include/netcdf.mod': No such file or directory

It seems there is no ifort in the following directory. What should I do? Can anyone give some advice?

Thank you!!
Qianqian@URI

alazhar
Posts: 18
Joined: Wed Dec 03, 2008 2:06 pm
Location: PML

Re: Make error

#2 Unread post by alazhar »

First, you should make sure that 'ifort' compiler and 'netcdf' library already installed in your machine and find the path where those two things were installed . Then, set those paths to the xxx-ifort.mk file (e.g. Linux-ifort.mk if you use linux) in Compiler subdirectory.

More information can be read from the Wiki ROMS:
https://www.myroms.org/wiki/index.php/C ... nd_Linking


cheers,
al

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: Make error

#3 Unread post by justina0622 »

alazhar wrote:First, you should make sure that 'ifort' compiler and 'netcdf' library already installed in your machine and find the path where those two things were installed . Then, set those paths to the xxx-ifort.mk file (e.g. Linux-ifort.mk if you use linux) in Compiler subdirectory.

More information can be read from the Wiki ROMS:
https://www.myroms.org/wiki/index.php/C ... nd_Linking


cheers,
al
Thank you very much! I will have a try.

Have a nice day.
:)
Qianqian@URI

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: Make error

#4 Unread post by justina0622 »

I installed netcdf and changed the paths in Linux-ifort.mk.
Then I came back to ROMS.
However, here comes another problem.

[q@master ROMS]$ make
makefile:235: INCLUDING FILE /home/q/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cp -f /home/q/ROMS/netcdf-4.0.1/include/netcdf.mod Build
cp: cannot stat `/home/q/ROMS/netcdf-4.0.1/include/netcdf.mod': No such file or directory
make: *** [Build/netcdf.mod] Error 1

It seems there is no netcdf.mod in the directory of netcdf-4.0.1 nor directory of include.

I think I have installed netcdf correctly.
with
tar -zxvf netcdf-4.0.1.tar.gz
cd netcdf-4.0.1
export FC=ifort; export "FFLGS"="-heap-arrays-fp-model precise"
./configure
make
check make

Anyone know what's the problem?

Thank you.
alazhar wrote:First, you should make sure that 'ifort' compiler and 'netcdf' library already installed in your machine and find the path where those two things were installed . Then, set those paths to the xxx-ifort.mk file (e.g. Linux-ifort.mk if you use linux) in Compiler subdirectory.

More information can be read from the Wiki ROMS:
https://www.myroms.org/wiki/index.php/C ... nd_Linking


cheers,
al
Qianqian@URI

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

Re: Make error

#5 Unread post by kate »

When you build NetCDF, it will build the C library. It will check your compilers and if it finds a suitable C++ compiler, it will compile that interface as well. Ditto for Fortran 77, ditto for Fortran 90. During the configure phase, it will have told you whether it was successful for each of these. If it didn't build the file netcdf.mod, you will have to go back and coax it into compiling the Fortran 90 interface. You exported FC, try also F90, maybe even F77 too. I think NetCDF uses all three...

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

Re: Make error

#6 Unread post by m.hadfield »

justina0622 wrote: I think I have installed netcdf correctly with
tar -zxvf netcdf-4.0.1.tar.gz
cd netcdf-4.0.1
export FC=ifort; export "FFLGS"="-heap-arrays-fp-model precise"
./configure
make
check make
As Kate has said, go back over the configure logs and see whether a Fortran 90 compiler was found and the Fortran 90 interface built. (The lack of a netcdf.mod suggests it wasn't.)

If the above commands were cut and pasted from the command window you built netCDF with (and if they weren't they should have been, so that we know exactly what you did) then there are several issues:
  • FFLGS should be FFLAGS, and shouldn't have quotation marks around it.
  • "check make" should be "make check".
  • You will normally want to pass the same options to the Fortran compiler while building the F90 interface as when building the F77 interface, since they will normally be the same compiler. For the F90 interface, the environment variable you need is FCFLAGS (if I recall correctly). For F77 it is FFLAGS.
  • You should pass the --enable-fortran option to configure
  • The environment variables passed to configure aren't needed by the subseuqent calls to make, so you can specifiy them on the configure command line
So I suggest your configure command should be

FC=ifort FFLAGS="-heap-arrays-fp-model precise" FCFLAGS="-heap-arrays-fp-model precise" ./configure --enable-fortran

Edit: removed a couple of stray quotation marks
Last edited by m.hadfield on Wed Mar 17, 2010 4:50 am, edited 1 time in total.

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: Make error

#7 Unread post by justina0622 »

kate wrote:When you build NetCDF, it will build the C library. It will check your compilers and if it finds a suitable C++ compiler, it will compile that interface as well. Ditto for Fortran 77, ditto for Fortran 90. During the configure phase, it will have told you whether it was successful for each of these. If it didn't build the file netcdf.mod, you will have to go back and coax it into compiling the Fortran 90 interface. You exported FC, try also F90, maybe even F77 too. I think NetCDF uses all three...
Thank you very much. I will try. :D :D
Qianqian@URI

justina0622
Posts: 23
Joined: Fri Jan 29, 2010 6:17 pm
Location: GSO URI

Re: Make error

#8 Unread post by justina0622 »

m.hadfield wrote:
justina0622 wrote: I think I have installed netcdf correctly with
tar -zxvf netcdf-4.0.1.tar.gz
cd netcdf-4.0.1
export FC=ifort; export "FFLGS"="-heap-arrays-fp-model precise"
./configure
make
check make
As Kate has said, go back over the configure logs and see whether a Fortran 90 compiler was found and the Fortran 90 interface built. (The lack of a netcdf.mod suggests it wasn't.)

If the above commands were cut and pasted from the command window you built netCDF with (and if they weren't they should have been, so that we know exactly what you did) then there are several issues:
  • FFLGS should be FFLAGS, and shouldn't have quotation marks around it.
  • "check make" should be "make check".
  • You will normally want to pass the same options to the Fortran compiler while building the F90 interface as when building the F77 interface, since they will normally be the same compiler. For the F90 interface, the environment variable you need is FCFLAGS (if I recall correctly). For F77 it is FFLAGS.
  • You should pass the --enable-fortran option to configure
  • The environment variables passed to configure aren't needed by the subseuqent calls to make, so you can specifiy them on the configure command line
So I suggest your configure command should be

FC=ifort FFLAGS"="-heap-arrays-fp-model precise" FCFLAGS"="-heap-arrays-fp-model precise" ./configure --enable-fortran
Thank you. :D
Qianqian@URI

Post Reply