CMake vs configure/make: why different results?

Hello,

Do not ask me exactly why, but it seems that a part of my problem is solved: the linking.

I changed the order of the libraries passed to the linker, with and without HL: -lhdf5_fortran -lhdf5 -lhdf5_f90cstub, or -lhdf5_fortran -lhdf5_f90cstub -lhdf5, or ... One combination works!
I remember that this solves a so weird problem once... If someone knows why, I am very interested!

However, the ctest fails, but I will look into that later: my code produces correct hdf5 files...

···

------------------------------------------------------------
99% tests passed, 12 tests failed out of 1979

Total Test time (real) = 621.58 sec

The following tests FAILED:
    5 - lheap (Failed)
   14 - dtypes (Failed)
   67 - PERFORM_h5perf (Failed)
   68 - PERFORM_mpi-perf (Failed)
   69 - TEST_PAR_testphdf5 (Failed)
   70 - TEST_PAR_t_mpi (Failed)
   71 - TEST_PAR_t_cache (Failed)
   72 - TEST_PAR_t_pflush1 (Failed)
   73 - TEST_PAR_t_pflush2 (Failed)
   74 - TEST_PAR_t_shapesame (Failed)
   75 - TEST_PAR_t_posix_compliant (Failed)
   80 - parallel_test (Failed)
Errors while running CTest
------------------------------------------------------------

Anyway, thanks for you support!

Best,

Stephane

Stephane,

    That should have been my next question - the order of the fortran libraries do matter. You'll need a fortran expert for an explanation.

I can answer your question about the new XXX_cstub.lib files - cmake had trouble building combined C and fortran library on windows - so for simplicity we just create two libraries on all platforms when using cmake.

Allen

···

Hello,

Do not ask me exactly why, but it seems that a part of my problem is solved: the linking.

I changed the order of the libraries passed to the linker, with and without HL: -lhdf5_fortran -lhdf5 -lhdf5_f90cstub, or -lhdf5_fortran -lhdf5_f90cstub -lhdf5, or ... One combination works!
I remember that this solves a so weird problem once... If someone knows why, I am very interested!

However, the ctest fails, but I will look into that later: my code produces correct hdf5 files...

------------------------------------------------------------
99% tests passed, 12 tests failed out of 1979

Total Test time (real) = 621.58 sec

The following tests FAILED:
    5 - lheap (Failed)
   14 - dtypes (Failed)
   67 - PERFORM_h5perf (Failed)
   68 - PERFORM_mpi-perf (Failed)
   69 - TEST_PAR_testphdf5 (Failed)
   70 - TEST_PAR_t_mpi (Failed)
   71 - TEST_PAR_t_cache (Failed)
   72 - TEST_PAR_t_pflush1 (Failed)
   73 - TEST_PAR_t_pflush2 (Failed)
   74 - TEST_PAR_t_shapesame (Failed)
   75 - TEST_PAR_t_posix_compliant (Failed)
   80 - parallel_test (Failed)
Errors while running CTest
------------------------------------------------------------

Anyway, thanks for you support!

Best,

Stephane

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

Just a comment on library order:

A quick workaround for the impatient is to just write the complete line of libraries twice.

Reason is that libraries may have hierarchical dependencies, and under unix, in contrast to windows, the linker does only one pass to resolve these dependencies. Thus the order of libraries needs to reflect the dependency on the libraries, with the most dependent library first, the least dependent library last.

If you don't know these dependencies, then just writing them all twice will basically make the linker look at each library twice, implementing a two-pass process like under windows, and it will be able to resolve all dependencies. This is less efficient, but should work, and does, in my personal experience.

     Werner

···

On Wed, 18 Apr 2012 10:21:25 -0500, Allen D Byrne <byrn@hdfgroup.org> wrote:

Stephane,

   That should have been my next question - the order of the fortran libraries do matter. You'll need a fortran expert for an explanation.

I can answer your question about the new XXX_cstub.lib files - cmake had trouble building combined C and fortran library on windows - so for simplicity we just create two libraries on all platforms when using cmake.

Allen

Hello,

Do not ask me exactly why, but it seems that a part of my problem is solved: the linking.

I changed the order of the libraries passed to the linker, with and without HL: -lhdf5_fortran -lhdf5 -lhdf5_f90cstub, or -lhdf5_fortran -lhdf5_f90cstub -lhdf5, or ... One combination works!

I remember that this solves a so weird problem once... If someone knows why, I am very interested!

However, the ctest fails, but I will look into that later: my code produces correct hdf5 files...

------------------------------------------------------------

99% tests passed, 12 tests failed out of 1979

Total Test time (real) = 621.58 sec

The following tests FAILED:

    5 - lheap (Failed)

   14 - dtypes (Failed)

   67 - PERFORM_h5perf (Failed)

   68 - PERFORM_mpi-perf (Failed)

   69 - TEST_PAR_testphdf5 (Failed)

   70 - TEST_PAR_t_mpi (Failed)

   71 - TEST_PAR_t_cache (Failed)

   72 - TEST_PAR_t_pflush1 (Failed)

   73 - TEST_PAR_t_pflush2 (Failed)

   74 - TEST_PAR_t_shapesame (Failed)

   75 - TEST_PAR_t_posix_compliant (Failed)

   80 - parallel_test (Failed)

Errors while running CTest

------------------------------------------------------------

Anyway, thanks for you support!

Best,

Stephane

_______________________________________________

Hdf-forum is for HDF software users discussion.

Hdf-forum@hdfgroup.org

http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

--
___________________________________________________________________________
Dr. Werner Benger Visualization Research
Laboratory for Creative Arts and Technology (LCAT)
Center for Computation & Technology at Louisiana State University (CCT/LSU)
211 Johnston Hall, Baton Rouge, Louisiana 70803
Tel.: +1 225 578 4809 Fax.: +1 225 578-5362

This is the correct sequence (fortran calls a thin layer of C stabs layer that handles data flow from Fortran to HDF5 C library)

-lhdf5_fortran -lhdf5_f90cstub -lhdf5

···

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elena Pourmal The HDF Group http://hdfgroup.org
1800 So. Oak St., Suite 203, Champaign IL 61820
217.531.6112
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

On Apr 18, 2012, at 11:21 AM, Allen D Byrne wrote:

Stephane,

    That should have been my next question - the order of the fortran libraries do matter. You'll need a fortran expert for an explanation.

I can answer your question about the new XXX_cstub.lib files - cmake had trouble building combined C and fortran library on windows - so for simplicity we just create two libraries on all platforms when using cmake.

Allen

> Hello,
>
> Do not ask me exactly why, but it seems that a part of my problem is solved: the linking.
>
> I changed the order of the libraries passed to the linker, with and without HL: -lhdf5_fortran -lhdf5 -lhdf5_f90cstub, or -lhdf5_fortran -lhdf5_f90cstub -lhdf5, or ... One combination works!
> I remember that this solves a so weird problem once... If someone knows why, I am very interested!
>
> However, the ctest fails, but I will look into that later: my code produces correct hdf5 files...
>
> ------------------------------------------------------------
> 99% tests passed, 12 tests failed out of 1979
>
> Total Test time (real) = 621.58 sec
>
> The following tests FAILED:
> 5 - lheap (Failed)
> 14 - dtypes (Failed)
> 67 - PERFORM_h5perf (Failed)
> 68 - PERFORM_mpi-perf (Failed)
> 69 - TEST_PAR_testphdf5 (Failed)
> 70 - TEST_PAR_t_mpi (Failed)
> 71 - TEST_PAR_t_cache (Failed)
> 72 - TEST_PAR_t_pflush1 (Failed)
> 73 - TEST_PAR_t_pflush2 (Failed)
> 74 - TEST_PAR_t_shapesame (Failed)
> 75 - TEST_PAR_t_posix_compliant (Failed)
> 80 - parallel_test (Failed)
> Errors while running CTest
> ------------------------------------------------------------
>
> Anyway, thanks for you support!
>
> Best,
>
> Stephane
>
> _______________________________________________
> Hdf-forum is for HDF software users discussion.
> Hdf-forum@hdfgroup.org
> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
>
_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org