Error compiling hdf5 with gfortran 6.3.1

I am getting errors in the "make" of hdf5 with gfortran 6.3.1 (HDF5 version
1.8.15-patch1) such as below:

(.text+0x20): undefined reference to `main'

fortranlib_test-tH5F.o: In function `th5f_mp_mountingtest_':

tH5F.f90:(.text+0x1e5): undefined reference to `h5f_mp_h5fcreate_f_'

tH5F.f90:(.text+0x244): undefined reference to `h5g_mp_h5gcreate_f_'

tH5F.f90:(.text+0x277): undefined reference to `h5g_mp_h5gclose_f_'

tH5F.f90:(.text+0x2a6): undefined reference to `h5f_mp_h5fclose_f_' ..

.

collect2: error: ld returned 1 exit status

Makefile:880: recipe for target 'fortranlib_test' failed

make[2]: *** [fortranlib_test] Error 1

make[2]: Leaving directory '/root/Downloads/hdf5-1.8.15-patch1/fortran/test'

Makefile:736: recipe for target 'all-recursive' failed

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

make[1]: Leaving directory '/root/Downloads/hdf5-1.8.15-patch1/fortran'

Makefile:576: recipe for target 'all-recursive' failed

I used ./configure --prefix=/opt/hdf5-1.8.15-patch1.gfortran_6.3.1 --enable
fortran. Any ideas? I was able to build it using the Intel compiler (2016).

Naomi Greenberg

Principal Member of the Research Staff

Electromagnetics Lab

<http://www.riversideresearch.org/&gt; www.riversideresearch.org

T: 212.502.1718 | F: 212.502.1729 |

line

Riverside Research | 156 William Street | New York, N.Y. 10038

<http://www.riversideresearch.org/rss.xml&gt;
cid:image010.png@01D05BEF.9ED90B00 <https://twitter.com/RiversideRsch&gt;
cid:image011.png@01D05BEF.9ED90B00
<Facebook;
cid:image012.png@01D05BEF.9ED90B00
<https://www.linkedin.com/company/riverside-research&gt; linkedin-new

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain proprietary, confidential or
privileged information or otherwise be protected by law. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not the
intended recipient, please notify the sender and destroy all copies and the
original message.

Hi,

I used ./configure --prefix=/opt/hdf5-1.8.15-patch1.gfortran_6.3.1 --enable
fortran. Any ideas? I was able to build it using the Intel compiler (2016).

Is it a typo that I read "--enable fortran" (with a space) instead of
"--enable-fortran" ?

Else, if you have built already hdf5 in the same directory, you might need to
clean remaining files (from the intel compiler) that could conflict with the
compiled files needed by gfortran.

My general recipe for building hdf5, using here the gcc/gfortran compiler
setting. You might need to adjust (replace gcc by gcc-6 and gfortran by
gfortran-6, for instance).

In a fresh unpack of the source file:

export CC=gcc
export FC=gfortran
./configure --enable-fortran --enable-fortran2003 --prefix /opt/hdf5-1.8.15-patch1.gfortran_6.3.1
make

If there are further problems, can you include the full details of your build
process (all steps since unpacking the source archive, OS, compiler versions).

Regards,

Pierre

···

On Wed, Jun 07, 2017 at 02:28:56PM +0000, Greenberg, Naomi wrote:

Thank you. That worked.

Naomi Greenberg
Principal Member of the Research Staff
Electromagnetics Lab

T: 212.502.1718 | F: 212.502.1729 |

Riverside Research | 156 William Street | New York, N.Y. 10038

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain proprietary, confidential or
privileged information or otherwise be protected by law. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not the
intended recipient, please notify the sender and destroy all copies and the
original message.

···

-----Original Message-----
From: Hdf-forum [mailto:hdf-forum-bounces@lists.hdfgroup.org] On Behalf Of
Pierre de Buyl
Sent: Wednesday, June 07, 2017 3:04 PM
To: HDF Users Discussion List
Subject: Re: [Hdf-forum] Error compiling hdf5 with gfortran 6.3.1

Hi,

On Wed, Jun 07, 2017 at 02:28:56PM +0000, Greenberg, Naomi wrote:

I used ./configure --prefix=/opt/hdf5-1.8.15-patch1.gfortran_6.3.1
--enable fortran. Any ideas? I was able to build it using the Intel

compiler (2016).

Is it a typo that I read "--enable fortran" (with a space) instead of
"--enable-fortran" ?

Else, if you have built already hdf5 in the same directory, you might need
to clean remaining files (from the intel compiler) that could conflict with
the compiled files needed by gfortran.

My general recipe for building hdf5, using here the gcc/gfortran compiler
setting. You might need to adjust (replace gcc by gcc-6 and gfortran by
gfortran-6, for instance).

In a fresh unpack of the source file:

export CC=gcc
export FC=gfortran
./configure --enable-fortran --enable-fortran2003 --prefix
/opt/hdf5-1.8.15-patch1.gfortran_6.3.1
make

If there are further problems, can you include the full details of your
build process (all steps since unpacking the source archive, OS, compiler
versions).

Regards,

Pierre

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5