Error during RNNLib configuration: netcdfcpp.h cannot be found

不问归期 提交于 2019-12-08 01:08:58

问题


When attempting to compile RNNLib, I got an error in NetcdfDataset.hpp:26:24 saying that Netcdfcpp.h could not be found. I looked around and found a bug report from 2011 that suggested that this was a bug, but it claimed to have been fixed. I have tried everything I can think of, including rebuilding NetCDF (a dependency of RNNLib) with various different flags, and have been unable to fix this bug. Can anyone give me a hand?


回答1:


I had some trouble on a virtual machine building rnnlib. I had to install the C and C++ version of NetCDF to get it to work.

The C version can be installed via sudo apt-get install libnetcdf-dev

I had to install the C++ version by building it.

Hope it will help. It's quite a difficult lib to install.




回答2:


The newest version doesn't have this netcdfcpp.h file anymore. I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working.




回答3:


Maybe this helps someone: you can avoid some of the pain by installing packages from APT, and access the correct version mentioned by user3620756, which contains the netcdfcpp.h header file . This happens through a legacy package, available on Ubuntun 16.04 (Xenial universe, see APT repository).

First install libnetcdf for C, then install libnetcdf-cxx-legacy-dev which should depend on libnetcdf-c++4 and install required C++ libraries on the go:

sudo apt install libnetcdf-dev libnetcdf-cxx-legacy-dev



回答4:


I have also followed the same process and it worked for me "The newest version doesn't have this netcdfcpp.h file anymore. I had to use ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-cxx-4.2.tar.gz to get it working." After downloading the folder, I had to build it by entering into the netcdf folder. I used simple command for the task : .\configure make sudo make install

But in the file named as "NetcdfDataset.hpp", I have to give the complete path of the netcdfcpp.h file. For my case the path of the include file is :

#include "/Volumes/Macintosh_HD_2/WordSpottingProj/trunk/CODE C++/rnnlib_source_forge_version/netcdf-cxx-4.2/cxx/netcdfcpp.h"



回答5:


I had this problem in the context of trying to use a makefile that called for netcdfcpp.h:

$ make -f makefile_MAC
c++ -O2 -o burn7.x burn7.cpp -I/opt/local/include -L/opt/local/lib -lm -lnetcdf_c++
burn7.cpp:31:10: fatal error: 'netcdfcpp.h' file not found
#include <netcdfcpp.h>
     ^
1 error generated.
make: *** [burn7.x] Error 1

I'm on a Mac, so I used Homewbrew to install the NetCDF package, but version 4.3.3.1 didn't appear to have netcdfcpp.h:

brew install homebrew/science/netcdf

However, I found that installing it with an additional flag resulted in this version being included:

brew install homebrew/science/netcdf --with-cxx-compat

I assume that the same is true of other installation/compilation methods, and not that this file has been taken out of versions since 4.2 as others answers state. Maybe it was a default option before and now it isn't?



来源:https://stackoverflow.com/questions/23156567/error-during-rnnlib-configuration-netcdfcpp-h-cannot-be-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!