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

[netCDF #FVX-268880]: Help requested with building NetCDF on Windows, specifically producing .c files from .m4 in Windows

Hello Andy,

Regarding the lack of the test_get.c, etc, in rc2, that was a bug.  It should 
have been fixed in rc3 and 4.5.0 full release, coming out (hopefully) today.  

Regarding m4 on Windows: Windows support was only added around 5 years ago, and 
netCDF has been around since the late 80's.  The m4 tool was already entrenched 
in netCDF, and it would be a large undertaking to remove it.  We could add the 
generated files to version control, but that runs counter to standard/best 
practices with GitHub, and is messy since we work on a number of different 
platforms.  The generated files are, I've found, sometimes very platform 

You can download the m4 executable for Windows here:

* https://www.gnu.org/software/m4/m4.html

This is what I use.  As long as it is in your system path, cmake should find it 
just fine.  Alternatively, you could install the MSYS shell; unlike cygwin, it 
does not install a *nix subsystem, but it does provide common linux tools (like 
m4 and bash) for use in a Windows environment.

I hope this helps,


> Hi,
> I have been in correspondence with unidata previously on this. I am
> trying to build the NetCDF library on the Windows environment from the
> online NetCDF repository.
> We are using CMake in order to try and build the NetCDF library that
> will produce the .vcxproj files that will be used in Visual Studio to
> build NetCDF.
> The problem is that the NetCDF CMake build process uses m4 for which there
> is no good source of this library in Windows. m4 is used for generating
> the .c files.
> In my previous correspondence it was suggested that we try the branch
> 'v4.5.0-rc2-prep'. This does solve the top problem with putget.m4 with a
> file included in this branch called putget.c. However this doesn't solve
> the problem of nc_test/test_get.m4 for which there is no equivalent .c
> file in this branch.
> Could you please tell us the method you use to generate the .c file
> from the .m4 file for use in Windows, so that we may generate the .c
> for test_get.m4 and any further files that need to be generated from
> the .m4 format.
> This is acting as a real blocker for us, as we need to build a Windows
> version of our application which uses NetCDF, and this will need to be
> solved in one way or another. This is for building the Windows application
> that runs in our project 'climateprediction.net', this is hosted in the
> UK and is used by many climate scientists worldwide for running climate
> simulations, including in the US.
> With regards,
> Andy Bowery
> Oxford e-Research Centre
> University of Oxford
> 7 Keble Road, Oxford, OX1 3QG
> www.oerc.ox.ac.uk

Ticket Details
Ticket ID: FVX-268880
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.