netcdf-c for windows - unidata · 2012-10-26 · netcdf-c for windows netcdf for new users 2012...
TRANSCRIPT
![Page 1: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/1.jpg)
NetCDF-C for Windows
NetCDF for New Users2012
Friday, October 26, 12
![Page 2: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/2.jpg)
OverviewFocus of this discussion is on building and using netCDF-C on Windows.
Multiple Windows development environments:
Cygwin
MSYS/MinGW
Visual Studio
We will focus on using CMake to build Visual-Studio compatible netCDF-C libraries.
2
Development Environments on
Windows
Unix/Unix-like environmentsunder Windows. Uses a GCC
compiler.
Cygwin MSYS/MinGW
Visual Studio
Friday, October 26, 12
![Page 3: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/3.jpg)
Getting netCDF-CLatest Stable release (4.2.1.1):
http://www.unidata.ucar.edu/downloads/netcdf
Latest Developer Snapshot:
svn co http://svn.unidata.ucar.edu/repos/netcdf/trunk
3Friday, October 26, 12
![Page 4: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/4.jpg)
Getting CMakehttp://www.cmake.org
Current version is 2.8.9.
netCDF-C requires at least CMake 2.8.8
The CMake download comes with both command line and GUI tools.
4Friday, October 26, 12
![Page 5: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/5.jpg)
Using the CMake GUIThe source directory and the build directory are typically two distinct locations.
Step 1) Set locations.
Step 2) Configure
5Friday, October 26, 12
![Page 6: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/6.jpg)
Using the CMake GUICMake will ask you to specify which ‘Generator’ to use.
Different makefile-based builds.
Visual Studio builds, specific to desired architecture.
6Friday, October 26, 12
![Page 7: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/7.jpg)
Using the CMake GUIHere we see an error; DAP is enabled by default, but the required curl libraries couldn’t be located.
7Friday, October 26, 12
![Page 8: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/8.jpg)
Using the CMake GUIUnder ‘enable’ options, we uncheck ‘ENABLE_DAP’, then re-run ‘configure’.
8Friday, October 26, 12
![Page 9: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/9.jpg)
Using the CMake GUIConfiguration was successful.
Next, we generate the project files.
9Friday, October 26, 12
![Page 10: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/10.jpg)
Compiling CMake-generated Visual Studio Projects
10Friday, October 26, 12
![Page 11: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/11.jpg)
Compiling CMake-generated Visual Studio Projects
11Friday, October 26, 12
![Page 12: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/12.jpg)
Compiling CMake-generated Visual Studio Projects
Friday, October 26, 12
![Page 13: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/13.jpg)
Compiling CMake-generated Visual Studio ProjectsOn Windows, shared libraries are not linked against directly.
‘Import Libraries’ are instead used.
What if we wanted to do this from the command line?
13Friday, October 26, 12
![Page 14: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/14.jpg)
Building netCDF-C in Windows via the Command Line
14
C:\netcdf> cmake -‐-‐build . -‐-‐target netcdf
C:\netcdf> cmake -‐-‐build .
Friday, October 26, 12
![Page 15: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/15.jpg)
Building netCDF-C in Windows via the Command Line
15Friday, October 26, 12
![Page 16: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/16.jpg)
Running NetCDF Tests in Windows
16
C:\netcdf> cmake -‐-‐build . -‐-‐target RUN_TESTS
C:\netcdf> ctest .
Friday, October 26, 12
![Page 17: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/17.jpg)
Running NetCDF Tests in Windows
17Friday, October 26, 12
![Page 18: NetCDF-C for Windows - Unidata · 2012-10-26 · NetCDF-C for Windows NetCDF for New Users 2012 Friday, October 26, 12. Overview Focus of this discussion is on building and using](https://reader030.vdocuments.us/reader030/viewer/2022040917/5e9202ee2b21a11e537d4dc1/html5/thumbnails/18.jpg)
SummaryWe have discussed
The motivation for including CMake support in netCDF-C.
Configuring, building and testing netCDF-C on Windows using CMake & Visual Studio.
GUI
Command Line
18Friday, October 26, 12