diff options
-rw-r--r-- | .circleci/config.yml | 22 | ||||
-rw-r--r-- | .github/workflows/pip-build-linux.yml | 18 | ||||
-rw-r--r-- | .github/workflows/pip-build-osx.yml | 14 | ||||
-rw-r--r-- | .github/workflows/pip-build-windows.yml | 2 | ||||
-rw-r--r-- | .github/workflows/pip-packaging-linux.yml | 14 | ||||
-rw-r--r-- | .github/workflows/pip-packaging-osx.yml | 19 | ||||
-rw-r--r-- | .github/workflows/pip-packaging-windows.yml | 2 | ||||
-rw-r--r-- | biblio/bibliography.bib | 2 | ||||
-rw-r--r-- | biblio/test/test_biblio.tex | 7 | ||||
-rw-r--r-- | biblio/test/test_gudhi_citation.tex | 7 | ||||
-rwxr-xr-x | scripts/build_osx_universal_gmpfr.sh | 47 | ||||
-rw-r--r-- | src/Doxyfile.in | 1 | ||||
-rw-r--r-- | src/Tangential_complex/include/gudhi/Tangential_complex.h | 6 | ||||
-rw-r--r-- | src/cmake/modules/GUDHI_user_version_target.cmake | 7 |
14 files changed, 148 insertions, 20 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index c8c0b70b..ef22fbea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -82,6 +82,7 @@ jobs: cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 -DWITH_GUDHI_REMOTE_TEST=ON . cd python python3 setup.py build_ext --inplace + ctest --output-on-failure make sphinx cp -R sphinx /tmp/sphinx python3 setup.py install @@ -125,6 +126,26 @@ jobs: path: /tmp/doxygen destination: doxygen + bibliography: + docker: + - image: gudhi/doxygen_for_gudhi:latest + steps: + - checkout + - run: + name: Checkout submodules + command: | + git submodule sync + git submodule update --init + - run: + name: Test the LaTeX bibliography files + command: | + mkdir build + cd build + cmake -DWITH_GUDHI_THIRD_PARTY=OFF -DUSER_VERSION_DIR=version .. + cd biblio/test + latexmk -pdf -interaction=nonstopmode test_biblio.tex + latexmk -pdf -interaction=nonstopmode test_gudhi_citation.tex + ### With all third parties, except CGAL and Eigen @@ -303,3 +324,4 @@ workflows: - utils - python - doxygen + - bibliography diff --git a/.github/workflows/pip-build-linux.yml b/.github/workflows/pip-build-linux.yml index 11b6271d..bc4f999e 100644 --- a/.github/workflows/pip-build-linux.yml +++ b/.github/workflows/pip-build-linux.yml @@ -12,16 +12,16 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - name: Build wheel for Python 3.10 + - name: Build wheel for Python 3.11 run: | - mkdir build_310 - cd build_310 - cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON310/bin/python .. + mkdir build_311 + cd build_311 + cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON311/bin/python .. cd src/python - $PYTHON310/bin/python setup.py bdist_wheel + $PYTHON311/bin/python setup.py bdist_wheel auditwheel repair dist/*.whl - - name: Install and test wheel for Python 3.10 + - name: Install and test wheel for Python 3.11 run: | - $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl - $PYTHON310/bin/python -c "import gudhi; print(gudhi.__version__)" - $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py + $PYTHON311/bin/python -m pip install --user pytest build_311/src/python/dist/*.whl + $PYTHON311/bin/python -c "import gudhi; print(gudhi.__version__)" + $PYTHON311/bin/python -m pytest src/python/test/test_alpha_complex.py diff --git a/.github/workflows/pip-build-osx.yml b/.github/workflows/pip-build-osx.yml index 59e94ca5..a438124a 100644 --- a/.github/workflows/pip-build-osx.yml +++ b/.github/workflows/pip-build-osx.yml @@ -2,13 +2,18 @@ name: pip build osx on: [push, pull_request] +env: + MACOSX_DEPLOYMENT_TARGET: 10.14 + _PYTHON_HOST_PLATFORM: macosx-10.14-universal2 + ARCHFLAGS: "-arch arm64 -arch x86_64" + jobs: build: runs-on: macos-latest strategy: max-parallel: 4 matrix: - python-version: ['3.10'] + python-version: ['3.11'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 @@ -24,14 +29,21 @@ jobs: brew install boost eigen gmp mpfr cgal || true python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt python -m pip install --user twine delocate + ./scripts/build_osx_universal_gmpfr.sh + # Now the universal libraries are in $PWD/deps-uni/lib - name: Build python wheel run: | + export GMP_LIB_DIR=$PWD/deps-uni/lib + export GMPXX_LIB_DIR=$PWD/deps-uni/lib + export MPFR_LIB_DIR=$PWD/deps-uni/lib python --version mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DPython_ADDITIONAL_VERSIONS=3 .. cd src/python python setup.py bdist_wheel + export PATH="$PATH:`python -m site --user-base`/bin" + delocate-wheel --require-archs universal2 -v dist/*.whl - name: Install and test python wheel run: | python -m pip install --user pytest build/src/python/dist/*.whl diff --git a/.github/workflows/pip-build-windows.yml b/.github/workflows/pip-build-windows.yml index b3d75706..50bdfe2c 100644 --- a/.github/workflows/pip-build-windows.yml +++ b/.github/workflows/pip-build-windows.yml @@ -8,7 +8,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10'] + python-version: ['3.11'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pip-packaging-linux.yml b/.github/workflows/pip-packaging-linux.yml index 285cfa00..14b1cf7a 100644 --- a/.github/workflows/pip-packaging-linux.yml +++ b/.github/workflows/pip-packaging-linux.yml @@ -79,6 +79,19 @@ jobs: $PYTHON310/bin/python -m pip install --user pytest build_310/src/python/dist/*.whl $PYTHON310/bin/python -c "import gudhi; print(gudhi.__version__)" $PYTHON310/bin/python -m pytest src/python/test/test_alpha_complex.py + - name: Build wheel for Python 3.11 + run: | + mkdir build_311 + cd build_311 + cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$PYTHON311/bin/python .. + cd src/python + $PYTHON311/bin/python setup.py bdist_wheel + auditwheel repair dist/*.whl + - name: Install and test wheel for Python 3.11 + run: | + $PYTHON311/bin/python -m pip install --user pytest build_311/src/python/dist/*.whl + $PYTHON311/bin/python -c "import gudhi; print(gudhi.__version__)" + $PYTHON311/bin/python -m pytest src/python/test/test_alpha_complex.py - name: Publish on PyPi env: TWINE_USERNAME: __token__ @@ -89,3 +102,4 @@ jobs: $PYTHON36/bin/python -m twine upload build_38/src/python/wheelhouse/* $PYTHON36/bin/python -m twine upload build_39/src/python/wheelhouse/* $PYTHON36/bin/python -m twine upload build_310/src/python/wheelhouse/* + $PYTHON36/bin/python -m twine upload build_311/src/python/wheelhouse/* diff --git a/.github/workflows/pip-packaging-osx.yml b/.github/workflows/pip-packaging-osx.yml index 3ae840c6..9ddbcfce 100644 --- a/.github/workflows/pip-packaging-osx.yml +++ b/.github/workflows/pip-packaging-osx.yml @@ -4,13 +4,18 @@ on: release: types: [published] +env: + MACOSX_DEPLOYMENT_TARGET: 10.15 + _PYTHON_HOST_PLATFORM: macosx-10.15-universal2 + ARCHFLAGS: "-arch arm64 -arch x86_64" + jobs: build: runs-on: macos-latest strategy: max-parallel: 4 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 @@ -26,8 +31,13 @@ jobs: brew install boost eigen gmp mpfr cgal || true python -m pip install --user -r ext/gudhi-deploy/build-requirements.txt python -m pip install --user twine delocate + ./scripts/build_osx_universal_gmpfr.sh + # Now the universal libs are in $PWD/deps-uni/lib - name: Build python wheel run: | + export GMP_LIB_DIR=$PWD/deps-uni/lib + export GMPXX_LIB_DIR=$PWD/deps-uni/lib + export MPFR_LIB_DIR=$PWD/deps-uni/lib python --version mkdir build cd build @@ -45,6 +55,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | mkdir wheelhouse - /Users/runner/.local/bin/delocate-listdeps build/src/python/dist/* - /Users/runner/.local/bin/delocate-wheel --require-archs x86_64 -w wheelhouse build/src/python/dist/* - python -m twine upload wheelhouse/*
\ No newline at end of file + export PATH="$PATH:`python -m site --user-base`/bin" + delocate-listdeps build/src/python/dist/* + delocate-wheel --require-archs universal2 -w wheelhouse build/src/python/dist/* + python -m twine upload wheelhouse/* diff --git a/.github/workflows/pip-packaging-windows.yml b/.github/workflows/pip-packaging-windows.yml index 6f544499..df0db9a5 100644 --- a/.github/workflows/pip-packaging-windows.yml +++ b/.github/workflows/pip-packaging-windows.yml @@ -10,7 +10,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] name: Build wheels for Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 diff --git a/biblio/bibliography.bib b/biblio/bibliography.bib index 0a3ef43d..d8472ad0 100644 --- a/biblio/bibliography.bib +++ b/biblio/bibliography.bib @@ -1090,7 +1090,7 @@ language={English} @ARTICLE{Reininghaus_Huber_ALL_PSSK, author = {J. Reininghaus and S. Huber and U. Bauer and R. Kwitt}, title = {A Stable Multi-Scale Kernel for Topological Machine Learning.}, - journal = {Proc. 2015 IEEE Conf. Comp. Vision & Pat. Rec. (CVPR '15)}, + journal = {Proc. 2015 IEEE Conf. Comp. Vision \& Pat. Rec. (CVPR '15)}, year = {2015} } diff --git a/biblio/test/test_biblio.tex b/biblio/test/test_biblio.tex new file mode 100644 index 00000000..97dee9ed --- /dev/null +++ b/biblio/test/test_biblio.tex @@ -0,0 +1,7 @@ +\documentclass{article} +\usepackage{hyperref} +\bibliographystyle{plainurl} +\begin{document} +\nocite{*} +\bibliography{../bibliography} +\end{document}
\ No newline at end of file diff --git a/biblio/test/test_gudhi_citation.tex b/biblio/test/test_gudhi_citation.tex new file mode 100644 index 00000000..5fb2d33d --- /dev/null +++ b/biblio/test/test_gudhi_citation.tex @@ -0,0 +1,7 @@ +\documentclass{article} +\usepackage{hyperref} +\bibliographystyle{plainurl} +\begin{document} +\nocite{*} +\bibliography{../how_to_cite_gudhi} +\end{document}
\ No newline at end of file diff --git a/scripts/build_osx_universal_gmpfr.sh b/scripts/build_osx_universal_gmpfr.sh new file mode 100755 index 00000000..3dafa3ce --- /dev/null +++ b/scripts/build_osx_universal_gmpfr.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -e + +# In the working directory, creates deps-uni/lib/* +# Assumes that the user has enough rights to run brew fetch + +# Downloading +mkdir deps-amd64 +cd deps-amd64 +tar xf "`brew fetch --bottle-tag=big_sur gmp | sed -ne 's/^Downloaded to: //p'`" +tar xf "`brew fetch --bottle-tag=big_sur mpfr | sed -ne 's/^Downloaded to: //p'`" +cd .. +mkdir deps-arm64 +cd deps-arm64 +tar xf "`brew fetch --bottle-tag=arm64_big_sur gmp | sed -ne 's/^Downloaded to: //p'`" +tar xf "`brew fetch --bottle-tag=arm64_big_sur mpfr | sed -ne 's/^Downloaded to: //p'`" +cd .. + +# Merging +mkdir -p deps-uni/lib +GMP1=deps-amd64/gmp/*/lib/libgmp.*.dylib +GMP=`basename $GMP1` +GMPXX1=deps-amd64/gmp/*/lib/libgmpxx.*.dylib +GMPXX=`basename $GMPXX1` +MPFR1=deps-amd64/mpfr/*/lib/libmpfr.*.dylib +MPFR=`basename $MPFR1` +lipo -create $GMP1 deps-arm64/gmp/*/lib/$GMP -output deps-uni/lib/$GMP +lipo -create $GMPXX1 deps-arm64/gmp/*/lib/$GMPXX -output deps-uni/lib/$GMPXX +lipo -create $MPFR1 deps-arm64/mpfr/*/lib/$MPFR -output deps-uni/lib/$MPFR + +# Necessary even for libs created by lipo +install_name_tool -id $PWD/deps-uni/lib/$GMP deps-uni/lib/$GMP +install_name_tool -id $PWD/deps-uni/lib/$GMPXX deps-uni/lib/$GMPXX +install_name_tool -id $PWD/deps-uni/lib/$MPFR deps-uni/lib/$MPFR +# Also fix dependencies +BADGMP=`otool -L deps-uni/lib/$MPFR|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'` +install_name_tool -change $BADGMP $PWD/deps-uni/lib/$GMP deps-uni/lib/$MPFR +BADGMP=`otool -L deps-uni/lib/$GMPXX|sed -ne 's/[[:space:]]*\(.*libgmp\..*dylib\).*/\1/p'` +install_name_tool -change $BADGMP $PWD/deps-uni/lib/$GMP deps-uni/lib/$GMPXX + +ln -s $GMP deps-uni/lib/libgmp.dylib +ln -s $GMPXX deps-uni/lib/libgmpxx.dylib +ln -s $MPFR deps-uni/lib/libmpfr.dylib + +# Debug +ls -l deps-uni/lib +otool -L deps-uni/lib/*.*.dylib diff --git a/src/Doxyfile.in b/src/Doxyfile.in index 1ec190d9..d5664a49 100644 --- a/src/Doxyfile.in +++ b/src/Doxyfile.in @@ -700,7 +700,6 @@ LAYOUT_FILE = # search path. See also \cite for info how to create references. CITE_BIB_FILES = @CMAKE_SOURCE_DIR@/biblio/bibliography.bib \ - @CMAKE_SOURCE_DIR@/biblio/how_to_cite_cgal.bib \ @CMAKE_SOURCE_DIR@/biblio/how_to_cite_gudhi.bib #--------------------------------------------------------------------------- diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h index b448db2d..ab203ca5 100644 --- a/src/Tangential_complex/include/gudhi/Tangential_complex.h +++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h @@ -56,6 +56,7 @@ #include <string> #include <cstddef> // for std::size_t #include <optional> +#include <numeric> // for std::iota #ifdef GUDHI_USE_TBB #include <tbb/parallel_for.h> @@ -624,6 +625,11 @@ class Tangential_complex { int max_dim = -1; + // Ordered vertices to be inserted first by the create_complex method to avoid quadratic complexity. + std::vector<typename Simplex_tree_::Vertex_handle> vertices(m_points.size()); + std::iota(vertices.begin(), vertices.end(), 0); + tree.insert_batch_vertices(vertices); + // For each triangulation for (std::size_t idx = 0; idx < m_points.size(); ++idx) { // For each cell of the star diff --git a/src/cmake/modules/GUDHI_user_version_target.cmake b/src/cmake/modules/GUDHI_user_version_target.cmake index 2144ff6f..b9bf1414 100644 --- a/src/cmake/modules/GUDHI_user_version_target.cmake +++ b/src/cmake/modules/GUDHI_user_version_target.cmake @@ -18,14 +18,17 @@ add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E string(TIMESTAMP GUDHI_VERSION_YEAR "%Y") configure_file(${CMAKE_SOURCE_DIR}/biblio/how_to_cite_gudhi.bib.in "${CMAKE_CURRENT_BINARY_DIR}/biblio/how_to_cite_gudhi.bib" @ONLY) file(COPY "${CMAKE_SOURCE_DIR}/biblio/bibliography.bib" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/biblio/") +file(COPY "${CMAKE_SOURCE_DIR}/biblio/test" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/biblio") # append cgal citation inside bibliography - sphinx cannot deal with more than one bib file file(READ "${CMAKE_SOURCE_DIR}/biblio/how_to_cite_cgal.bib" CGAL_CITATION_CONTENT) file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/biblio/bibliography.bib" "${CGAL_CITATION_CONTENT}") -# Copy biblio directory for user version +# Copy biblio files for user version add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E - copy_directory ${CMAKE_CURRENT_BINARY_DIR}/biblio ${GUDHI_USER_VERSION_DIR}/biblio) + copy ${CMAKE_CURRENT_BINARY_DIR}/biblio/bibliography.bib ${GUDHI_USER_VERSION_DIR}/biblio/bibliography.bib) +add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E + copy ${CMAKE_CURRENT_BINARY_DIR}/biblio/how_to_cite_gudhi.bib ${GUDHI_USER_VERSION_DIR}/biblio/how_to_cite_gudhi.bib) add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/README.md ${GUDHI_USER_VERSION_DIR}/README.md) |