# hdf5 build problem

**URL:** <https://forums.developer.nvidia.com/t/hdf5-build-problem/135724>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [May 25, 2018, 7:53pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724 "2018-05-25T19:53:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jand](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jand](https://forums.developer.nvidia.com/u/jand)\
**Post date:** [May 25, 2018, 7:53pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724/1 "2018-05-25T19:53:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [May 25, 2018, 10:45pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724/2 "2018-05-25T22:45:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jand](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jand](https://forums.developer.nvidia.com/u/jand)\
**Post date:** [May 28, 2018, 4:56pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724/3 "2018-05-28T16:56:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [May 29, 2018, 7:14pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724/4 "2018-05-29T19:14:55Z")

</div>

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:

```nohighlight
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:

```nohighlight
/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:

```nohighlight
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

---

<div class="post-metadata">

**Author:** ![jand](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@jand](https://forums.developer.nvidia.com/u/jand)\
**Post date:** [May 29, 2018, 10:49pm UTC](https://forums.developer.nvidia.com/t/hdf5-build-problem/135724/5 "2018-05-29T22:49:57Z")

</div>

Hi Mat,

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

Jan
