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

[netCDF #BQG-446925]: Netcdf error in macOS High Serria



Hello,

Did mac-ports install the netcdf.h file?  What happens if you modify it to 
#include <netcdf.h> ?

-Ward

> Hello there,
> 
> I have installed netcdf-c++ in my Mac (version 10.13.6) using mac-port with 
> the following features (results from nc-config —all):
> 
> This netCDF 4.6.1 has been built with the following features:
> 
> --cc        -> /usr/bin/clang
> --cflags    -> -I/opt/local/include
> --libs      -> -L/opt/local/lib -lnetcdf -lhdf5_hl -lhdf5 -lz -ldl -lm -lcurl
> 
> --has-c++   -> no
> --cxx       ->
> 
> --has-c++4  -> yes
> --cxx4      -> /usr/bin/clang++
> --cxx4flags -> -I/opt/local/include -I/opt/local/include -DNDEBUG
> --cxx4libs  -> -L/opt/local/lib -lnetcdf_c++4 -lnetcdf
> 
> --has-fortran-> no
> --has-dap   -> yes
> --has-dap2  -> yes
> --has-dap4  -> yes
> --has-nc2   -> yes
> --has-nc4   -> yes
> --has-hdf5  -> yes
> --has-hdf4  -> no
> --has-logging-> no
> --has-pnetcdf-> no
> --has-szlib -> no
> --has-cdf5 -> no
> --has-parallel-> no
> 
> --prefix    -> /opt/local
> --includedir-> /opt/local/include
> --libdir    -> /opt/local/lib
> --version   -> netCDF 4.6.1
> 
> 
> Mac-port itself added the path in the .profile file as follows:
> # MacPorts Installer addition on 2018-04-27_at_16:02:59: adding an 
> appropriate PATH variable for use with MacPorts.
> export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
> # Finished adapting your PATH environment variable for use with MacPorts.
> 
> I am linking the libraries through cmake as:
> target_link_libraries(${TARGET} -lnetcdf_c++4)
> 
> But while compiling I get the following error:
> fatal error:
> 'netcdf' file not found
> #include <netcdf>
> ^~~~~~~~
> 1 error generated.
> 
> Please help me in this regard.
> 
> Thanks in advance.
> 
> Pawan
> 
> 
> 
> 


Ticket Details
===================
Ticket ID: BQG-446925
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.