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

[Staging #UWQ-633083]: [netcdfgroup] Static netcdf libraries compiled



> Hi Russ,
>
> Thanks for your response. I have some more (very basic) questions for
> you about compiling the netcdf code myself. I'm working on integrating
> netcdf into some fortran code (Hydroqual's ECOMSED) and I'm using the
> Portland Group FORTRAN Compiler. I don't have access to Portland Group's
> C compiler right now. From what I've been reading, it seems that if I
> try to compile the netcdf libraries using Visual Studio (the only C
> compiler I can get access to) I will likely run into some compatibility
> issues... (which is why I haven't tried yet).

Howdy Sarah!

I am Ed, the windows expert around here...

Firstly, you should read this:
http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#windows

There is an experimental PGI binary release referenced in the FAQ. Have you
tried it? Is that the one that isn't working for you?

If not, please do try it and let me know if it works. I don't have PG on
windows to test here...

The C library works well on windows with visual studio. Try it and see. But you
need to get the netCDF-3 snapshot release, because the windows build files were
mistakenly left out of the 3.6.2 release. Get the snapshot here:
http://www.unidata.ucar.edu/software/netcdf/builds/snapshot/

The visual studio solution file is in subdirectory win32/NET.

I have reports that MS has changed things (as usual) such that the latest
visual studio.NET no longer works. Last time I checked, that won't be released
until 2008.

I believe there is also a VS.NET 2005 release. I have not tried it, but I
believe it will work with the current netCDF solution files.

To build with the visual PGI compiler, you would need to add the fortran
directory (as a project in the existing netCDF solution file) to the build, and
use the fortran files in the fortran directory.

You would also need to take a nfconfig.inc from some system on which the
configure script works (i.e. some unix system or some unix environment on
windows.)

Finally you need to set the appropriate pre-processor symbol in the properties
list of the C library (the "netcdf" project in the VS solution file). I believe
this is now set to f2cFortran, so you would remove that from the pre-processor
symbol list.

As Russ mentioned this should be set to pgiFortran for Portland Group fortran.

Once the F77 API is working within VS, it should not be hard to add the F90 API
in the f90 subdirectory.
>
> I'm assuming that it's generally true that using a consistent product
> for compiling will minimize compatibility issues across the board, but
> do you have a sense of how easy or difficult (or impossible) it might be
> to compile Netcdf with Visual Studio and integrate those libraries with
> the Portland Group compiler? I think that I read that Visual Studio
> seems to have issues...something about COM compliance?

I think it should be pretty easy to get the fortran API working with the PG
fortran compiler within visual studio, but I can't do it for every fortran
compiler on Windows, so I don't.

The netCDF fortran API is known to compile cleanly with the portland group
fortran compilers on non-windows platforms.

>
> But wait, I can download the GNU compiler (that you referred to below)
> and give that a shot, right? If I compile the netcdf libraries with GNU,
> can I still compile the ecomsed/netcdf code with Portland? In principle,
> yes? Or should I do everything with gnu? -- I'm brainstorming here, I am
> a beginner and this is not my specialty.

This will also work, and is tested nightly. That is, you can go to
www.cygwin.com and install the cygwin port of Unix to your windows box. (It's
free). Then you can get the cygwin release of gcc (and even g77) and build
netCDF from the cygwin command line.

For this you have to be able to run your portland group fortran compiler from
the cygwin command line. Once that works, you can just set the FC environment
variable.

This will have the advantage of getting you the F77 and the F90 APIs as well.

>
> But I do appreciate your help very much!
>
> Sarah A. Widing
> Civil Engineer
> ENSR Corporation
> 2 Technology Park Drive
> Westford, MA 01886
> tel: (978) 589-3749
> fax: (978) 589-3035
> address@hidden



Thanks,

Ed

Ticket Details
===================
Ticket ID: UWQ-633083
Department: Support netCDF
Priority: Normal
Status: Closed