[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Support #KXN-708789]: How to intall and compile program with netcdf



> Dear Russ,
> Thanks for the reply. I have installed the netcdf.dll, netcdf.lib, ncgen.exe, 
> ncdump.exe in my windows/system32 folder. I downloaded these files from 
> NetCDF for other Fortran compilers (win32_vs_f2c_dll_4.0.1). Then I 
> downloaded binary-netcdf-3.6.3_nc3_gfortran_gfortran_c++.tar file. And from 
> this folder I copied only netcdf.mod, typesizes.mod to the location where I 
> have my source file simple_xy_wr.f90. And from the folder I included 
> netcdf.inc file in my header files using my IDE.
> With these settings I am trying to compile the sample source code but I am 
> getting following error:
> Fatal Error: Reading module netcdf at line 22 column 27: Expected string
> make[2]: *** [build/Debug/Cygwin-Windows/simple_xy_wr.o] Error 1
> make[1]: *** [.build-conf] Error 2
> make: *** [.build-impl] Error 2
> BUILD FAILED (exit value 2, total time: 1s)
> 
> The complete report of my IDE is as:
> 
> /usr/bin/make -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
> make[1]: Entering directory `/cygdrive/d/PhD/netbeans/CppApplication_2'
> /usr/bin/make  -f nbproject/Makefile-Debug.mk 
> dist/Debug/Cygwin-Windows/cppapplication_2.exe
> make[2]: Entering directory `/cygdrive/d/PhD/netbeans/CppApplication_2'
> mkdir -p build/Debug/Cygwin-Windows
> gfortran.exe   -c -g -o build/Debug/Cygwin-Windows/simple_xy_wr.o 
> simple_xy_wr.f90
> make[2]: Leaving directory `/cygdrive/d/PhD/netbeans/CppApplication_2'
> make[1]: Leaving directory `/cygdrive/d/PhD/netbeans/CppApplication_2'
> Fatal Error: Reading module netcdf at line 22 column 27: Expected string
> make[2]: *** [build/Debug/Cygwin-Windows/simple_xy_wr.o] Error 1
> make[1]: *** [.build-conf] Error 2
> make: *** [.build-impl] Error 2
> BUILD FAILED (exit value 2, total time: 1s)

I'm guessing that the version of gfortran you are using is having trouble 
reading the
netcdf.mod module file generated by an older gfortran used for the June 2008 
Linux 
binary distribution.  I'm also not certain that the gfortran .mod files are 
platform-independent, so that a Linux .mod file could be used on a win32 
platform.

A way to verify this guess would be to use your gfortran compiler to build 
netCDF from
source, including the Fortran-90 interface, then try using the netcdf.mod file 
that process
generates.  I don't have a Windows/cygwin platform on which to try that (nor 
any Windows
expertise), but it's possible one of the two developers with cygwin could try 
that and make
the .mod files available.  In the mean time, please let us know if you decide 
to try building 
from source and get things working that way.

--Russ

> Hi,
> 
> > I very new to fortran and netcdf. I have cygwin installed
> > on my pc. I want to run sample program available at
> >
> > http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-tutorial/simple_005fxy_005fwr_002ef90.html#simple_005fxy_005fwr_002ef90.
> >
> > Kindly can someone guide me step by step how should I install first
> > netcdf binaries and then run the sample program.
> 
> Here's advice on installing netCDF version 4.1.1 on a Windows system
> that has cygwin installed:
> 
> http://www.unidata.ucar.edu/netcdf/docs/faq.html#windows_netcdf4
> 
> NetCDF (including the Fortran-90 API) reportedly builds and works well
> under Cygwin, using the gfortran compiler.  If you have the cygwin
> environment installed, you should be able to just follow the instructions
> for building under Linux, which is basically
> 
> 1.  Get the source and unpack it
> 2.  Set some environment variables for the cC and Fortran compilers
> 3.  Run the "configure" script with appropriate options.  If you
> only need the netCDF-3 APIs, for example, you could use
> "--disable-netcdf-4".
> 4.  Run "make all check" to compile the libraries and utilities and
> check them. This will include compiling and checking the
> examples, such as simple_xy_wr.f90.
> 5.  Run "make install" to install the libraries and utilities, to
> make it easier to compile and link applications.
> 
> --Russ
> 
> Russ Rew                                         UCAR Unidata Program
> address@hidden                      http://www.unidata.ucar.edu
> 
> 
> 
> Ticket Details
> ===================
> Ticket ID: KXN-708789
> Department: Support netCDF
> Priority: Normal
> Status: Closed

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: KXN-708789
Department: Support netCDF
Priority: Normal
Status: Closed