Hello,
My name is Darren Dale, I am a staff scientist at the Cornell High Energy
Synchrotron Source, a national research facility funded by the NSF. I am
evaluating HDF5 version 1.8, and was wondering if I could get a pointer on
compiling the library on Windows with MinGW.
I am attempting to build hdf5-1.8.1 on windows XP, using MinGW32-5.1.4 and
MSYS-1.0.11. I'm running into two problems when I run make:
make[1]: Entering directory `/home/darren/hdf5-1.8.1/test'
/bin/sh ../libtool --tag=CC --mode=link gcc -o testhdf5.exe testhdf5.o
tarray.o tattr.o tchecksum.o tconfig.o tfile.o tgenprop.o th5o.o th5s.o
tcoords.o theap.o tid.o titerate.o tmeta.o tmisc.o trefer.o trefstr.o
tselect.o tskiplist.o tsohm.o ttime.o ttst.o tunicode.o tvlstr.o tvltypes.o
libh5test.la ../src/libhdf5.la -lm
libtool: link: gcc -o .libs/testhdf5.exe testhdf5.o tarray.o tattr.o
tchecksum.o tconfig.o tfile.o tgenprop.o th5o.o th5s.o tcoords.o theap.o
tid.o titerate.o tmeta.o tmisc.o trefer.o trefstr.o tselect.o tskiplist.o
tsohm.o ttime.o ttst.o tunicode.o tvlstr.o tvltypes.o ./.libs/libh5test.a
../src/.libs/libhdf5.a
./.libs/libh5test.a(h5test.o):h5test.c:(.text+0xd3d): undefined reference to
`WSAStartup@8'
./.libs/libh5test.a(h5test.o):h5test.c:(.text+0xd70): undefined reference to
`WSACleanup@0'
./.libs/libh5test.a(h5test.o):h5test.c:(.text+0xd83): undefined reference to
`WSACleanup@0'
collect2: ld returned 1 exit status
make[1]: *** [testhdf5.exe] Error 1
make[1]: Leaving directory `/home/darren/hdf5-1.8.1/test'
make: *** [all-recursive] Error 1
I checked the contents of MinGW/include/winsock.h, which does include
WSAStartup and WSACleanup, so I'm having trouble identifying the source of
the problem. I modified the ifdefs in h5test.c to look for something sure to
not be defined (_WIN320 instead of _WIN32), and then make continues until it
gets to:
make[2]: Entering directory `/home/darren/hdf5-1.8.1/perform'
gcc -DHAVE_CONFIG_H -I. -I../src -I../src -I../test -I../tools/lib -DNDEBUG
-UH5_DEBUG_API -MT sio_engine.o -MD -MP -MF .deps/sio_engine.Tpo -c -o
sio_engine.o sio_engine.c
sio_engine.c: In function `sio_create_filename':
sio_engine.c:398: error: too many arguments to function `mkdir'
make[2]: *** [sio_engine.o] Error 1
make[2]: Leaving directory `/home/darren/hdf5-1.8.1/perform'
make[1]: *** [all-local] Error 2
make[1]: Leaving directory `/home/darren/hdf5-1.8.1'
make: *** [all-recursive] Error 1
I was able to work around this by modifing perform/sio_engine.c:
#ifdef _WIN32
if (mkdir(fullname) < 0 && errno != EEXIST) {
/* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory.
* Default to PREFIX's original prefix value. */
strcpy(fullname, prefix);
}
#endif
#ifndef _WIN32
if (mkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST) {
/* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory.
* Default to PREFIX's original prefix value. */
strcpy(fullname, prefix);
}
#endif
and then make was able to finish. When I then run "make test", all the tests
pass until it attempts to testerror.sh:
Testing testerror.sh
···
============================
testerror.sh Test Log
Testing err_compat
*FAILED*
Expected result differs from actual result
*** ./testfiles/err_compat_1 Thu May 29 12:38:33 2008
--- ./err_compat.out Sun Jul 27 14:28:03 2008
***************
*** 1,7 ****
#############################
Expected output for err_compat
#############################
! Testing error API based on data I/O
All error API tests passed.
This program tests the Error API compatible with HDF5 version
(number). There're supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
--- 1,7 ----
#############################
Expected output for err_compat
#############################
! Testing error API based on data I/O
All error API tests passed.
This program tests the Error API compatible with HDF5 version
(number). There're supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
Testing error_test
*FAILED*
Expected result differs from actual result
*** ./testfiles/error_test_1 Thu May 29 12:38:33 2008
--- ./error_test.out Sun Jul 27 14:28:07 2008
***************
*** 1,7 ****
#############################
Expected output for error_test
#############################
! Testing error API based on data I/O
All error API tests passed.
This program tests the Error API. There're supposed to be some
error messages
********* Print error stack in HDF5 default way *********
Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
--- 1,11 ----
#############################
Expected output for error_test
#############################
! Testing error API based on data I/O
*FAILED*
! at error_test.c:355 in test_long_desc()...
! *FAILED*
! at error_test.c:604 in main()...
! ***** ERROR TEST FAILED! *****
This program tests the Error API. There're supposed to be some
error messages
********* Print error stack in HDF5 default way *********
Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
***************
*** 29,31 ****
--- 33,46 ----
#002: (file name) line (number) in H5Dwrite(): not a dataset
major: Invalid arguments to routine
minor: Inappropriate type
+ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
+ #000: (file name) line (number) in H5Ewalk2(): can't walk error
stack
+ major: Error API
+ minor: Unable to list node
+ #001: (file name) line (number) in H5E_walk(): can't walk error
stack
+ major: Error API
+ minor: Unable to list node
+ Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
+ #002: (file name) line (number) in test_long_desc(): Testing very
long description string,
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKL
+ major: Error in test
+ minor: Error in subroutine
make[4]: *** [testerror.sh.chkexe_] Error 1
make[4]: Leaving directory `/home/darren/hdf5-1.8.1/test'
make[3]: *** [build-check-s] Error 2
make[3]: Leaving directory `/home/darren/hdf5-1.8.1/test'
make[2]: *** [test] Error 2
make[2]: Leaving directory `/home/darren/hdf5-1.8.1/test'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/darren/hdf5-1.8.1/test'
make: *** [check-recursive] Error 1
I'm sorry for the excessive length of this report. Could anyone offer some
suggestions on how I can improve the compilation?
Thank you,
Darren