Problem compiling HDF5 using CMAKE with HDF5_ENABLE_PARALLEL


#1

Hi everyone.

I am new to CMAKE, and I tried to use it to compile HDF5, including the HDF5_ENABLE_PARALLEL option. To do so:

  • I downloaded the hdf5-1.12.1.tar file.
  • Within it, I created a build folder, in which I move.
  • I then used cmake -DHDF5_ENABLE_PARALLEL=ON -DMAKE_INSTALL_PREFIX=${PWD}/install, which returns the following output:
-- The C compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for include file sys/file.h
-- Looking for include file sys/file.h - found
-- Looking for include files sys/file.h, sys/ioctl.h
-- Looking for include files sys/file.h, sys/ioctl.h - found
-- Looking for 3 include files sys/file.h, ..., sys/resource.h
-- Looking for 3 include files sys/file.h, ..., sys/resource.h - found
-- Looking for 4 include files sys/file.h, ..., sys/socket.h
-- Looking for 4 include files sys/file.h, ..., sys/socket.h - found
-- Looking for 5 include files sys/file.h, ..., sys/stat.h
-- Looking for 5 include files sys/file.h, ..., sys/stat.h - found
-- Looking for 6 include files sys/file.h, ..., sys/time.h
-- Looking for 6 include files sys/file.h, ..., sys/time.h - found
-- Looking for 7 include files sys/file.h, ..., sys/types.h
-- Looking for 7 include files sys/file.h, ..., sys/types.h - found
-- Looking for 8 include files sys/file.h, ..., features.h
-- Looking for 8 include files sys/file.h, ..., features.h - found
-- Looking for 9 include files sys/file.h, ..., dirent.h
-- Looking for 9 include files sys/file.h, ..., dirent.h - found
-- Looking for 10 include files sys/file.h, ..., setjmp.h
-- Looking for 10 include files sys/file.h, ..., setjmp.h - found
-- Looking for 11 include files sys/file.h, ..., stddef.h
-- Looking for 11 include files sys/file.h, ..., stddef.h - found
-- Looking for 12 include files sys/file.h, ..., stdint.h
-- Looking for 12 include files sys/file.h, ..., stdint.h - found
-- Looking for 13 include files sys/file.h, ..., unistd.h
-- Looking for 13 include files sys/file.h, ..., unistd.h - found
-- Looking for 14 include files sys/file.h, ..., io.h
-- Looking for 14 include files sys/file.h, ..., io.h - not found
-- Looking for 14 include files sys/file.h, ..., winsock2.h
-- Looking for 14 include files sys/file.h, ..., winsock2.h - not found
-- Looking for 14 include files sys/file.h, ..., globus/common.h
-- Looking for 14 include files sys/file.h, ..., globus/common.h - not found
-- Looking for 14 include files sys/file.h, ..., pdb.h
-- Looking for 14 include files sys/file.h, ..., pdb.h - not found
-- Looking for 14 include files sys/file.h, ..., pthread.h
-- Looking for 14 include files sys/file.h, ..., pthread.h - found
-- Looking for 15 include files sys/file.h, ..., srbclient.h
-- Looking for 15 include files sys/file.h, ..., srbclient.h - not found
-- Looking for 15 include files sys/file.h, ..., string.h
-- Looking for 15 include files sys/file.h, ..., string.h - found
-- Looking for 16 include files sys/file.h, ..., strings.h
-- Looking for 16 include files sys/file.h, ..., strings.h - found
-- Looking for 17 include files sys/file.h, ..., stdlib.h
-- Looking for 17 include files sys/file.h, ..., stdlib.h - found
-- Looking for 18 include files sys/file.h, ..., memory.h
-- Looking for 18 include files sys/file.h, ..., memory.h - found
-- Looking for 19 include files sys/file.h, ..., dlfcn.h
-- Looking for 19 include files sys/file.h, ..., dlfcn.h - found
-- Looking for 20 include files sys/file.h, ..., inttypes.h
-- Looking for 20 include files sys/file.h, ..., inttypes.h - found
-- Looking for 21 include files sys/file.h, ..., netinet/in.h
-- Looking for 21 include files sys/file.h, ..., netinet/in.h - found
-- Looking for 22 include files sys/file.h, ..., netdb.h
-- Looking for 22 include files sys/file.h, ..., netdb.h - found
-- Looking for 23 include files sys/file.h, ..., arpa/inet.h
-- Looking for 23 include files sys/file.h, ..., arpa/inet.h - found
-- Looking for 24 include files sys/file.h, ..., stdbool.h
-- Looking for 24 include files sys/file.h, ..., stdbool.h - found
-- Looking for include file quadmath.h
-- Looking for include file quadmath.h - found
-- Looking for ceil in m;
-- Looking for ceil in m; - found
-- Looking for dlopen in dl;m
-- Looking for dlopen in dl;m - found
-- Looking for WSAStartup in ws2_32;m;dl
-- Looking for WSAStartup in ws2_32;m;dl - not found
-- Looking for gethostbyname in wsock32;m;dl
-- Looking for gethostbyname in wsock32;m;dl - not found
-- Looking for gethostname in ucb;m;dl
-- Looking for gethostname in ucb;m;dl - not found
-- Looking for lseek64
-- Looking for lseek64 - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Performing Test HAVE_STAT64_STRUCT
-- Performing Test HAVE_STAT64_STRUCT - Success
-- Looking for stat64
-- Looking for stat64 - found
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of unsigned
-- Check size of unsigned - done
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of __int64
-- Check size of __int64 - failed
-- Check size of float
-- Check size of float - done
-- Check size of double
-- Check size of double - done
-- Check size of long double
-- Check size of long double - done
-- Check size of int8_t
-- Check size of int8_t - done
-- Check size of uint8_t
-- Check size of uint8_t - done
-- Check size of int_least8_t
-- Check size of int_least8_t - done
-- Check size of uint_least8_t
-- Check size of uint_least8_t - done
-- Check size of int_fast8_t
-- Check size of int_fast8_t - done
-- Check size of uint_fast8_t
-- Check size of uint_fast8_t - done
-- Check size of int16_t
-- Check size of int16_t - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of int_least16_t
-- Check size of int_least16_t - done
-- Check size of uint_least16_t
-- Check size of uint_least16_t - done
-- Check size of int_fast16_t
-- Check size of int_fast16_t - done
-- Check size of uint_fast16_t
-- Check size of uint_fast16_t - done
-- Check size of int32_t
-- Check size of int32_t - done
-- Check size of uint32_t
-- Check size of uint32_t - done
-- Check size of int_least32_t
-- Check size of int_least32_t - done
-- Check size of uint_least32_t
-- Check size of uint_least32_t - done
-- Check size of int_fast32_t
-- Check size of int_fast32_t - done
-- Check size of uint_fast32_t
-- Check size of uint_fast32_t - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of uint64_t
-- Check size of uint64_t - done
-- Check size of int_least64_t
-- Check size of int_least64_t - done
-- Check size of uint_least64_t
-- Check size of uint_least64_t - done
-- Check size of int_fast64_t
-- Check size of int_fast64_t - done
-- Check size of uint_fast64_t
-- Check size of uint_fast64_t - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - done
-- Check size of ptrdiff_t
-- Check size of ptrdiff_t - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of off64_t
-- Check size of off64_t - done
-- Check size of time_t
-- Check size of time_t - done
-- Check size of _Bool
-- Check size of _Bool - done
-- Looking for CLOCK_MONOTONIC
-- Looking for CLOCK_MONOTONIC - not found
-- Performing Test H5_HAVE_TM_GMTOFF
-- Performing Test H5_HAVE_TM_GMTOFF - Success
-- Performing Test H5_HAVE___TM_GMTOFF
-- Performing Test H5_HAVE___TM_GMTOFF - Failed
-- Performing Test H5_TIME_WITH_SYS_TIME
-- Performing Test H5_TIME_WITH_SYS_TIME - Success
-- Performing Test H5_HAVE_STRUCT_TIMEZONE
-- Performing Test H5_HAVE_STRUCT_TIMEZONE - Failed
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Performing Test H5_HAVE_STAT_ST_BLOCKS
-- Performing Test H5_HAVE_STAT_ST_BLOCKS - Success
-- Looking for ioctl
-- Looking for ioctl - found
-- Performing Test H5_HAVE_STRUCT_VIDEOCONFIG
-- Performing Test H5_HAVE_STRUCT_VIDEOCONFIG - Failed
-- Performing Test H5_HAVE_STRUCT_TEXT_INFO
-- Performing Test H5_HAVE_STRUCT_TEXT_INFO - Failed
-- Looking for _getvideoconfig
-- Looking for _getvideoconfig - not found
-- Looking for gettextinfo
-- Looking for gettextinfo - not found
-- Looking for _scrsize
-- Looking for _scrsize - not found
-- Looking for GetConsoleScreenBufferInfo
-- Looking for GetConsoleScreenBufferInfo - not found
-- Looking for TIOCGWINSZ
-- Looking for TIOCGWINSZ - found
-- Looking for TIOCGETD
-- Looking for TIOCGETD - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for alarm
-- Looking for alarm - found
-- Looking for fcntl
-- Looking for fcntl - found
-- Looking for flock
-- Looking for flock - found
-- Looking for fork
-- Looking for fork - found
-- Looking for frexpf
-- Looking for frexpf - found
-- Looking for frexpl
-- Looking for frexpl - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for getrusage
-- Looking for getrusage - found
-- Looking for llround
-- Looking for llround - not found
-- Looking for llroundf
-- Looking for llroundf - not found
-- Looking for lround
-- Looking for lround - not found
-- Looking for lroundf
-- Looking for lroundf - not found
-- Looking for lstat
-- Looking for lstat - found
-- Looking for pread
-- Looking for pread - found
-- Looking for pwrite
-- Looking for pwrite - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for random
-- Looking for random - found
-- Looking for round
-- Looking for round - not found
-- Looking for roundf
-- Looking for roundf - not found
-- Looking for setsysinfo
-- Looking for setsysinfo - not found
-- Looking for signal
-- Looking for signal - found
-- Looking for longjmp
-- Looking for longjmp - found
-- Looking for setjmp
-- Looking for setjmp - found
-- Looking for siglongjmp
-- Looking for siglongjmp - found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - not found
-- Looking for sigprocmask
-- Looking for sigprocmask - found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for srandom
-- Looking for srandom - found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for symlink
-- Looking for symlink - found
-- Looking for system
-- Looking for system - found
-- Looking for tmpfile
-- Looking for tmpfile - found
-- Looking for asprintf
-- Looking for asprintf - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for waitpid
-- Looking for waitpid - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for sigsetjmp
-- Looking for sigsetjmp - found
-- Looking for difftime
-- Looking for difftime - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for clock_gettime in posix4
-- Looking for clock_gettime in posix4 - not found
-- Check size of __float128
-- Check size of __float128 - done
-- Check size of _Quad
-- Check size of _Quad - failed
-- Testing maximum decimal precision for C - 21;33;
-- maximum decimal precision for C var - 33
-- Found Perl: /usr/bin/perl (found version "5.30.0") 
-- ....All Warnings are enabled
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) 
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find MPI (missing: MPI_C_FOUND)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindMPI.cmake:1688 (find_package_handle_standard_args)
  CMakeLists.txt:712 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/barrier/Libs/netcdf_par/hdf5-1.12.1/build/CMakeFiles/CMakeOutput.log".
See also "/home/barrier/Libs/netcdf_par/hdf5-1.12.1/build/CMakeFiles/CMakeError.log".

However, when I run the same command a second time, I have:

-- Testing maximum decimal precision for C - 21;33;
-- maximum decimal precision for C var - 33
-- ....All Warnings are enabled
-- Found MPI_C: /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Looking for MPI_Comm_c2f
-- Looking for MPI_Comm_c2f - found
-- Looking for MPI_Info_c2f
-- Looking for MPI_Info_c2f - found
-- Looking for MPI_Mprobe
-- Looking for MPI_Mprobe - found
-- Looking for MPI_Imrecv
-- Looking for MPI_Imrecv - found
-- Looking for MPI_Get_elements_x
-- Looking for MPI_Get_elements_x - found
-- Looking for MPI_Type_size_x
-- Looking for MPI_Type_size_x - found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/barrier/Libs/netcdf_par/hdf5-1.12.1/build

Can everyone tell me why I need to invoke cmake twice to make it find MPI_C?

I use cmake version 3.16.3 and Ubuntu 20.04.2 LTS

Thanks a lot.

Nicolas


#2

Hello Nicolas,

The other day, I encountered the same problem. I have filed an issue about it (see https://github.com/HDFGroup/hdf5/issues/833). Together with the HDF group we found the problem and fixed it. It turns out to be a small mistake in one of their CMake files. The pull request https://github.com/HDFGroup/hdf5/pull/843 contains the fix.

Best regards,
Jan-Willem