H5PL.c:(.text+0x749): undefined reference to `dlsym'

Hello Sir,
I am compiling a code in Fortran. The “make” command gives me the following error:

/home/TMA_CFDLab/174100022/software/hdf5-1.8.20/hdf5/lib//libhdf5.a(H5PL.o): In function H5PL_term_interface': H5PL.c:(.text+0x2b0): undefined reference todlclose’
/home/TMA_CFDLab/174100022/software/hdf5-1.8.20/hdf5/lib//libhdf5.a(H5PL.o): In function H5PL_load': H5PL.c:(.text+0x749): undefined reference todlsym’
H5PL.c:(.text+0x8fd): undefined reference to dlerror' H5PL.c:(.text+0x949): undefined reference todlclose’
H5PL.c:(.text+0x956): undefined reference to dlclose' H5PL.c:(.text+0xa61): undefined reference todlclose’
H5PL.c:(.text+0xb41): undefined reference to dlopen' H5PL.c:(.text+0xb5a): undefined reference todlsym’
/usr/lib/…/lib64/libhugetlbfs.a(shm.o): In function shmget': /home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:151: undefined reference todlsym’
/home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:154: undefined reference to dlerror' /home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:154: undefined reference todlerror’
/home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:151: undefined reference to dlerror' /home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:161: undefined reference todlsym’
/home/abuild/rpmbuild/BUILD/cray-libhugetlbfs-2.20/shm.c:162: undefined reference to `dlerror’
collect2: error: ld returned 1 exit status
Makefile:77: recipe for target ‘nse’ failed
make: *** [nse] Error 1

I have installed hdf5-1.8.20 with configure command:
" ./configure --enable-fortran --with-zlib=/home/TMA_CFDLab/174100022/software/zlib-1.2.11 --with-szlib=/home/TMA_CFDLab/174100022/software/szip-2.1.1 FC=ftn FCFLAGS=-fPIC CC=cc CFLAGS=-fPIC --build=x86_64 "
Have I used the correct configure command ?

I am compiling the code in HPC server. I have loaded the following modules : PrgEnv-gnu/6.0.4, cray-mpich/7.6.0, cray-fftw/3.3.6.3, gcc/7.2.0 before compiling the code. Please let me know if any more information is required.

It looks like you are missing dl library (libdl.so) (use -ldl flag when linking).

Please check the h5fc compiler script in the bin directory in your HDF5 installation directory. It should have all libraries required for linking.
% h5fc program.f90

Thank you!

Elena