You can use “nm -a” on libhdf5_fortran and search for “h5lib_mp_h5open_f”, if it’s there then your program is not finding the library. Also, you don’t need to copy the lib directory over to the same directory as your executable, just link to where you installed hdf5. Keep in mind that you need to also include the hdf5 include directory which contains the fortran modules.
Scot On Jul 22, 2016, at 11:36 AM, Øyvind Sylta <[email protected]<mailto:[email protected]>> wrote: Thanks Scot, I managed to build my shared library without any error messages. A big step forward. Next challenge is to use it from my application. I copied the files in the hdf5/lib directory over to the directory where I launch my application. When I then start the application that uses this new version of my library, I get: : symbol lookup error: /teradisk1/…/lin64/libmi_dll.so: undefined symbol: h5lib_mp_h5open_f_ Any suggestions? Øyvind Fra: Hdf-forum [mailto:[email protected]] På vegne av Scot Breitenfeld Sendt: 22 July 2016 16:34 Til: HDF Users Discussion List <[email protected]<mailto:[email protected]>> Emne: Re: [Hdf-forum] Building HDF for use with gcc 4.4.7 and You need to give the path to zlib, you can look in h5fc (located in the bin directory where you installed hdf5) to see where it is located, for example H5BLD_LDFLAGS=“ -L/<snip>/packages/zlib-1.2.8/lib/lib “ H5BLD_LIBS=“-lz -ldl -lm " Scot On Jul 22, 2016, at 8:56 AM, Øyvind Sylta <[email protected]<mailto:[email protected]>> wrote: Thanks. Today I installed intel fortran 16.0.3 and used ifort 16.0.3 together with gcc 4.4.7 to build the hdf library. The installation worked fine this time, as far as I could see, including the fortran examples. I try building one of the examples manually (h5_extend.f90) by copying it over to a hdf5test directory. Compilation works fine but there is still something I am doing wrong in the linking? Øyvind -rwxrw-r-- 1 oys migris 6001 Apr 26 14:44 h5_extend.f90 -rw-r--r-- 1 oys migris 9840 Jul 22 15:41 h5_extend.o Compilation works fine: [@mir hdf5test]$ ifort -c -O -cpp -fpic -traceback -I../hdf5-1.8.17/hdf5/include h5_extend.f90 Building the application needs something, but what: [@mir hdf5test]$ ifort -O -o h5_extend *.o -I../hdf5-1.8.17/hdf5/include ../hdf5-1.8.17/hdf5/lib/libhdf5_fortran.a ../../HDF5/hdf5-1.8.17/hdf5/lib/libhdf5.a ../../HDF5/hdf5-1.8.17/hdf5/lib/libhdf5.a(H5Zdeflate.o): In function `H5Z_filter_deflate': H5Zdeflate.c:(.text+0x134): undefined reference to `compress2' H5Zdeflate.c:(.text+0x1ee): undefined reference to `inflateInit_' H5Zdeflate.c:(.text+0x209): undefined reference to `inflate' H5Zdeflate.c:(.text+0x270): undefined reference to `inflateEnd' H5Zdeflate.c:(.text+0x3de): undefined reference to `inflateEnd' H5Zdeflate.c:(.text+0x410): undefined reference to `inflateEnd' [oys@mir hdf5test]$ ls ../hdf5-1.8.17/ ACKNOWLEDGMENTS c++ config configure examples libtool Makefile.dist release_docs tools aclocal.m4 CMakeFilters.cmake config.log configure.ac fortran m4 Makefile.in src UserMacros.cmake acsite.m4 CMakeInstallation.cmake config.lt COPYING hdf5 Makefile MANIFEST test bin CMakeLists.txt config.status CTestConfig.cmake hl Makefile.am README.txt testpar Fra: Hdf-forum [mailto:[email protected]] På vegne av Scot Breitenfeld Sendt: 21 July 2016 19:59 Til: HDF Users Discussion List <[email protected]<mailto:[email protected]>> Emne: Re: [Hdf-forum] Building HDF for use with gcc 4.4.7 and Ah yes, now this looks familiar. We did have a problem (HDFFV-8634) with —enable-fortran2003 and 1.8.12 due to a bug in the intel 14.0.1 compiler. See: http://software.intel.com/en-us/forums/topic/498698 We verified the problem on the mac, but it looks to have the same problem on Linux. They did fix the bug in 14.0.2 so upgrading to 14.0.2 should fix the problem. Scot On Jul 21, 2016, at 11:57 AM, Øyvind Sylta <[email protected]<mailto:[email protected]>> wrote: Scot, You asked: If you go into fortran/test and run fortranlib_test, where does it hang? It seems to me that is repeating the call: CALL check("h5sclose_f007",error,total_error) to produce the error message inside: reopentest(cleanup, total_error) I added 007 to make sure it was the right location and expanded on the message: Integer, save::ierr=0 Ierr=ierr+1 WRITE(*,'(a,a,99i8)') trim(string), " FAILED",error,total_error,ierr !oys.160721.Migrimod I also modified the mounting test error message to: write(*, '(a,99i8)') "mounting test error occured",i,j,data_out(i,j),data_in(i,j) !oys.160221.Migrimod and then I got the listing below (just the start included, it goes on for many thousands of records before I aborted it). Øyvind Fortran API: fortranlib_test Test Log ============================ ========================== FORTRAN tests ========================== FORTRANLIB_TEST is linked with HDF5 Library version 1.8 release 12 mounting test error occured 1 2 0 1 mounting test error occured 1 3 0 2 mounting test error occured 1 4 0 3 mounting test error occured 1 5 0 4 mounting test error occured 2 1 0 1 mounting test error occured 2 2 0 2 mounting test error occured 2 3 0 3 mounting test error occured 2 4 0 4 mounting test error occured 2 5 0 5 mounting test error occured 3 1 0 2 mounting test error occured 3 2 0 3 mounting test error occured 3 3 0 4 mounting test error occured 3 4 0 5 mounting test error occured 3 5 0 6 mounting test error occured 4 1 0 3 mounting test error occured 4 2 0 4 mounting test error occured 4 3 0 5 mounting test error occured 4 4 0 6 mounting test error occured 4 5 0 7 mounting test ended 0 0 Mounting test PASSED HDF5-DIAG: Error detected in HDF5 (1.8.12) thread 0: #000: H5S.c line 405 in H5Sclose(): not a dataspace major: Invalid arguments to routine minor: Inappropriate type h5sclose_f007 FAILED -1 1 1 file name obtained from the dataset id is incorrect HDF5-DIAG: Error detected in HDF5 (1.8.12) thread 0: #000: H5S.c line 405 in H5Sclose(): not a dataspace major: Invalid arguments to routine minor: Inappropriate type h5sclose_f007 FAILED -1 2 2 file name obtained from the dataset id is incorrect HDF5-DIAG: Error detected in HDF5 (1.8.12) thread 0: #000: H5S.c line 405 in H5Sclose(): not a dataspace major: Invalid arguments to routine minor: Inappropriate type Fra: Hdf-forum [mailto:[email protected]] På vegne av Scot Breitenfeld Sendt: 21 July 2016 16:12 Til: HDF Users Discussion List <[email protected]<mailto:[email protected]>> Emne: Re: [Hdf-forum] Building HDF for use with gcc 4.4.7 and On Jul 21, 2016, at 5:38 AM, Øyvind Sylta <[email protected]<mailto:[email protected]>> wrote: Thanks Scot, Now I am building with my compiler from source. I downloaded 1.8.12 and did: bash cd hdf5-1.8.12 export F9X=ifort FC=ifort ./configure --enable-fortran --enable-fortran2003 make make check Now it is processing forever with the last few output lines being: make check-TESTS make[3]: Entering directory `/teradisk1/backup/Migris/4_Code/DLL/mi_dll/HDF5/hdf5-1.8.12/fortran/test' make[4]: Entering directory `/teradisk1/backup/Migris/4_Code/DLL/mi_dll/HDF5/hdf5-1.8.12/fortran/test' ===Serial tests in test begin Thu Jul 21 12:25:22 CEST 2016=== make[5]: Entering directory `/teradisk1/backup/Migris/4_Code/DLL/mi_dll/HDF5/hdf5-1.8.12/fortran/test' ============================ Fortran API: Testing fortranlib_test If you go into fortran/test and run fortranlib_test, where does it hang? I tried it first with gfortran and the make check was completed in a reasonale time. I found a reported issue with one of the source files at: https://software.intel.com/en-us/articles/resolving-problem-of-building-hdf5-with-intel-compiler-140 I modified the file and redid make and make check. But it still does not pass beyond Fortran API: Testing fortranlib_test Any suggestions? Do I need to upgrade to HDF 1.8.17 and use the most recent ifort compiler? I was hoping to minimize my efforts by staying on the same versions on Windows and Linux, but that does not seem to be a good idea? Will it help to upgrade? It can’t hurt to upgrade to 1.8.17 if you are wanting to stay with 1.8. There has been a lot of bug fixes (including the one you mentioned) and improvements since 1.8.12, so I think it would be worth the effort in the long run. Intel version 14 should be fine. It is usually best to use the same compiler vendor for C and Fortran (export CC=icc, export FC=ifort) if possible. Øyvind Fra: Hdf-forum [mailto:[email protected]] På vegne av Scot Breitenfeld Sendt: 20 July 2016 21:15 Til: HDF Users Discussion List <[email protected]<mailto:[email protected]>> Emne: Re: [Hdf-forum] Building HDF for use with gcc 4.4.7 and Oh the bane of Fortran mod files in libraries. Module files are compiler and compiler version specific, so you are better off just compiling the hdf5 library from source, using the same compiler that you plan on using. Hopefully F2008 submodules will help avoid this issue. Scot On Jul 20, 2016, at 1:22 PM, Øyvind Sylta <[email protected]<mailto:[email protected]>> wrote: Hello, As a relative newcomer to HDF I have mastered to some degree using it on Windows with Visual Studio. So now, I am trying to port the code to Linux and therefore I downloaded a version of the library that I thought might be applicable to our Linux Centos system. When I try to compile: ifort -c -O -cpp -fpic -traceback -I../HDF5/hdf5-1.8.14-linux-centos6-x86_64-gcc447-shared/include ../forhdf/migri_hdf_1.f90 , I get lots of messages, the first ones being: ../forhdf/migri_hdf_1.f90(12): error #7013: This module file was not generated by any release of this compiler. [HDF5] use hdf5 -------^ ../forhdf/migri_hdf_1.f90(36): error #7013: This module file was not generated by any release of this compiler. [HDF5] USE HDF5 -------^ ../forhdf/migri_hdf_1.f90(47): error #7013: This module file was not generated by any release of this compiler. [HDF5] USE HDF5 -------^ ../forhdf/migri_hdf_1.f90(54): error #6683: A kind type parameter must be a compile-time constant. [HID_T] INTEGER(HID_T) :: file, dset It look to me as if there is a mismatch between the compiler I am using and the compiler used to build HDF5 library. I am using the Intel 14.0.1 Fortran compiler and icc 14.0.1 is also available. Gcc 4.4.7 is also installed and I thought that both the ifort and the HDF library would be compatible with gcc 4.4.7? Could you assist me with what I am doing wrong here? Øyvind _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected]<mailto:[email protected]> http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org Twitter: https://twitter.com/hdf5
