Undefined reference to OMPI_C_MPI_NULL_COPY_FN

Hello users,
I tried to install HDF5-1.8.20 with parallel support and using openmpi-4.0.0.What I did is the following:

./configure --prefix=/home/guido/libraries/compiled_with_gcc-7.3.0/hdf5-1.8.20_openmpi --enable-parallel --enable-fortran FC=/home/guido/libraries/compiled_with_gcc-7.3.0/openmpi-4.0.0/bin/mpif90 CC=/home/guido/libraries/compiled_with_gcc-7.3.0/openmpi-4.0.0/bin/mpicc CXX=/home/guido/libraries/compiled_with_gcc-7.3.0/openmpi-4.0.0/bin/mpicxx

Besides, openmpi-4.0.0 was compiled with gcc-7.3.0. The config.log does not show any error (config.log attached):
config.log (278.9 KB)

However, when I run make the following error shows up:

…/src/.libs/libhdf5.so: undefined reference to `OMPI_C_MPI_NULL_COPY_FN’
collect2: error: ld returned 1 exit status
make[1]: *** [testhdf5] Error 1
make: *** [all-recursive] Error 1

The output of lbs_release -a is:

$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.6 (Final)
Release: 6.6
Codename: Final

Do you know what is causing this error and how I can fixed ?
Cheers,

Hello!

It may be that you are running into this issue, reported earlier:
HDF5 does not compile with OpenMPI 4.0.0

Do you see these undefined references, as well?:
MPI_Type_extent, MPI_Address and MPI_Type_struct

HDF5 uses MPI functions that were deprecated since MPI 2.0. With OpenMPI 4.0, those deprecated functions were deleted. This caused the compiler to complain about missing MPI calls.

We have fixed this issue for the HDF5-1.10.5 release that we are working on.

-Barbara

Hello Barbara,
Thanks for your reply. I don’t see the extra undefined reference you mentioned. The complete make output is:

h5test.c: In function ‘h5_dump_info_object’:

h5test.c:1050:72: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]

printf(“Dumping MPI Info Object(%d) (up to %d bytes per item):\n”, (int)info,

^

In file included from h5test.c:25:0:

At top level:

H5srcdir.h:51:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir(void)

^~~~~~~~~~~~~

tarray.c: In function ‘test_array_funcs’:

tarray.c:190:10: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

size=H5Tget_precision(type);

^~~~~~~~~~~~~~~~

tarray.c:193:10: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

size=H5Tget_size(type);

^~~~~~~~~~~

tarray.c:196:10: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

size=H5Tget_ebias(type);

^~~~~~~~~~~~

tarray.c: In function ‘test_array_compound_atomic’:

tarray.c:542:39: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

wdata[i][j].f = (float)(i * 2.5F + j);

^

tarray.c:542:46: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

wdata[i][j].f = (float)(i * 2.5F + j);

^

tarray.c: In function ‘test_array_compound_array’:

tarray.c:746:44: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

wdata[i][j].f[k]=(float)(i * 10.0F + j * 2.5F + k);

^

tarray.c:746:56: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

wdata[i][j].f[k]=(float)(i * 10.0F + j * 2.5F + k);

^

tarray.c:746:63: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

wdata[i][j].f[k]=(float)(i * 10.0F + j * 2.5F + k);

^

tarray.c: In function ‘test_array_alloc_custom’:

tarray.c:975:18: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘int’ may change the sign of the result [-Wsign-conversion]

*mem_used+=size;

^~

tarray.c:975:20: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

*mem_used+=size;

^~~~

tarray.c: In function ‘test_array_free_custom’:

tarray.c:1003:18: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘int’ may change the sign of the result [-Wsign-conversion]

mem_used-=(size_t *)mem;

^~

tarray.c:1003:20: warning: conversion to ‘int’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion]

mem_used-=(size_t *)mem;

^

In file included from testhdf5.h:25:0,

from tarray.c:22:

tarray.c: In function ‘test_array_vlen_atomic’:

tarray.c:1042:43: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]

wdata[i][j].p=HDmalloc((i+j+1)*sizeof(unsigned int));

^

…/src/H5private.h:978:35: note: in definition of macro ‘HDmalloc’

#define HDmalloc(Z) malloc(Z)

^

tarray.c:1043:29: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘int’ may change the sign of the result [-Wsign-conversion]

wdata[i][j].len=i+j+1;

^

tarray.c:1045:52: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]

((unsigned int )wdata[i][j].p)[k]=i100+j*10+k;

^

In file included from testhdf5.h:25:0,

from tarray.c:22:

tarray.c: In function ‘test_array_vlen_array’:

tarray.c:1253:43: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]

wdata[i][j].p=HDmalloc((i+j+1)*(sizeof(unsigned int)*ARRAY1_DIM1));

^

…/src/H5private.h:978:35: note: in definition of macro ‘HDmalloc’

#define HDmalloc(Z) malloc(Z)

^

tarray.c:1254:29: warning: conversion to ‘size_t {aka long unsigned int}’ from ‘int’ may change the sign of the result [-Wsign-conversion]

wdata[i][j].len=i+j+1;

^

tarray.c:1257:70: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]

((unsigned int )wdata[i][j].p)[kARRAY1_DIM1+l]=i1000+j100+k*10+l;

^

tarray.c: In function ‘test_array_bkg’:

tarray.c:1535:31: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

cf[i].b[j] = (float)(100.0F*(i+1) + 0.01F*j);

^

tarray.c:1535:45: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

cf[i].b[j] = (float)(100.0F*(i+1) + 0.01F*j);

^

tarray.c:1536:32: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

cf[i].c[j] = (double)(100.0F*(i+1) + 0.02F*j);

^

tarray.c:1536:46: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

cf[i].c[j] = (double)(100.0F*(i+1) + 0.02F*j);

^

In file included from tarray.c:23:0:

At top level:

H5srcdir.h:51:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir(void)

^~~~~~~~~~~~~

H5srcdir.h:33:20: warning: ‘H5_get_srcdir_filename’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir_filename(const char *filename)

^~~~~~~~~~~~~~~~~~~~~~

tfile.c: In function ‘test_file_open_overlap’:

tfile.c:1849:13: warning: conversion to ‘int’ from ‘ssize_t {aka long int}’ may alter its value [-Wconversion]

nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL|H5F_OBJ_ALL);

^~~~~~~~~~~~~~~~

tfile.c:1870:13: warning: conversion to ‘int’ from ‘ssize_t {aka long int}’ may alter its value [-Wconversion]

nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL);

^~~~~~~~~~~~~~~~

In file included from tfile.c:24:0:

At top level:

H5srcdir.h:51:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir(void)

^~~~~~~~~~~~~

H5srcdir.h:33:20: warning: ‘H5_get_srcdir_filename’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir_filename(const char *filename)

^~~~~~~~~~~~~~~~~~~~~~

th5s.c: In function ‘test_h5s_zero_dim’:

th5s.c:560:27: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]

wdata[i][j] = i + j;

^

th5s.c:562:33: warning: conversion to ‘short int’ from ‘unsigned int’ may alter its value [-Wconversion]

wdata_short[i][j] = i + j;

^

th5s.c:569:39: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]

wdata_real[i][j][k] = i + j + k;

^

th5s.c: In function ‘test_h5s_chunk’:

th5s.c:1749:52: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

chunk_data_flt[i][j] = (float)((i + 1) * 2.5F - j * 100.3F);

^

th5s.c:1749:63: warning: conversion to ‘float’ from ‘int’ may alter its value [-Wconversion]

chunk_data_flt[i][j] = (float)((i + 1) * 2.5F - j * 100.3F);

^

In file included from th5s.c:23:0:

At top level:

H5srcdir.h:51:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir(void)

^~~~~~~~~~~~~

H5srcdir.h:33:20: warning: ‘H5_get_srcdir_filename’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir_filename(const char *filename)

^~~~~~~~~~~~~~~~~~~~~~

tmisc.c: In function ‘test_misc8’:

tmisc.c:1260:22: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]

tdata++=((uMISC8_DIM1)+v)%13;

^

In file included from tmisc.c:30:0:

testhdf5.h:83:34: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]

long __x = (long)_x, __val = (long)_val; \

^

tmisc.c:1316:5: note: in expansion of macro ‘VERIFY’

VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), “H5Dget_storage_size”);

^~~~~~

testhdf5.h:83:34: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]

long __x = (long)_x, __val = (long)_val; \

^

tmisc.c:1411:5: note: in expansion of macro ‘VERIFY’

VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), “H5Dget_storage_size”);

^~~~~~

testhdf5.h:83:34: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]

long __x = (long)_x, __val = (long)_val; \

^

tmisc.c:1438:5: note: in expansion of macro ‘VERIFY’

VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), “H5Dget_storage_size”);

^~~~~~

tmisc.c: In function ‘test_misc16’:

tmisc.c:2728:63: warning: initialization makes integer from pointer without a cast [-Wint-conversion]

{“1234567”, “1234567\0”, “12345678”, {NULL}};

^~~~

tmisc.c:2728:63: note: (near initialization for ‘wdata[3][0]’)

tmisc.c: In function ‘test_misc17’:

tmisc.c:2807:63: warning: initialization makes integer from pointer without a cast [-Wint-conversion]

{“1234567”, “1234567\0”, “12345678”, {NULL}};

^~~~

tmisc.c:2807:63: note: (near initialization for ‘wdata[3][0]’)

tmisc.c: In function ‘test_misc23’:

tmisc.c:3885:14: warning: conversion to ‘herr_t {aka int}’ from ‘ssize_t {aka long int}’ may alter its value [-Wconversion]

status = H5Iget_name(tmp_id, objname, (size_t)MISC23_NAME_BUF_SIZE);

^~~~~~~~~~~

tmisc.c: In function ‘test_misc28’:

tmisc.c:5041:18: warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]

buf[i] = i;

^

tmisc.c:306:33: warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]

#define MISC28_SIZE 10

^

tmisc.c:5062:18: note: in expansion of macro ‘MISC28_SIZE’

buf[i] = MISC28_SIZE - 1 - i;

^~~~~~~~~~~

In file included from tmisc.c:31:0:

At top level:

H5srcdir.h:51:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]

static const char *H5_get_srcdir(void)

^~~~~~~~~~~~~

…/src/.libs/libhdf5.so: undefined reference to `OMPI_C_MPI_NULL_COPY_FN’

collect2: error: ld returned 1 exit status

make[1]: *** [testhdf5] Error 1

make: *** [all-recursive] Error 1

I din’t have this problem when compiling with mpich-3.0.1, however now I need to use openmpi. Do you know if there is a openmpi version suitable for compiling with hdf5 ?

Kind Regards,

We didn’t support OpenMPI with 1.8.* releases and we are going to stop HDF5 1.8 support after HDF5 1.8.22 this summer. We will support OpenMPI with HDF5 1.10.5 and later.

Would it be possible for you to move to HDF5 1.10.5 that is coming later this month? Release candidate should be available in a day or two - we will send an announcement.

Thank you!

Elena

Thn

On this openMPI page there is a notice that MPI 1 is dropped from OMPI 4.0.0 codebase. However if you check out and install HDF5 from this live git repo the issue is fixed, and compiled for me fine.

Thanks, I think the version hdf5-1.10.5 is already available right?
https://portal.hdfgroup.org/display/support/Download
or do you mean another one?
Cheers,