Closed mboisson closed 1 year ago
Hello,
I don't remember ever seeing this error. Does it reproduce every time? Could you tell us more about how you built gudhi (options to cmake, output of cmake)? Is there anything unusual in your platform (virtual machine, compilation and execution on different machines, etc)?
Line 80 is assert gudhi.pick_n_random_points(points=[], nb_points=0) == []
, does running gudhi.pick_n_random_points(points=[], nb_points=0)
after just importing gudhi also crash?
Yes, it happens every time (until I disable the tests).
This is an install for cluster computing environments. The build is in a virtual machine. The tests are run on the same VM.
The whole build is using EasyBuild, with modules (external libraries), and is therefore rather complicated, but the gist of the commands being run is the following:
grep "running cmd" /home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1/easybuild/easybuild-GUDHI-3.7.1-20230216.163908.log
== 2023-02-16 16:24:22,821 run.py:236 INFO running cmd: tar xzf /home/mboisson/.local/easybuild/sources/g/GUDHI/gudhi.3.7.1.tar.gz
== 2023-02-16 16:24:39,346 run.py:236 INFO running cmd: cmake -DCMAKE_INSTALL_PREFIX=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Compiler/gcc9/boost/1.72.0 -DBoost_NO_SYSTEM_PATHS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DENABLE_XHOST=OFF -DCMAKE_SKIP_INSTALL_RPATH=ON -DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python3 .
== 2023-02-16 16:24:42,853 run.py:236 INFO running cmd: make -j 8
== 2023-02-16 16:24:54,769 run.py:236 INFO running cmd: make install && mkdir -p /home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1/lib/python3.10/site-packages && cd python && pip install --no-deps --no-build-isolation --prefix=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 .
== 2023-02-16 16:25:09,677 run.py:236 INFO running cmd: tar xzf /home/mboisson/.local/easybuild/sources/g/GUDHI/gudhi.3.7.1.tar.gz
== 2023-02-16 16:25:23,726 run.py:236 INFO running cmd: cmake -DCMAKE_INSTALL_PREFIX=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Compiler/gcc9/boost/1.72.0 -DBoost_NO_SYSTEM_PATHS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DENABLE_XHOST=OFF -DCMAKE_SKIP_INSTALL_RPATH=ON -DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python3 .
== 2023-02-16 16:25:28,600 run.py:236 INFO running cmd: make -j 8
== 2023-02-16 16:31:00,989 run.py:236 INFO running cmd: make install && mkdir -p /home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1/lib/python3.9/site-packages && cd python && pip install --no-deps --no-build-isolation --prefix=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 .
== 2023-02-16 16:31:35,739 run.py:236 INFO running cmd: tar xzf /home/mboisson/.local/easybuild/sources/g/GUDHI/gudhi.3.7.1.tar.gz
== 2023-02-16 16:31:49,786 run.py:236 INFO running cmd: cmake -DCMAKE_INSTALL_PREFIX=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DBoost_NO_BOOST_CMAKE=ON -DBOOST_ROOT=/cvmfs/soft.computecanada.ca/easybuild/software/2020/avx2/Compiler/gcc9/boost/1.72.0 -DBoost_NO_SYSTEM_PATHS=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DENABLE_XHOST=OFF -DCMAKE_SKIP_INSTALL_RPATH=ON -DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python3 .
== 2023-02-16 16:31:54,793 run.py:236 INFO running cmd: make -j 8
== 2023-02-16 16:37:28,439 run.py:236 INFO running cmd: make install && mkdir -p /home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1/lib/python3.8/site-packages && cd python && pip install --no-deps --no-build-isolation --prefix=/home/mboisson/.local/easybuild/software/2020/avx2/Compiler/gcc9/gudhi/3.7.1 .
== 2023-02-16 16:38:20,622 run.py:236 INFO running cmd: python -c 'import gudhi'
== 2023-02-16 16:38:34,991 run.py:236 INFO running cmd: python -c 'import gudhi'
== 2023-02-16 16:38:49,693 run.py:236 INFO running cmd: python -c 'import gudhi'
== 2023-02-16 16:39:08,687 run.py:236 INFO running cmd: gcc -v
== 2023-02-16 16:39:08,696 run.py:236 INFO running cmd: ldd --version
This is now with the tests disabled.
Actually, testing with python3 -c 'import gudhi; gudhi.pick_n_random_points(points=[], nb_points=0)'
, I can reproduce the issue with several official packages (conda/pip), but not all. I'll see what I can figure out.
Ah, it was starting to ring a bell, and indeed: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=813ad9c4dd5a779f12ad2abf710c6e75a3117ef0
This was a bug in older versions of gcc. If at all possible, you should use a more recent compiler. If not, look at the file pick_n_random_points.h in gudhi, and change #if __cplusplus >= 201703L
to #if 0
to avoid calling this broken code.
The problem only affects strange code (asking for 0 random points from an empty range), so it doesn't seem too bad.
Ah, thanks for the pointer. I'll see if we can backport the stdlib patch, or patch to skip this.
I note that the stdlib patch was only integrated in GCC version 11.3.0. Looking at the header files, all of our versions priori to GCC 11 have the same bug.
Note that it was backported to other branches, so for instance gcc-9.5 is fine, even 8.5 should work, but you are using an old version (9.3) of gcc-9...
Note that it was backported to other branches, so for instance gcc-9.5 is fine, even 8.5 should work, but you are using an old version (9.3) of gcc-9...
Quite possible indeed. Updating a compiler is not a trivial matter on a cluster, so we tend to pick one minor version per major version and stick with it forever.
I confirm that building with newer stdlib works. You can close this issue.
Currently building version 3.7.1, and one of the test fails with:
Any pointer on fixing this ?