hdf5 build problem

Hi,

I am trying ti build HDF5 1.10.2 with pgfortran 18.4:
export CPP=cpp
export FC=pgfortran
./configure --prefix=/usr/local/hdf5 --disable-shared --enable-fortran

Make ends with an error:
Makefile:967: recipe for target ‘t.lo’ failed
make[2]: *** [t.lo] Error 1
make[2]: Leaving directory ‘/usr/local/src/hdf5-1.10.2/fortran/test’
Makefile:812: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/usr/local/src/hdf5-1.10.2/fortran’
Makefile:652: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1

Any help is appreciated.

Thanks, Jan

Hi Jan,

For good or bad, I just tried and HDF5 1.10.2 and built fine for me. I also ran all the tests without issue.

Can you run make with verbose output enabled, “make V=1”?

That might give us more info about the error.

Thanks,
Mat

Hi Mat,

thanks for your suggestion. Some more info: Ubuntu 16.04 and I am using the Gnu compilers for everything but fortran. Could that cause issues?


The output of make V=1 is appended.

Thanks, Jan

Making all in test
make[2]: Entering directory ‘/usr/local/src/hdf5-1.10.2/fortran/test’
pgfortran -I. -I…/…/src -I…/…/fortran/src -I…/…/fortran/src -I…/…/fortran/src -c -o H5_test_buildiface.o H5_test_buildiface.F90
/bin/bash …/…/libtool --tag=FC --mode=link pgfortran -I…/…/fortran/src -I…/…/fortran/src -static -o H5_test_buildiface H5_test_buildiface.o -lz -ldl -lm
libtool: link: pgfortran -I…/…/fortran/src -I…/…/fortran/src -o H5_test_buildiface H5_test_buildiface.o -lz -ldl -lm
./H5_test_buildiface
/bin/bash …/…/libtool --tag=FC --mode=compile pgfortran -I. -I…/…/src -I…/…/fortran/src -I…/…/fortran/src -I…/…/fortran/src -c -o tf_gen.lo tf_gen.F90
libtool: compile: pgfortran -I. -I…/…/src -I…/…/fortran/src -I…/…/fortran/src -I…/…/fortran/src -c tf_gen.F90 -o tf_gen.o
/bin/bash …/…/libtool --tag=FC --mode=compile pgfortran -I. -I…/…/src -I…/…/fortran/src -I…/…/fortran/src -I…/…/fortran/src -c -o tf.lo tf.F90
libtool: compile: pgfortran -I. -I…/…/src -I…/…/fortran/src -I…/…/fortran/src -I…/…/fortran/src -c tf.F90 -o tf.o
depbase=echo t.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';
/bin/bash …/…/libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I…/…/src -I…/…/fortran/src -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API -I…/…/src -I…/…/fortran/src -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc+±compat -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wdate-time -Warray-bounds=2 -Wc99-c11-compat -fstdarg-opt -s -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn -Wno-suggest-attribute=const -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn -Wno-suggest-attribute=format -O3 -MT t.lo -MD -MP -MF $depbase.Tpo -c -o t.lo t.c &&
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I…/…/src -I…/…/fortran/src -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API -I…/…/src -I…/…/fortran/src -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc+±compat -Wcast-align -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings -Wlogical-op -Wlarger-than=2048 -Wvla -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants -Wdouble-promotion -Wtrampolines -Wstack-usage=8192 -Wvector-operation-performance -Wdate-time -Warray-bounds=2 -Wc99-c11-compat -fstdarg-opt -s -Wno-inline -Wno-aggregate-return -Wno-missing-format-attribute -Wno-missing-noreturn -Wno-suggest-attribute=const -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn -Wno-suggest-attribute=format -O3 -MT t.lo -MD -MP -MF .deps/t.Tpo -c t.c -o t.o
In file included from t.c:26:0:
t.h:24:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.h:29:20: note: in expansion of macro ‘nh5_fixname_c’
H5_FCTESTDLL int_f nh5_fixname_c
^
t.h:30:1: warning: parameter names (without types) in function declaration
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen);
^
t.h:25:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.h:32:20: note: in expansion of macro ‘nh5_cleanup_c’
H5_FCTESTDLL int_f nh5_cleanup_c
^
t.h:33:1: warning: parameter names (without types) in function declaration
(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl);
^
t.h:25:39: warning: redundant redeclaration of ‘H5_FC_FUNC_’ [-Wredundant-decls]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.h:32:20: note: in expansion of macro ‘nh5_cleanup_c’
H5_FCTESTDLL int_f nh5_cleanup_c
^
t.h:24:39: note: previous declaration of ‘H5_FC_FUNC_’ was here

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.h:29:20: note: in expansion of macro ‘nh5_fixname_c’
H5_FCTESTDLL int_f nh5_fixname_c
^
t.h:26:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.h:35:36: note: in expansion of macro ‘nh5_exit_c’
H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c
^
t.h:36:1: warning: parameter names (without types) in function declaration
(int_f *status);
^
t.h:26:39: warning: redundant redeclaration of ‘H5_FC_FUNC_’ [-Wredundant-decls]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.h:35:36: note: in expansion of macro ‘nh5_exit_c’
H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c
^
t.h:25:39: note: previous declaration of ‘H5_FC_FUNC_’ was here

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.h:32:20: note: in expansion of macro ‘nh5_cleanup_c’
H5_FCTESTDLL int_f nh5_cleanup_c
^
t.h:27:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.h:38:19: note: in expansion of macro ‘nh5_env_nocleanup_c’
H5_FCTESTDLL void nh5_env_nocleanup_c
^
t.h:39:1: warning: parameter names (without types) in function declaration
(int_f *status);
^
t.h:27:39: warning: redundant redeclaration of ‘H5_FC_FUNC_’ [-Wredundant-decls]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.h:38:19: note: in expansion of macro ‘nh5_env_nocleanup_c’
H5_FCTESTDLL void nh5_env_nocleanup_c
^
t.h:26:39: note: previous declaration of ‘H5_FC_FUNC_’ was here

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.h:35:36: note: in expansion of macro ‘nh5_exit_c’
H5_FCTESTDLL H5_ATTR_NORETURN void nh5_exit_c
^
t.h:24:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.h:24:39: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c: In function ‘H5_FC_FUNC_’:
t.h:24:39: warning: old-style function definition [-Wold-style-definition]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.h:24:39: warning: type of ‘h5_fixname_c’ defaults to ‘int’ [-Wimplicit-int]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.h:24:39: warning: type of ‘H5_FIXNAME_C’ defaults to ‘int’ [-Wimplicit-int]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c:52:53: error: ‘base_name’ undeclared (first use in this function)
if(NULL == (c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen)))
^
t.c:52:53: note: each undeclared identifier is reported only once for each function it appears in
t.c:52:73: error: ‘base_namelen’ undeclared (first use in this function)
if(NULL == (c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen)))
^
In file included from t.h:15:0,
from t.c:26:
t.c:54:58: error: ‘full_namelen’ undeclared (first use in this function)
if(NULL == (c_full_name = (char *)HDmalloc((size_t)*full_namelen + 1)))
^
…/…/src/H5private.h:1079:35: note: in definition of macro ‘HDmalloc’
#define HDmalloc(Z) malloc(Z)
^
t.c:60:49: error: ‘fapl’ undeclared (first use in this function)
if(NULL == h5_fixname(c_base_name, (hid_t)*fapl, c_full_name, (size_t)*full_namelen + 1))
^
In file included from t.h:16:0,
from t.c:26:
t.c:62:43: error: ‘full_name’ undeclared (first use in this function)
HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen);
^
…/src/H5f90i.h:27:25: note: in definition of macro ‘_fcdtocp’
#define _fcdtocp(desc) (desc)
^
t.c:70:13: warning: function declared ‘noreturn’ has a ‘return’ statement
return ret_value;
^
In file included from t.c:26:0:
t.h:24:39: warning: unused parameter ‘h5_fixname_c’ [-Wunused-parameter]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.h:24:39: warning: unused parameter ‘H5_FIXNAME_C’ [-Wunused-parameter]

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c: At top level:
t.h:25:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:25:39: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:25:39: error: redefinition of ‘H5_FC_FUNC_’

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:24:39: note: previous definition of ‘H5_FC_FUNC_’ was here

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c: In function ‘H5_FC_FUNC_’:
t.h:25:39: warning: old-style function definition [-Wold-style-definition]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:25:39: warning: type of ‘h5_cleanup_c’ defaults to ‘int’ [-Wimplicit-int]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:25:39: warning: type of ‘H5_CLEANUP_C’ defaults to ‘int’ [-Wimplicit-int]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.c:95:23: error: ‘fapl’ undeclared (first use in this function)
c_fapl = (hid_t)*fapl;
^
t.c:100:44: error: ‘base_name’ undeclared (first use in this function)
c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
^
t.c:100:64: error: ‘base_namelen’ undeclared (first use in this function)
c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
^
In file included from t.c:26:0:
t.h:25:39: warning: unused parameter ‘h5_cleanup_c’ [-Wunused-parameter]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.h:25:39: warning: unused parameter ‘H5_CLEANUP_C’ [-Wunused-parameter]

define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C)

^
t.c:85:1: note: in expansion of macro ‘nh5_cleanup_c’
nh5_cleanup_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl)
^
t.c: At top level:
t.h:26:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:26:39: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:26:39: error: redefinition of ‘H5_FC_FUNC_’

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:24:39: note: previous definition of ‘H5_FC_FUNC_’ was here

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c: In function ‘H5_FC_FUNC_’:
t.h:26:39: warning: old-style function definition [-Wold-style-definition]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:26:39: warning: type of ‘h5_exit_c’ defaults to ‘int’ [-Wimplicit-int]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:26:39: warning: type of ‘H5_EXIT_C’ defaults to ‘int’ [-Wimplicit-int]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
In file included from t.h:15:0,
from t.c:26:
t.c:136:18: error: ‘status’ undeclared (first use in this function)
HDexit((int)*status);
^
…/…/src/H5private.h:758:31: note: in definition of macro ‘HDexit’
#define HDexit(N) exit(N)
^
In file included from t.c:26:0:
t.h:26:39: warning: unused parameter ‘h5_exit_c’ [-Wunused-parameter]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.h:26:39: warning: unused parameter ‘H5_EXIT_C’ [-Wunused-parameter]

define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C)

^
t.c:134:1: note: in expansion of macro ‘nh5_exit_c’
nh5_exit_c(int_f *status)
^
t.c: At top level:
t.h:27:39: error: ‘H5_FC_FUNC_’ declared as function returning a function

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:27:39: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:27:39: error: redefinition of ‘H5_FC_FUNC_’

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:24:39: note: previous definition of ‘H5_FC_FUNC_’ was here

define nh5_fixname_c H5_FC_FUNC_(h5_fixname_c, H5_FIXNAME_C)

^
t.c:43:1: note: in expansion of macro ‘nh5_fixname_c’
nh5_fixname_c(_fcd base_name, size_t_f base_namelen, hid_t_f fapl, _fcd full_name, size_t_f *full_namelen)
^
t.c: In function ‘H5_FC_FUNC_’:
t.h:27:39: warning: old-style function definition [-Wold-style-definition]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:27:39: warning: type of ‘h5_env_nocleanup_c’ defaults to ‘int’ [-Wimplicit-int]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:27:39: warning: type of ‘H5_ENV_NOCLEANUP_C’ defaults to ‘int’ [-Wimplicit-int]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.c:153:4: error: ‘status’ undeclared (first use in this function)
*status = (int_f)0;
^
In file included from t.c:26:0:
t.h:27:39: warning: unused parameter ‘h5_env_nocleanup_c’ [-Wunused-parameter]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f *status)
^
t.h:27:39: warning: unused parameter ‘H5_ENV_NOCLEANUP_C’ [-Wunused-parameter]

define nh5_env_nocleanup_c H5_FC_FUNC_(h5_env_nocleanup_c, H5_ENV_NOCLEANUP_C)

^
t.c:151:1: note: in expansion of macro ‘nh5_env_nocleanup_c’
nh5_env_nocleanup_c(int_f status)
^
t.c: In function ‘H5_FC_FUNC_’:
t.c:70:13: warning: ‘noreturn’ function does return
return ret_value;
^
t.c: In function ‘H5_FC_FUNC_’:
t.c:137:1: warning: control reaches end of non-void function [-Wreturn-type]
} /
h5_exit_c /
^
t.c: In function ‘H5_FC_FUNC_’:
t.c:156:1: warning: control reaches end of non-void function [-Wreturn-type]
} /
h5_env_nocleanup_c */
^
Makefile:967: recipe for target ‘t.lo’ failed
make[2]: *** [t.lo] Error 1
make[2]: Leaving directory ‘/usr/local/src/hdf5-1.10.2/fortran/test’
Makefile:812: recipe for target ‘all-recursive’ failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory ‘/usr/local/src/hdf5-1.10.2/fortran’
Makefile:652: recipe for target ‘all-recursive’ failed
make: *** [all-recursive] Error 1

Hi Jan,

This was an interesting one! I was able replicate error on a Ubuntu 16.04 system and found if I explicitly set the FCLIBS environment variable to use the libraries listed below, or use “pgcc” instead of “gcc”, then HDF5 builds correctly.

Be sure to change the library directory to your PGI directory:

export FCLIBS="-L/opt/pgi/linux86-64/18.4/lib -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread -lpgmath -lnspgc -lpgc -lrt -lm"

Details:

Basically this looks be a change in the GNU linker between the the 4.x and 5.x releases. In configure, it first tries to figure out the Fortran libraries that it needs by listing the verbose (-v) output from a simple compile. Here’s example of the link line we produce:

/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /proj/pgi/linux86-64/18.4/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o /proj/pgi/linux86-64/18.4/lib/initmp.o /proj/pgi/linux86-64/18.4/lib/f90main.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /proj/pgi/linux86-64/18.4/lib/pgi.ld -L/proj/pgi/linux86-64/18.4/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/5 /tmp/pgfortranD14exNoCWG6l.o -rpath /proj/pgi/linux86-64/18.4/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64 -o conftest -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o

Because of a circular dependency, we list the Fortran runtime library (libpg90rtl.a) twice. Once at the beginning of the line, and once after libpgf902.

However configure removes the second “-lpgf90rtl” when creating FCLIBS:

configure:7434: result:  -L/proj/pgi/linux86-64/18.4/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgftnrtl -lpgmp -lnuma -lpthread -lpgmath -lnspgc -lpgc -lrt -lm

This behavior is not new and how previous version of HDF5’s configure worked. Also, these are the same libraries PGI has used in the past.

What I believe is new, is how the gcc linker is working. Previous versions, such as gcc 4.8.5 which is what I was using for my original test, the linker was able to resolve the symbols libpgf902 uses from libpgf90rtl even though the library comes before it. With gcc 5.4, the linker is unable to resolve these symbols.

This then causes a cascade of errors.

  • First the test to check Fortran name mangling to fails
    This then causes the HDF5 config header file to not define the name mangling macro
    Since the macro is not defined, the compilation of the C file fails since the function that should have been preprocessed isn’t and the prototype looks like it’s returning function.

So the two solutions are to not let configure figure out the Fortran compiler’s libraries (i.e. set FCLIBS) or use pgcc instead of gcc. pgcc uses “ld” as the linker and seems to be able to resolve these symbols.

-Mat

Hi Mat,

thanks very much for the detective work! I got it to compile now by setting FCLIBS.

Jan