[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #LMM-782306]: issues bulding NetCDF-c



Hello Josh,

My apologies for the delay in responding; I've been out of the office.

The C++ library is an interface for the core C library; it doesn't replicate 
the functionality. As a result, yes, you will need to install netCDF-C first 
for it to link against.  

Regarding the errors you're seeing, it looks like perhaps you've pulled down 
the `master` or a different development branch.  These branches assume that a 
developer has `m4` and `bison` available, so that source files can be generated 
on the fly as need be.  If you download the source code for a release 
(http://github.com/Unidata/netcdf-c/releases), the generated files should be 
present and you won't (I hope) encounter these errors.

I hope this helps, please let me know if you still encounter errors!

-Ward

> Greeting,
> 
> My name is Josh Gibson and I have been making efforts, though
> unsuccessfully, to install NetCDF using Cmake, and thus, I hope that I
> would be allowed to submit a few questions via e-mail:
> 
> 1) Although for my purposes, I need NetCDF for C++, must I first build
> and install NetCDF-C first?
> 
> I ask #1 because I have tried to install NetCDF-C++ first, and it
> requires libnetcdf. I can only assume that this means that NetCDF-C
> provides libnetcdf and thus is a prerequisite of NetCDF-C++
> 
> 2) In trying to execute a CMake Configure and Generate (I use cmake-gui),
> I receive the following:
> 
> ########################################################
> 
> CMake Error at libsrc/CMakeLists.txt:33 (add_library):
> Cannot find source file:
> 
> putget.c
> 
> Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
> .hxx .in .txx
> 
> 
> CMake Error at nc_test/CMakeLists.txt:26 (ADD_EXECUTABLE):
> Cannot find source file:
> 
> test_get.c
> 
> Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
> .hxx .in .txx
> 
> 
> CMake Error: CMake can not determine linker language for target: netcdf3
> 
> CMake Error: CMake can not determine linker language for target: nc_test
> 
> ########################################################
> 
> I have searched through the NetCDF GitHub Master repository. Putget.c
> and test_git.c had existed, but were removed in the past. But,
> in nc_test/CMakeLists.txt, test_get.c is still listed in the "SET
> (nc_test_SRC ... ) statement and putget.c is still listed in the "SET
> (libsrc_SOURCES ... ) statement.
> 
> 2a) Should I remove putget.c and test_get.c from the SET statements? Or
> will this cause the program to crash?
> 
> Thank you for your help,
> 
> Josh
> 
> Joshua Gibson, Ph.D.
> 
> Physicist 3
> Engility Corp.
> Tri-Service Research Laboratory
> JBSA-Fort Sam Houston, TX, 78234
> Office: 210-539-8289
> Cell: 940-783-2028
> 
> 


Ticket Details
===================
Ticket ID: LMM-782306
Department: Support netCDF
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.