Created attachment 4992 Patches for Ubuntu (18.04 LTS and 19.04) and master branch # Intro I have analyzed the source code of the `modules/hdf5` folder. I have used KDevelop IDE for doing so. It has full feature *Semantic code* analyzer ( https://www.kdevelop.org/screenshots/c-semantic-information-tooltip ). Without KDevelop you can detect problems with datatypes after adding `-Wconversion` to the CFGLAGS and CXXFLAGS variables inside `modules/hdf5/Makefile`. Usually the warning messages from GCC look like: ``` src/c/h5_writeDataToFile.c: In function 'writeStringMatrix': src/c/h5_writeDataToFile.c:296:27: warning: conversion to 'int' from 'hid_t {aka long int}' may alter its value [-Wconversion] status = addAttribute(dset, g_SCILAB_CLASS, g_SCILAB_CLASS_STRING); ^~~~ ... src/c/h5_fileManagement.c: In function 'openHDF5File': src/c/h5_fileManagement.c:161:12: warning: conversion to 'int' from 'hid_t {aka long int}' may alter its value [-Wconversion] return file; ^~~~ ... src/c/h5_fileManagement.c: In function 'createHDF5File': src/c/h5_fileManagement.c:101:12: warning: conversion to 'int' from 'hid_t {aka long int}' may alter its value [-Wconversion] return file; ^~~~ sci_gateway/cpp/sci_hdf5_listvar_v3.cpp: In function 'bool read_struct(int, VarInfo6&)': sci_gateway/cpp/sci_hdf5_listvar_v3.cpp:738:42: warning: conversion to 'int' from 'hid_t {aka long int}' may alter its value [-Wconversion] int data = H5Rdereference(refs, ``` and so on. # Patching I attach 3 patches to fix HDF-related problems in Ubuntu (18.04 LTS and 19.04) and in master branch. ## Ubuntu 18.04 LTS Applying patch is as follows: ``` sudo apt-get build-dep scilab cd ~/Downloads apt-get source scilab cd scilab-6.0.1 dpkg-builpackage -b -j$(nproc) # build to see current state cd modules/hdf5 patch -p1 < ~/Downloads/scilab-6.0.1-ubuntu-bionic.patch cd ../.. dpkg-builpackage -b -j$(nproc) # build to see changes ``` As the patch is applied then we can test patched Scilab. The results from `test_run('hdf5')` are the following: ``` -->test_run('hdf5') TMPDIR = /tmp/SCI_TMP_2556_AWXxWF Module 001/001 - [hdf5] : 001/046 - [hdf5] binary_bit-for-bit..........................passed 002/046 - [hdf5] h5attr......................................passed 003/046 - [hdf5] h5close.....................................passed 004/046 - [hdf5] h5cp........................................passed 005/046 - [hdf5] h5dataset...................................passed 006/046 - [hdf5] h5exists....................................passed 007/046 - [hdf5] h5flush.....................................passed 008/046 - [hdf5] h5group.....................................passed 009/046 - [hdf5] h5isAttr....................................passed 010/046 - [hdf5] h5isFile....................................passed 011/046 - [hdf5] h5isGroup...................................passed 012/046 - [hdf5] h5isRef.....................................passed 013/046 - [hdf5] h5isSet.....................................passed 014/046 - [hdf5] h5isSpace...................................passed 015/046 - [hdf5] h5isType....................................passed 016/046 - [hdf5] h5label.....................................passed 017/046 - [hdf5] h5ln........................................passed 018/046 - [hdf5] h5ls........................................passed 019/046 - [hdf5] h5mount.....................................passed 020/046 - [hdf5] h5mv........................................passed 021/046 - [hdf5] h5open......................................passed 022/046 - [hdf5] h5read......................................passed 023/046 - [hdf5] h5readattr..................................passed 024/046 - [hdf5] h5rm........................................passed 025/046 - [hdf5] h5umount....................................passed 026/046 - [hdf5] h5write.....................................passed 027/046 - [hdf5] loadhdf5data................................passed 028/046 - [hdf5] loadhdf5data_v1.............................passed 029/046 - [hdf5] saveloadHdf5................................passed 030/046 - [hdf5] bug_11954...................................passed 031/046 - [hdf5] bug_12285...................................passed 032/046 - [hdf5] bug_13689...................................passed 033/046 - [hdf5] bug_13941...................................passed 034/046 - [hdf5] bug_14149...................................passed 035/046 - [hdf5] bug_14446...................................passed 036/046 - [hdf5] bug_14775...................................passed 037/046 - [hdf5] bug_14886...................................failed: Slave Scilab exited with error code 51 038/046 - [hdf5] bug_15188...................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 039/046 - [hdf5] bug_15302...................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 040/046 - [hdf5] bug_5629....................................passed 041/046 - [hdf5] bug_6440....................................passed 042/046 - [hdf5] bug_7224....................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 043/046 - [hdf5] bug_8170....................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 044/046 - [hdf5] bug_8383....................................passed 045/046 - [hdf5] bug_9510....................................passed 046/046 - [hdf5] matrix_as_input.............................passed -------------------------------------------------------------------------- Summary tests 46 - 100 % passed 41 - 89 % failed 5 - 10 % skipped 0 length 22.47 sec -------------------------------------------------------------------------- ``` Note: in output above cases with `error_output not empty` are not critical, the output really contain warnings on Scilab start, so all asserts were satisfied. The ATOMS works - tested `atomsSystemUpdate`, `atomsShow` and `atomsInstall`. ## Ubuntu 19.04 Applying patch is as follows: ``` sudo apt-get build-dep scilab cd ~/Downloads apt-get source scilab cd scilab-6.0.2 dpkg-builpackage -b -j$(nproc) # build to see current state cd modules/hdf5 patch -p1 < ~/Downloads/scilab-6.0.2-ubuntu-disco.patch cd ../.. dpkg-builpackage -b -j$(nproc) # build to see changes ``` As the patch is applied then we can test patched Scilab. The results from `test_run('hdf5')` are the following: ``` -->test_run('hdf5') TMPDIR = /tmp/SCI_TMP_6072_vVoEAx Module 001/001 - [hdf5] : 001/052 - [hdf5] binary_bit-for-bit..........................passed 002/052 - [hdf5] h5attr......................................passed 003/052 - [hdf5] h5close.....................................passed 004/052 - [hdf5] h5cp........................................passed 005/052 - [hdf5] h5dataset...................................failed: Slave Scilab exited with error code 1 006/052 - [hdf5] h5exists....................................passed 007/052 - [hdf5] h5flush.....................................passed 008/052 - [hdf5] h5group.....................................passed 009/052 - [hdf5] h5isAttr....................................passed 010/052 - [hdf5] h5isFile....................................passed 011/052 - [hdf5] h5isGroup...................................passed 012/052 - [hdf5] h5isRef.....................................passed 013/052 - [hdf5] h5isSet.....................................passed 014/052 - [hdf5] h5isSpace...................................passed 015/052 - [hdf5] h5isType....................................passed 016/052 - [hdf5] h5label.....................................passed 017/052 - [hdf5] h5ln........................................passed 018/052 - [hdf5] h5ls........................................passed 019/052 - [hdf5] h5mount.....................................failed: Slave Scilab exited with error code 1 020/052 - [hdf5] h5mv........................................passed 021/052 - [hdf5] h5open......................................passed 022/052 - [hdf5] h5read......................................passed 023/052 - [hdf5] h5readattr..................................passed 024/052 - [hdf5] h5rm........................................passed 025/052 - [hdf5] h5umount....................................passed 026/052 - [hdf5] h5write.....................................passed 027/052 - [hdf5] loadhdf5data................................passed 028/052 - [hdf5] loadhdf5data_v1.............................passed 029/052 - [hdf5] saveloadHdf5................................passed 030/052 - [hdf5] bug_11954...................................passed 031/052 - [hdf5] bug_12285...................................passed 032/052 - [hdf5] bug_13689...................................passed 033/052 - [hdf5] bug_13941...................................passed 034/052 - [hdf5] bug_14149...................................passed 035/052 - [hdf5] bug_14446...................................passed 036/052 - [hdf5] bug_14775...................................passed 037/052 - [hdf5] bug_14886...................................failed: Slave Scilab exited with error code 51 038/052 - [hdf5] bug_15188...................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 039/052 - [hdf5] bug_15302...................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 040/052 - [hdf5] bug_15501...................................passed 041/052 - [hdf5] bug_15502...................................passed 042/052 - [hdf5] bug_15692...................................passed 043/052 - [hdf5] bug_15693...................................passed 044/052 - [hdf5] bug_15721...................................passed 045/052 - [hdf5] bug_15809...................................passed 046/052 - [hdf5] bug_5629....................................passed 047/052 - [hdf5] bug_6440....................................passed 048/052 - [hdf5] bug_7224....................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 049/052 - [hdf5] bug_8170....................................failed: error_output not empty Use 'no_check_error_output' option to disable this check. 050/052 - [hdf5] bug_8383....................................passed 051/052 - [hdf5] bug_9510....................................passed 052/052 - [hdf5] matrix_as_input.............................passed -------------------------------------------------------------------------- Summary tests 52 - 100 % passed 45 - 86 % failed 7 - 13 % skipped 0 length 19.30 sec -------------------------------------------------------------------------- ``` Note: in output above cases with `error_output not empty` are not critical, the output really contain warnings on Scilab start, so all asserts were satisfied. The ATOMS works - tested `atomsSystemUpdate`, `atomsShow` and `atomsInstall`. ## Master branch ``` git clone git://git.scilab.org/scilab scilab-master cd scilab-master/scilab patch -p1 -R < ~/Downloads/scilab-master-20190730.patch ``` This patch is untested, please apply it and test by yourself. I was stuck with `./configure` script - it does not find JOGL and Javah. Seems to need patching. # Conclusion Patches provided here should be comprehensively tested. I can't give any warranty about their functionality. But I see that `test_run('hdf5')` have near 100% of passed tests. And ATOMS work as expected after applying these patches. I'm not too familiar with hdf5 integration into Scilab code. I suspect that there maybe problems with figure handles. Many warnings are not fixed for `modules/hdf5/src/cpp/handle_properties.cpp`. For example ``` 860:5: Implicit conversion loses integer precision: 'hid_t' (aka 'long') to 'int' [-Wshorten-64-to-32] ``` but they can't be simply fixed because of deep dependencies from other modules. According to information from HDFGroup - the HDF5 1.8 will be end-of-life very soon ( https://www.hdfgroup.org/2018/06/release-of-hdf5-1-8-21-newsletter-161/ ). So these patches will become actual in very near future after improvement.