problem in finding netcdf library with cmake

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem in finding netcdf library with cmake

Ufuk Turuncoglu
Hi,

First of all, i am new to cmake and i would like to use it in my current
project. So, i need to use netcdf library in my project and i am using
VTK's FindNetCDF.cmake for it. The content of my CMakeLists.txt file as
follows,

cmake_minimum_required (VERSION 2.6)

# The project name
project (REGESM)

# The version number
set (REGESM_VERSION_MAJOR 2)
set (REGESM_VERSION_MINOR 0)

# Add bld/ directory to cmake module path
set(REGESM_CMAKE_DIR "${REGESM_SOURCE_DIR}/bld")
set(CMAKE_MODULE_PATH ${REGESM_CMAKE_DIR} ${CMAKE_MODULE_PATH})

# Use VTK's NetCDF interface
find_package (NetCDF COMPONENTS F90)
include_directories(${NETCDF_F90_INCLUDE_DIRS})

but when i run the cmake command, i am getting following error,

-- Failed to find NetCDF interface for F90
-- Could NOT find NetCDF (missing: NETCDF_LIBRARIES NETCDF_INCLUDE_DIRS
NETCDF_HAS_INTERFACES)
CMake Error: The following variables are used in this project, but they
are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
NETCDF_F90_INCLUDE_DIR (ADVANCED)
    used as include directory in directory /RS/users/turuncu/DEV/RegESM2
    used as include directory in directory /RS/users/turuncu/DEV/RegESM2

in my case the netcdf library is installed and i could use it externally
without any problem. i don't think but to be sure, is it necessary to
install netcdf with special options to use it under cmake. i also define
a set of environment variables but it could not help.

NETCDF_LIBRARY=/RS/progs/netcdf/4.4.0/intel/2017u5/lib
NETCDF_HOME=/RS/progs/netcdf/4.4.0/intel/2017u5
NETCDF_ROOT=/RS/progs/netcdf/4.4.0/intel/2017u5
NETCDF_INCLUDE_DIR=/RS/progs/netcdf/4.4.0/intel/2017u5/include
NETCDF4_ROOT=/RS/progs/netcdf/4.4.0/intel/2017u5
NETCDF=/RS/progs/netcdf/4.4.0/intel/2017u5

So, any suggestion will help to me at this point.

Best Regards,

--ufuk

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake