Re: [netcdfgroup] [Hdf-forum] netCDF 4.3 Release Candidate available --- CMake build in Windows

Hi Ward

Here are some suggestions that hopefully will help you to build a more robust CMake build

I am sending this as well to the HDF list, since there are often CMake posts on it


I will take a look to see how CMake handles Windows environmental variables;

The environmental variables issue is not a show stopper, I can use just a regular path

an impromptu test shows that (in the MSYS shell, at least)

A suggestion is to make the Windows CMake build on the Windows shell.
Many Unix tools that may be assumed existent are just not existent on the Windows shell.

I think this is the cause of these errors:

Since I don't have curl installed, I tried

cmake .. -DCMAKE_INSTALL_PREFIX=W:\netcdf_install -DCMAKE_PREFIX_PATH=T:\hdf5_install_1.8.10 -D"ENABLE_DAP=OFF"


Output is

CMake Error: Parse error in cache file W:/netcdf-4.3.0-rc3_2/build_dir/CMakeCache.txt. Offending entry: for command: UNAME-NOTFOUND -s-CreateProcessError: The system cannot find th
e file specified.
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)

Both of these are Unix .

Why the need for a Pkg-Config dependency on a CMake builld ?
If not needed, these should be taken off


Then

HDF5_ROOT_DIR-NOTFOUND/hdf5-config.cmake
Call Stack (most recent call first):
 CMakeLists.txt:75 (INCLUDE)

How can I specify "HDF5_ROOT_DIR" ?

Shouldn't the -DCMAKE_PREFIX_PATH=T:\hdf5_install_1.8.10 be the same ?

Then, finally

- CMake Summary:

--      Build Type:                     DEBUG
--      Building Shared Libraries:      ON
--      Building netCDF-4:              ON
--      Building DAP Support:           OFF
--      Building Utilities:             ON
--      CMake Prefix Path:              T:\hdf5_install_1.8.10
--      Using pnetcdf:                  OFF,
--      Using Parallel IO:              OFF
-- Linking against: T:/hdf5_install_1.8.10/lib/hdf5dll.lib;T:/hdf5_install_1.8.10/lib/hdf5_hldll.lib;T:/hdf5_install_1.8.10/lib/zlib.lib

-- Configuring incomplete, errors occurred!


I did try to install a Pkg-Config port for Win32, I'll send the results in a separate email


------
Pedro Vicente, Earth System Science
University of California, Irvine
http://www.ess.uci.edu/


----- Original Message ----- From: "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
To: "Pedro Vicente" <pvicente@xxxxxxx>
Cc: "HDF Users Discussion List" <hdf-forum@xxxxxxxxxxxx>; <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Monday, March 18, 2013 8:47 AM
Subject: Re: [Hdf-forum] [netcdfgroup] netCDF 4.3 Release Candidate available --- CMake build in Windows


Good morning Pedro,

On 3/18/13 4:16 AM, Pedro Vicente wrote:
Hi Ward

If your hdf5 libraries are installed in W:\hdf5_install, for example, you would specify the following argument:

-DCMAKE_PREFIX_PATH=W:\hdf5_install


The way I make Visual Studio be aware of libraries/headers is by means of Windows environment variables
for example

$HEADER_HDF5
Is defined for me  as
T:\hdf5\hdf5\src
and
$LIB_HDF5
as
T:\hdf5\hdf5\proj\hdf5\Debug\hdf5d.lib

1) Is it possible to do this with the supplied CMake projects, point to environment variables instead of an install path ?

My HDF5 header/libs are always "development" locations, that I use for debugging, not pre built binary distributions.

I will take a look to see how CMake handles Windows environmental variables; an impromptu test shows that (in the MSYS shell, at least) CMake does not automatically pick up environmental variables. I was able to specify the libraries/header locations manually on the command line, however:

$ cmake .. -DZLIB_LIBRARY=/c/share/x64/shared/lib/zlib.lib \
   -DCURL_LIBRARY=/c/share/x64/shared/lib/libcurl_imp.lib \
   -DHDF5_HL_LIB=/c/share/x64/shared/lib/hdf5_hldll.lib \
   -DHDF5_LIB=/c/share/x64/shared/lib/hdf5dll.lib \
   -DHDF5_INCLUDE_DIR=/c/share/x64/shared/include/ \
   -DCURL_INCLUDE_DIR=/c/share/x64/shared/include/ \
   -G"Visual Studio 10 Win64"

The same arguments should work from a default Windows command.exe shell, using standard Windows path syntax.


2) I did try a pre built binary distribution for this case, the latest HDF5 built with CMake from here, this one


http://www.hdfgroup.org/HDF5/release/obtain5.html#bin

Windows (64-bit)
 Compilers:
   CMake VS 2010 C, C++, IVF 12

<.....>

Since you are using the 64-bit libraries, I think you need to specify the 64-bit Visual Studio generator via the '-G' flag, e.g. -G"Visual Studio 10 Win64". When I specify this flag, the fist few lines appear as follows:

-- The C compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10 Win64
-- Check for working C compiler using: Visual Studio 10 Win64 -- works
-- Detecting C compiler ABI info

I suspect it is not finding the hdf5 and curl libraries because it is looking for 32-bit versions of the libraries, not 64. This is something that should be clarified in the documentation; thanks for pointing this out! I'll also add a section on manually specifying dependencies instead of letting CMake determine them automatically.

Thanks, have a great day,

-Ward


-- Building for: Visual Studio 10
-- The C compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10
-- Check for working C compiler using: Visual Studio 10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
CMake Error at cmake/modules/windows/FindHDF5.cmake:83 (INCLUDE):
 include could not find load file:

   HDF5_ROOT_DIR-NOTFOUND/hdf5-config.cmake
Call Stack (most recent call first):
 CMakeLists.txt:75 (INCLUDE)


-- T:/hdf5_install_1.8.10/lib/hdf5dll.lib, T:/hdf5_install_1.8.10/lib/hdf5_hldll.lib, T:/hdf5_install_1.8.10/include -- Found ZLIB: T:/hdf5_install_1.8.10/lib/zlib.lib (found version "1.2.7")
-- Could NOT find CURL (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:417 (MESSAGE):
 DAP Support specified, CURL libraries are not found.


-- Configuring incomplete, errors occurred!


Thanks



------
Pedro Vicente, Earth System Science
University of California, Irvine
http://www.ess.uci.edu/


----- Original Message ----- From: "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
To: "Pedro Vicente" <pvicente@xxxxxxx>
Cc: <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Friday, March 15, 2013 8:36 AM
Subject: Re: [netcdfgroup] netCDF 4.3 Release Candidate available --- CMake build in Windows


Hi Pedro,

If your hdf5 libraries are installed in W:\hdf5_install, for example, you would specify the following argument:

-DCMAKE_PREFIX_PATH=W:\hdf5_install

CMake would then check this location first when looking for any header and library files. The netCDF build will use the zlib library included with the hdf5 binary distribution. If you do not have this, or if it is installed elsewhere, you can specify multiple search locations thusly:

-DCMAKE_PREFIX_PATH="W:\hdf5_install;W:\zlib_install".

I hope this helps!

-Ward

On 3/14/13 7:04 PM, Pedro Vicente wrote:
Hi Ward

I tried to build in Windows with CMake, using


cmake -DCMAKE_INSTALL_PREFIX=W:\netcdf_install

I get these messages


-- Building for: Visual Studio 10
-- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
-- HDF5_LIB-NOTFOUND, HDF5_HL_LIB-NOTFOUND, HDF5_INCLUDE_DIR-NOTFOUND
-- Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Error at CMakeLists.txt:403 (MESSAGE):
 HDF5 Support specified, cannot find ZLib.


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:
HDF5_INCLUDE_DIR
  used as include directory in directory W:/netcdf_svn
  used as include directory in directory W:/netcdf_svn
  used as include directory in directory W:/netcdf_svn
  used as include directory in directory W:/netcdf_svn

-- Configuring incomplete, errors occurred!


How can I make the supplied CMake projects to detect my HDF5 and zlib locations?

Thanks

Pedro


------
Pedro Vicente, Earth System Science
University of California, Irvine
http://www.ess.uci.edu/


----- Original Message ----- From: "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
To: <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Tuesday, February 26, 2013 5:04 PM
Subject: [netcdfgroup] netCDF 4.3 Release Candidate available


Good afternoon all,

We are officially announcing the availability of the netCDF-C libraries version 4.3.0, release candidate 2.

Documentation and source downloads are available at:

http://www.unidata.ucar.edu/downloads/netcdf/netcdf-rc/index.jsp

Pre-built Windows binaries are available at:

http://www.unidata.ucar.edu/software/netcdf/docs_rc/winbin.html

The previous Windows-specific website, http://www.unidata.ucar.edu/netcdf/win_netcdf/ will redirect to this new location. Please note that these pre-built libraries (both 32 & 64-bit) are built and tested on 64-bit Windows 7 using Visual Studio 10.

Highlights of the 4.3 release include:

o Many bug fixes.
o Improved DAP support.
o Improved parallel-netcdf support.
o Improved Windows support.
o Integration of CMake, allow for Visual-Studio based builds.

This release candidate is the precursor to either a new release candidate, or the final 4.3.0 release (depending on the number and severity of bugs reported). As always, we welcome any bug reports and/or feedback!

Have a great evening,

-Ward
Ward Fisher
wfisher@xxxxxxxxxxxxxxxx

_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/





_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@xxxxxxxxxxxx
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org





  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: