Fortran undefined references

I am a newbie. I installed the code and ran the examples successfully. I
wrote a program to extract data from the xdmf and h5 files successfully. I
made this same program into a subroutine and tried to link it with a large
code of mine and got several "undefined references" such as the following 2.
I am using Intel Composer XE (Fortran) and RHEL 5 Linux.

Undefined reference h5lib_mp_h5open_f
Undefined reference h5_dble_interface_mp_h5dread_double_scalar

I added -L to point to the /lib directory, I added -l with the fortran
library name, nothing seemed to work. I compile the main code with ifort,
and my subroutine with h5fc.

Thank you!

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Fortran-undefined-references-tp3141209p3141209.html
Sent from the hdf-forum mailing list archive at Nabble.com.

To make this question clearer:
- I built the library using GFortran (the default configure
--enable-fortran)
- My code is built using Intel ifort, except for the 2 subroutines that use
the hdf5 libraries, which I compile with h5fc
- I'm trying to link them together and get undefined references, despite
adding the h5fc libraries to my link command.

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Fortran-undefined-references-tp3141209p3141723.html
Sent from the hdf-forum mailing list archive at Nabble.com.

Hello,

Fortran modules/libraries are not cross-compiler compatible.
You need to build HDF5 with the compiler that is used in the end.

I usually build the library twice, once with gfortran and once with whatever commercial compiler is on the machine.

Right now, I work with
     - gcc / gfortran
     - icc / ifort
set up separately.
Also, I use modules to switch between libraries ( http://modules.sourceforge.net/ ). It should be available under RHEL 5.

In your case, try using h5fc for everything or rebuild HDF5 with ifort.

In all situations, h5fc should be used for every code that uses HDF5 and for the main program.

Pierre

···

Le 5 juil. 11 à 19:42, naomi a écrit :

To make this question clearer:
- I built the library using GFortran (the default configure
--enable-fortran)
- My code is built using Intel ifort, except for the 2 subroutines that use
the hdf5 libraries, which I compile with h5fc
- I'm trying to link them together and get undefined references, despite
adding the h5fc libraries to my link command.

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Fortran-undefined-references-tp3141209p3141723.html
Sent from the hdf-forum mailing list archive at Nabble.com.

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Thank you. That worked.

···

--
View this message in context: http://hdf-forum.184993.n3.nabble.com/Fortran-undefined-references-tp3141209p3144425.html
Sent from the hdf-forum mailing list archive at Nabble.com.