FS#42227 - [octave] complains about hdf5 files, fail to recompile

Attached to Project: Arch Linux
Opened by Giuseppe Borzi (gborzi) - Friday, 03 October 2014, 12:10 GMT
Last edited by Ronald van Haren (pressh) - Tuesday, 07 October 2014, 06:00 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ronald van Haren (pressh)
Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description: saving and loading data in hdf5 format (load -hdf5, save -hdf5) fails with the error message:
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.12, library is 1.8.13
....

Using the suggested HDF5_DISABLE_VERSION_CHECK=1 (or 2) solves the problem, but is annoying. So, I tried to recompile octave but it fails with error message:
In file included from /usr/include/SuiteSparse_config.h:47:0,
from /usr/include/amd.h:46,
from ./util/oct-sparse.h:33,
from numeric/sparse-base-chol.h:27,
from numeric/SparseCmplxCHOL.h:27,
from numeric/SparseCmplxCHOL.cc:28:
../libgnu/math.h: In function 'int signbit(double)':
../libgnu/math.h:2576:1: error: conflicting declaration of C function 'int signbit(double)'
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
....

Additional info:
* package version(s) octave 3.8.1-1, hdf5 1.8.13-1
* config and/or log files etc.


Steps to reproduce:
Inside octave type: A=rand(2,2); save -hdf5 "A.h5" A
try to rebuild octave.
This task depends upon

Closed by  Ronald van Haren (pressh)
Tuesday, 07 October 2014, 06:00 GMT
Reason for closing:  Fixed
Additional comments about closing:  suitesparse 4.3.1-2
octave 3.8.2-1
Comment by Ronald van Haren (pressh) - Saturday, 04 October 2014, 14:56 GMT
Attached patch is based on upstream discussion and commits and a related bug. Still doesn't build after applying the patch though.

/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_finish'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_free_factor'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_print_common'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_free_sparse'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_analyze'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_start'
/build/octave/src/octave-3.8.2/liboctave/.libs/liboctave.so: undefined reference to `cholmod_transpose'
collect2: error: ld returned 1 exit status
Makefile:2248: recipe for target 'octave-gui' failed
make[2]: *** [octave-gui] Error 1
make[2]: Leaving directory '/build/octave/src/octave-3.8.2/src'
Makefile:2118: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/build/octave/src/octave-3.8.2'
Makefile:1983: recipe for target 'all' failed
make: *** [all] Error 2
Comment by Bartłomiej Piotrowski (Barthalion) - Saturday, 04 October 2014, 15:21 GMT
It looks like cholmod[1] is missing from dependencies. I can make a PKGBUILD for it tommorow.

[1] https://www.cise.ufl.edu/research/sparse/cholmod/
Comment by Giuseppe Borzi (gborzi) - Saturday, 04 October 2014, 15:28 GMT
But isn't cholmod included in suitesparse?
$ pacman -Ql suitesparse |grep cholmod
suitesparse /usr/include/cholmod.h
suitesparse /usr/include/cholmod_blas.h
suitesparse /usr/include/cholmod_camd.h
suitesparse /usr/include/cholmod_check.h
suitesparse /usr/include/cholmod_cholesky.h
suitesparse /usr/include/cholmod_complexity.h
suitesparse /usr/include/cholmod_config.h
suitesparse /usr/include/cholmod_core.h
suitesparse /usr/include/cholmod_gpu.h
suitesparse /usr/include/cholmod_gpu_kernels.h
suitesparse /usr/include/cholmod_io64.h
suitesparse /usr/include/cholmod_matrixops.h
suitesparse /usr/include/cholmod_modify.h
suitesparse /usr/include/cholmod_partition.h
suitesparse /usr/include/cholmod_supernodal.h
suitesparse /usr/include/cholmod_template.h
suitesparse /usr/lib/libcholmod.3.0.1.a
suitesparse /usr/lib/libcholmod.a
Comment by Bartłomiej Piotrowski (Barthalion) - Saturday, 04 October 2014, 15:43 GMT
Oh, you are right. I was looking at project page, I didn't know it's already included in suitesparse.
Comment by Ronald van Haren (pressh) - Saturday, 04 October 2014, 16:42 GMT
apparently octave doesn't detect any of the suitesparse libs according to the output of ./configure
Comment by Giuseppe Borzi (gborzi) - Saturday, 04 October 2014, 19:23 GMT
On my system this happens for colamd, ccolamd, cholmod.
Comment by Bartłomiej Piotrowski (Barthalion) - Saturday, 04 October 2014, 19:39 GMT
Yet another problem I see is that suitesparse doesn't really provide shared libraries. Is that on purpose?
Comment by Ronald van Haren (pressh) - Saturday, 04 October 2014, 20:06 GMT
Upstream doesn't provide a clean way to build shared libraries. I suppose we could adopt adopt the buildscript from Fedora [1]. We also should apply [2] and remove the math.h bit from the patch I attached earlier. Let me try and see if octave picks up the shared suitesparse libs.

[1] http://pkgs.fedoraproject.org/cgit/suitesparse.git/tree/suitesparse.spec
[2] http://pkgs.fedoraproject.org/cgit/suitesparse.git/tree/suitesparse-math.patch
Comment by Giuseppe Borzi (gborzi) - Monday, 06 October 2014, 15:01 GMT
I've made a PKGBUILD for suitesparse with the patch linked by Ronald and that gives shared libraries. The static libraries are removed from my PKGBUILD. Now octave seems to compile past the previous error, but there is another problem. Octave compilation fails with

array/CSparse.cc:5667:19: error: 'cholmod_common' has no member named 'print_function'
cm->print_function = 0;
...
looking at cholmod_core.h (suitesparse) I found
/* CHOLMOD print_function replaced with SuiteSparse_config.print_func */
I'll look at octave development code (git?) to find a fix.
   PKGBUILD (3.9 KiB)
Comment by Ronald van Haren (pressh) - Monday, 06 October 2014, 18:43 GMT
Thanks. It doesn't look too pretty but it seems to be working.

I think I have octave building now (although it may stop at yet another error). I'll report back when it either finishes or fails.
Comment by Ronald van Haren (pressh) - Monday, 06 October 2014, 19:50 GMT
The build completed without issue. I've to build it again before I can push it to the repos so it probably will have to wait for tomorrow.

I've pushed the changes to trunk if you're in a hurry (it doesn't show up on the web interface yet but I suppose it will soon).

Comment by Giuseppe Borzi (gborzi) - Monday, 06 October 2014, 20:59 GMT
I've just finished compiling octave and tested some functions for sparse matrices. It works.

Loading...