Problems compiling as DLLs

Hi,

I previously was successful in building HDF v1.8 from the git
repository as a static library using CMake, but I need to build it as
a shared DLL (and in Windows x64) and I'm having problems. I'm getting
a bunch of linker errors like: cannot open file
'..\bin\Debug\hdf5_D.lib' and indeed there are no .libs. I've checked
BUILD_SHARED_LIBS in CMake.

In the list archives I found this by John Biddiscombe on Nov/19/2009:

=== BEGIN QUOTE ===

Had to work on something else this morning, but the dynamic lib
building was broken for win32, so I have made a couple of changes.
Just FYI

This works fine for setting the export dll flags in the hdf5 dll
SET_PROPERTY(TARGET hdf5 APPEND PROPERTY COMPILE_DEFINITIONS
_HDF5_HLDLL_EXPORTS_)

But you also need to add _HDF5USEDLL_ to every target that links
against it - which includes those outside of the project to force dll
import status, the easiest way is simply to skip the target properties
and add the stuff below to the config.cmake.in The "BUILD_SHARED_LIBS"
is replaced by H5_xxx in configure and "hdf5_EXPORTS" is set by cmake
for the library itself, and for all other projects we get the use dll
alternative if build shared is set. (I know Mike already know this
stuff, but maybe the others are interested - incidentally, if
cmakeification messages are cluttering the list up undesirably, then
please say and we'll keep cmake related stuff to ourselves unless we
need clarification of anything).

#cmakedefine BUILD_SHARED_LIBS
#if defined(H5_BUILD_SHARED_LIBS)
# if defined (hdf5_EXPORTS)
# define _HDF5DLL_
# else
# define _HDF5USEDLL_
# endif
#endif

== END QUOTE ==

However, I can't find a config.cmake.in file and if I just create one
it doesn't seem to help.

-John

The git repository is going through a lot of changes. There was a time
when the windows dll builds were not working due to some code changes.
I would highly recommend you use the svn repo published by the hdf
group as that is the official source code repository. Anything on the
gitorious server should be considered not supported. If you are
specificially looking for the cmake build support the there is a cmake
branch of the subversion hosted by the hdf group. Again since it is a
branch it may or may not build correctly.

···

-----
Mike Jackson www.bluequartz.net
Principal Software Engineer mike.jackson@bluequartz.net
BlueQuartz Software Dayton, Ohio

On May 3, 2010, at 21:14, John Kua <jkua@eecs.berkeley.edu> wrote:

Hi,

I previously was successful in building HDF v1.8 from the git
repository as a static library using CMake, but I need to build it as
a shared DLL (and in Windows x64) and I'm having problems. I'm getting
a bunch of linker errors like: cannot open file
'..\bin\Debug\hdf5_D.lib' and indeed there are no .libs. I've checked
BUILD_SHARED_LIBS in CMake.

In the list archives I found this by John Biddiscombe on Nov/19/2009:

=== BEGIN QUOTE ===

Had to work on something else this morning, but the dynamic lib
building was broken for win32, so I have made a couple of changes.
Just FYI

This works fine for setting the export dll flags in the hdf5 dll
SET_PROPERTY(TARGET hdf5 APPEND PROPERTY COMPILE_DEFINITIONS
_HDF5_HLDLL_EXPORTS_)

But you also need to add _HDF5USEDLL_ to every target that links
against it - which includes those outside of the project to force dll
import status, the easiest way is simply to skip the target properties
and add the stuff below to the config.cmake.in The "BUILD_SHARED_LIBS"
is replaced by H5_xxx in configure and "hdf5_EXPORTS" is set by cmake
for the library itself, and for all other projects we get the use dll
alternative if build shared is set. (I know Mike already know this
stuff, but maybe the others are interested - incidentally, if
cmakeification messages are cluttering the list up undesirably, then
please say and we'll keep cmake related stuff to ourselves unless we
need clarification of anything).

#cmakedefine BUILD_SHARED_LIBS
#if defined(H5_BUILD_SHARED_LIBS)
# if defined (hdf5_EXPORTS)
# define _HDF5DLL_
# else
# define _HDF5USEDLL_
# endif
#endif

== END QUOTE ==

However, I can't find a config.cmake.in file and if I just create one
it doesn't seem to help.

-John

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

I'm probably just being stupid/blind, but I can't seem to find a link
to the SVN repository - could someone post a link? Thanks.

-John

Never mind, found it:

http://svn.hdfgroup.uiuc.edu/hdf5

-John

···

On Tue, May 4, 2010 at 9:49 AM, John Kua <jkua@eecs.berkeley.edu> wrote:

I'm probably just being stupid/blind, but I can't seem to find a link
to the SVN repository - could someone post a link? Thanks.

-John

The link is http://svn.hdfgroup.uiuc.edu/hdf5/branches/hdf5_1_8_cmake/

Please be aware that it is a work in progress. Some things may be broken.

Cmake support for Windows should be available in the 1.8.5 release (mid-June 2010).

Elena

···

On May 4, 2010, at 11:53 AM, John Kua wrote:

Never mind, found it:

http://svn.hdfgroup.uiuc.edu/hdf5

-John

On Tue, May 4, 2010 at 9:49 AM, John Kua <jkua@eecs.berkeley.edu> wrote:

I'm probably just being stupid/blind, but I can't seem to find a link
to the SVN repository - could someone post a link? Thanks.

-John

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

Thanks, everyone.

I just checked out the cmake branch (SVN revision 18696) and it worked
great. I look forward to the 1.8.5 release.

-John

Hello everyone,

Our first attempt at an HDF5 v1.8.4 rpm is now available at
ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots/RPMS/v18, either
hdf5-1.8.4.snap19-1.el5.i386.rpm or hdf5-1.8.4.snap19-1.el5.x86_64.rpm.
They install in /usr by default, but are relocatable. There are also szip
v2.1 rpms available in
ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/hdf5/snapshots/RPMS. The hdf5 rpms
require szip, zlib, and zlib-devel packages.

There is one problem that we need to fix, but the README file in the v18
directory provides a workaround. The problem is that the compile scripts,
h5cc, h5fc and h5c++, in the rpm have a block of three lines that will be
correct if installed in the default /usr/bin location, but incorrect if
relocated. The three replacement lines and instructions as to where to put
them are at the bottom of the README file.

We plan to add rpms for each weekly snapshot until we have a release
candidate, and hope to have an official 1.8.5 rpm at or soon after the time
of the 1.8.5 release.

The rpms have been tested on 32 and 64 bit rhel5 and fedora core 8 linux for
root and non-root install. Please let us know if anything doesn't work or
conform to your expectations for rpm files.

Thanks!

Larry Knox

The HDF Group