netCDF 3.6.2, Ubuntu 7.10, 32bit, Intel Fortran

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

netCDF 3.6.2, Ubuntu 7.10, 32bit, Intel Fortran

#1 Unread post by drewa »

I have installed Intel ifort 10.0.026 on a Ubuntu system. It tests fine with a "hello world" program and I added the path to 'ifort' into .bashrc. I believe I built netCDF 3.6.2 correctly (i.e. the nctest seems to work). I compiled it via:

./configure FC90=/opt/intel/fc/10.0.026/ifort

The make test and make install both seemed to work right.

My Linux-ifort.mk file seems to have the correct netCDF paths

NETCDF_INCDIR ?= /usr/local/include
NETCDF_LIBDIR ?= /usr/local/lib

I'm not using the ARPACK, MPI, or MCT, so the paths there shouldn't matter.

When I go to make the ROMS file, I get this error sequence:

makefile:226: INCLUDING FILE Build/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cd Build; ifort -c -ip -O3 -pc80 -xW -free mod_netcdf.f90
fortcom: Error: mod_netcdf.f90, line 19: This module file was not generated by any release of this compiler. [NETCDF]
USE netcdf
------------^
fortcom: Error: mod_netcdf.f90, line 21: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 22: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 23: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_TYPE = nf90_double
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 21: This name does not have a type, and must have an explicit type. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 22: This name does not have a type, and must have an explicit type. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
----------------------------------------^
compilation aborted for mod_netcdf.f90 (code 1)
make: *** [Build/mod_netcdf.o] Error 1

I am at a loss to what's going on here. Anyone have a good idea what's up? Thanks

nganju
Posts: 82
Joined: Mon Aug 16, 2004 8:47 pm
Location: U.S. Geological Survey, Woods Hole
Contact:

#2 Unread post by nganju »

In my case, those errors arose when the netcdf libraries are built with a different compiler than the one you are using to compile ROMS. Perhaps you can check the netcdf website for successful build output for your system, and make sure the libraries were built correctly. other than that, i have no idea...good luck

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

#3 Unread post by kate »

When building and testing netcdf, make sure it passes the F90 tests as well as the F77 tests. Most likely, it failed to find an f90 compiler it was happy with and decided to skip it. You can tell this because you won't end up with a netcdf.mod file in the include directory. Also, during the configure phase, it will tell you it's skipping f90 in the text that's whizzing by.

drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

#4 Unread post by drewa »

Nganju and Kate, I thought that I was specifying the compiler like this in the configure:

./configure FC90=/opt/intel/fc/10.0.026/ifort

but I did see ifort = no in the long list of things that scroll by. I have turned off all other fortran compilers, hoping that it would only see the ifort compiler.

Here's why I'm trying to go this route. I have been able to get the ROMS version to compile using the netCDF and gfortran Synaptic builds. I would like to use the ROMS-AGRIF version but it's not working and I was thinking that compiling completely under ifort may fix things.

So, does my plan make sense? If so, how can I get it to find and use the ifort compiler? I assume that it's something quite simple but I've been drawing blanks for about a week now.

Thanks again.

linzhenhua
Posts: 64
Joined: Mon Oct 17, 2005 2:02 am
Location: Institute of Oceanology,Chinese Academy of Sciences

#5 Unread post by linzhenhua »

It seems that the fortran compiler should be specified by the environmental variable F90 instead of FC90.

crode1968
Posts: 13
Joined: Thu Oct 28, 2004 6:58 pm
Location: Danish Meteorological Institute

#6 Unread post by crode1968 »

If you have compiled both ROMS and the netCDF library with the Intel ifort compiler (in my case Version 10.x) and your error persists you might append the -lnetcdff switch in ./Compilers/Linux-ifort.mk, so that

Code: Select all

 LIBS := -L$(NETCDF_LIBDIR) -lnetcdf 
becomes

Code: Select all

 LIBS := -L$(NETCDF_LIBDIR) -lnetcdff -lnetcdf 

baum

#7 Unread post by baum »

You need to specify the F90 compiler with BOTH the F90 and FC environment variables if you wish to compile NetCDF with a specific compiler. The current (3.6.2) version of NetCDF doesn't recognize the FC90 variable, so in the absence of an F90 specification (i.e. F90 and FC) it searched for the first F90 compiler it could recognize. I suspect that the configure script looked for and found gfortran/g95 on your Ubuntu platform and compiled NetCDF using that. Your error messages make sense if we assume that you're attempting to link NetCDF libraries created using gfortran/g95 with ROMS libraries created using ifort.

drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

#8 Unread post by drewa »

I changed the F90 to FC in the configure line but netCDF is still not installing. I get through the configure with what seems to me to be no problems (i.e. nothing glaring wrong in the config.log file other than it choking on the GNU Fortran and GNU Fortran 77 compilers).

Where it now goes south is in the make. I sent off some questions to Unidata but I'm hopeful that some of y'all have seen errors like this before.

Thanks yet again.

****************************************************************
root@drew-linux:/home/drew/Programs/Downloads/netcdf-3.6.2# make
make all-recursive
make[1]: Entering directory `/home/drew/Programs/Downloads/netcdf-3.6.2'
Making all in f90
make[2]: Entering directory `/home/drew/Programs/Downloads/netcdf-3.6.2/f90'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/drew/Programs/Downloads/netcdf-3.6.2/f90'
Making all in fortran
make[2]: Entering directory `/home/drew/Programs/Downloads/netcdf-3.6.2/fortran'
make all-am
make[3]: Entering directory `/home/drew/Programs/Downloads/netcdf-3.6.2/fortran'
depbase=`echo fort-attio.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
if /bin/bash ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I../libsrc -g -O2 -MT fort-attio.lo -MD -MP -MF "$depbase.Tpo" -c -o fort-attio.lo fort-attio.c; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
libtool: compile: cc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I../libsrc -g -O2 -MT fort-attio.lo -MD -MP -MF .deps/fort-attio.Tpo -c fort-attio.c -o fort-attio.o
In file included from ncfortran.h:12,
from fort-attio.c:7:
cfortran.h:138:3: error: #error "cfortran.h: Can't find your environment among: - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...) - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000 - VAX VMS CC 3.1 and FORTRAN 5.4. - Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0. - Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2 - Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7. - CRAY - NEC SX-4 SUPER-UX - CONVEX - Sun - PowerStation Fortran with Visual C++ - HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730 - LynxOS: cc or gcc with f2c. - VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77. - f77 with vcc works; but missing link magic for f77 I/O. - NO fort. None of gcc, cc or vcc generate required names. - f2c : Use #define f2cFortran, or cc -Df2cFortran - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran - Absoft Pro Fortran: Use #define AbsoftProFortran - Portland Group Fortran: Use #define pgiFortran - PathScale Fortran: Use #define PATHSCALE_COMPILER"
make[3]: *** [fort-attio.lo] Error 1
make[3]: Leaving directory `/home/drew/Programs/Downloads/netcdf-3.6.2/fortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/drew/Programs/Downloads/netcdf-3.6.2/fortran'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/drew/Programs/Downloads/netcdf-3.6.2'
make: *** [all] Error 2

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

#9 Unread post by kate »

As Steve pointed out, you need both F90 and FC defined. As for the other, add CPPFLAGS=-DpgiFortran to the mix.

drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

#10 Unread post by drewa »

Thanks a lot. I think that I'm getting closer. I was able to get through configure, make, make check, and make install. The configure that went through was:

./configure FC=/opt/intel/fc/10.0.026/bin/ifort FC90=/opt/intel/fc/10.0.026/bin/ifort CPPFLAGS=-DpgiFortran

Now the ROMS make isn't behaving. I'm getting these errors which look to me like it's not finding what I just installed.

In the Linux-ifort.mk file, I point to the right netCDF include and library directories.

NETCDF_INCDIR ?= /usr/local/include
NETCDF_LIBDIR ?= /usr/local/lib

***********************************************************

drew@drew-linux:~/ROMSintel$ make
makefile:226: INCLUDING FILE Build/make_macros.mk WHICH CONTAINS APPLICATION-DEPENDENT MAKE DEFINITIONS
cd Build; /opt/intel/fc/10.0.026/bin/ifort -c -ip -O3 -pc80 -xW -free mod_netcdf.f90
fortcom: Error: mod_netcdf.f90, line 19: This module file was not generated by any release of this compiler. [NETCDF]
USE netcdf
------------^
fortcom: Error: mod_netcdf.f90, line 21: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 22: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 23: This symbol must be a defined parameter or an argument of an inquiry function that evaluates to a compile-time constant. [NF90_DOUBLE]
integer, parameter :: NF_TYPE = nf90_double
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 21: This name does not have a type, and must have an explicit type. [NF90_REAL]
integer, parameter :: NF_FOUT = nf90_real
----------------------------------------^
fortcom: Error: mod_netcdf.f90, line 22: This name does not have a type, and must have an explicit type. [NF90_DOUBLE]
integer, parameter :: NF_FRST = nf90_double
----------------------------------------^
compilation aborted for mod_netcdf.f90 (code 1)
make: *** [Build/mod_netcdf.o] Error 1
Last edited by drewa on Wed Jan 30, 2008 8:00 pm, edited 1 time in total.

baum

#11 Unread post by baum »

1. Be sure you enter "make clean"'' in your ROMS directory before recompiling.

2. Be sure you enter "make distclean" in your NetCDF source directory before recompiling and reinstalling.

3. Check that the location into which you installed the NetCDF libraries and the location specified in Compilers/Linux-ifort.mk are the same.

drewa
Posts: 35
Joined: Mon Dec 17, 2007 5:34 pm
Location: SCCWRP, Costa Mesa, CA

#12 Unread post by drewa »

baum, thanks for that suggestion. Cleaning up the make for netCDF and ROMS made all the difference in the world. I had a feeling that there were things from earlier attempts that might have been holding things up.

The make clean and make distclean did the trick. Ya hoo! Everyone, thank you so very much for all the help.

crode1968
Posts: 13
Joined: Thu Oct 28, 2004 6:58 pm
Location: Danish Meteorological Institute

#13 Unread post by crode1968 »

In some cases you even might experience problems with the above reported set of switches for the configure statement: Code runs and stops with Segmentation fault while it writes into the ocean_his.nc file.

In this case you might follow the instructions given by Intel to build your netCDF libraries
http://www.intel.com/support/performanc ... 027812.htm

Post Reply