NETCDF compilation of source code on Windows

Source: Internet
Author: User

Zhu Jinchan

Source: http://blog.csdn.net/clever101

Today to engage in NETCDF source code on the Windows compilation, toss a half-day, is made, specially record the process. My goal is to generate NETCDF project files. NETCDF relies on the three libraries of Hdf5, zlib, and curl.

First download the latest HDF5 source code in HDF5 source codes, and then use CMake to generate a solution for compiling hdf5, such as:


Then download NetCDF Source: NetCDF Downloads, start using CMake to generate NetCDF solutions, such as:


An error occurred after clicking the Configure button:

CMake Error at cmakelists.txt:525 (find_package):

Could not find a package configuration file provided by ' HDF5 ' with any of

thefollowing names:

Hdf5config.cmake

Hdf5-config.cmake

You need to configure the path of the Hdf5 CMake, as follows:

Then configure the zlib path, locate the Netcdf-4.4.0\cmake\modules\findzlib.cmake, and modify the

Find_path (Zlib_include_dir zlib.h

"e:\\thirdpartybuild\\zlib-1.2.8" # Specifies the path of the Zlib.h

PATHS

$ENV {Zlib_root}

Path_suffixes

Include

)

SET (zlib_names z ZLIB zdll zlib1 zlibdzlibd1)

Find_library (zlib_library

NAMES

${zlib_names}

PATHS

"E:\\thirdpartybuild\\zlib-1.2.8\\vs\\release" # Specifies the path to the zlib library file

$ENV {Zlib_root}

Path_suffixes

Lib

)

Remove netcdf-4.4.0\cmakelists.txt settings about the Curl library (why should I remove it?) Because I looked for half a day, did not find the CMake file to set the Curl Library), specifically

# IF (not curl_library)

# MESSAGE (fatal_error "DAP support specified, CURL libraries is notfound.")

# ENDIF ()

And

# add_subdirectory (liblib)

Commented out in two places.

Then click Configure and generate two buttons to generate the NETCDF project file. The resulting NetCDF.sln engineering netcdf3 and NETCDF4 are the project files that compile the NETCDF library.

NETCDF compilation of source code on Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.