首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何阅读netcdf4 MinGW?

如何阅读netcdf4 MinGW?
EN

Stack Overflow用户
提问于 2021-02-03 03:46:23
回答 1查看 61关注 0票数 0

为了将您放在上下文中,我正在尝试检查一种算法(称为DINEOF),该算法可以填充光栅时间序列中缺失的数据。算法是用Fortran编写的,我学会了在Win10上运行它需要使用MinGW。

目前,我正在尝试遵循这个指导原则:http://modb.oce.ulg.ac.be/mediawiki/index.php/DINEOF_for_Windows,但是,我发现自己正在为这一步而苦苦挣扎:

代码语言:javascript
复制
./configure  --disable-netcdf-4  --disable-dap  > config.log
make > make.log
make check > check.log
make install

错误/警告消息:

代码语言:javascript
复制
$ ./configure  --disable-netcdf-4  --disable-dap  > config.log
configure: WARNING: Doxygen not found - documentation will not be built
configure: WARNING: dot not found - will use simple charts in documentation
configure: WARNING: netcdf-4 not enabled; disabling DAP4
代码语言:javascript
复制
$ make > make.log
In file included from ../include/ncdispatch.h:14:0,
                 from dparallel.c:9:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
 extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
            ^
make[2]: *** [libdispatch_la-dparallel.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
代码语言:javascript
复制
$ make check > check.log
In file included from ../include/ncdispatch.h:14:0,
                 from dparallel.c:9:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
 extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
            ^
make[1]: *** [libdispatch_la-dparallel.lo] Error 1
make: *** [check-recursive] Error 1
EN

回答 1

Stack Overflow用户

发布于 2021-02-14 19:33:44

您使用的指令是用于构建NetCDF 4.5.0的,但最新版本是4.7.4,它可以使用cmake构建。对我来说,以下是来自http://winlibs.com/的GCC 10.2.0的作品(前提条件是存在):

代码语言:javascript
复制
wget -c https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz
tar xfz netcdf-c-4.7.4.tar.gz
cd netcdf-c-4.7.4

# fix conflicting getopt in include/XGetopt.h
mv include/XGetopt.h include/XGetopt.h.bak &&
echo "#include <getopt.h>" > include/XGetopt.h

cmake.exe -Wno-dev -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=../../netcdf_build -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_DLL:BOOL=ON -DENABLE_DLL:BOOL=ON -DENABLE_CDF5:BOOL=OFF -DENABLE_HDF4:BOOL=ON -DENABLE_XGETOPT:BOOL=OFF -DENABLE_MMAP:BOOL=OFF -DENABLE_LOGGING:BOOL=OFF -DENABLE_EXAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=OFF -DBUILD_TESTSETS:BOOL=OFF -DENABLE_EXTRA_TESTS:BOOL=OFF -DENABLE_LARGE_FILE_TESTS:BOOL=OFF -DENABLE_FILTER_TESTING:BOOL=OFF -DENABLE_HDF4_FILE_TESTS:BOOL=OFF -DENABLE_TESTS:BOOL=OFF -DENABLE_UNIT_TESTS:BOOL=OFF -DCMAKE_C_FLAGS:STRING="-fcommon" -S. -Bbuild_shared &&
make -Cbuild_shared install/strip &&
echo SUCCESS
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66016614

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档