Windows上用Intel编译netCDF-Fortran
1.下载并安装netCDF-C
https://downloads.unidata.ucar.edu/netcdf/
安装目录D:\software\netCDF4.9.2
2.下载netCDF-Fortran
3.编译netCDF-Fortran
(1)解压源代码netcdf-fortran-4.6.1.zip到D:\software\netcdf-fortran-4.6.1\source
(2)打开 Intel oneAPI command prompt for Intel 64 for Visual Studio
cd D:/software/netcdf-fortran-4.6.1\
(3)用cmake生成项目
新建目录Release
cmake -S source -B build-release -DCMAKE_BUILD_TYPE:STRING=RELEASE -DnetCDF_LIBRARIES=D:/software/netCDF4.9.2/lib/netcdf.lib -DnetCDF_INCLUDE_DIR=D:/software/netCDF4.9.2/include -DCMAKE_INSTALL_PREFIX=D:/software/netcdf-fortran-4.6.1/Release
(4)编译
cmake --build build-release --target netcdff netcdff_c --config Release cd build-release\fortran lib netcdff.dir\Release\*.obj netcdff_c.dir\Release\netcdff_c.lib /out:Release\netcdff.lib cd ..\..\ cmake --build build-release --target ALL_BUILD --config Release cmake --build build-release --target INSTALL --config Release