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

[netCDF #THR-683655]: Need Help Building NETCDF on Windows



Hello James,

The link you found, 
http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#netCDF-CMake,
 should be applicable for Windows as well as Linux, when using the command 
line.   I'm sorry for the frustration; it is not a simple process, but I think 
we can help get things working on Windows.  I appreciat the link to the HDF 
group's documentation; I will take a look at it and take a pass at cleaning 
up/revising the cmake instructions specific for Windows.

I will note that cmake-gui is referenced at times because our primary community 
(educators) prefer to minimize the amount of CLI work they have to do.  There's 
no reason we can provide both, however.

Assuming `cmake.exe` is on your path, you would invoke cmake as follows (from 
the command prompt).   I will use `C:\>` below for brevity, but I assume you're 
starting in a dedicated 'build' directory, and not the top level of the netcdf 
source directory.  

C:\> cmake [path to top-level netcdf source directory] 
-DCMAKE_PREFIX_PATH=[path to HDF5, other dependency libraries if they are not 
on the standard system path] -DCMAKE_INSTALL_PREFIX=[Path to desired install 
root location] -G"[Visual Studio version being used]"

e.g. (from my builds)

C:\> cmake g:\netcdf-c -DCMAKE_PREFIX_PATH=c:\share\x64\ 
-DCMAKE_INSTALL_PREFIX=c:\Users\Ward\bin -G"Visual Studio 12 Win64"

Does this help you in the short term, while I work at updating the 
documentation? If not, what may I further clarify, if you are running into 
problems? 

Thanks for your time, I hope this at least starts to help,

-Ward


> I'm having an unexpected amount of difficulty building NETCDF for
> Windows, using "cmake".
> 
> I need to do this, because we're running with a newer version of HDF5
> (1.10.0_patch1).  I have previously accomplished the HDF5 build on
> windows via cmake (the hdfgroup's relatively straight-forward and and
> up-to-date directions may be found here
> <https://support.hdfgroup.org/HDF5/release/cmakebuild5110.html>) - and
> considering the initial discussion of cmake w/NETCDF - I wasn't expected
> a lot of trouble.
> 
> I have found however, that the cmake discussion for NETCDF (found here
> <http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#netCDF-CMake>
> and here
> <http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#cmake_faq>) -
> covers Linux.  Considering that there's a perfectly functional linux
> build method that uses "configure" - and "cmake" seems like the only
> game around on windows - that choice is strange and quite frustrating. :-(
> 
> I did find a windows specific discussion of netcdf and cmake here
> <https://www.unidata.ucar.edu/software/netcdf/workshops/2012/windows/netCDF-C%20for%20Windows.pdf>
> - but the 2012 content is dated and I'm having a lot of trouble making
> that procedure work.  I would also observe that the HDF5 approach of
> driving setup and full builds with ".bat" files seems a better choice
> than use of "cmake-gui".   It's not enough to simply get a build working
> once - I need something that is reliably repeatable without anyone
> needing to remember setup parameters.
> 
> Do you have a better or more current procedure for building NETCDF on
> Windows?
> 
> I really, really wish that your documentation and procedure for building
> with cmake followed the approach used by the hdfgroup. Their
> presentation and process is both more complete and simple to follow -
> besides being something your users are apt to have already experienced.
> 
> Thanks...
> 
> -jrm
> 
> James Mason
> Exa Corporation
> Burlington, MA
> 
> 
> 


Ticket Details
===================
Ticket ID: THR-683655
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.