From f8de2e42b9427ae3a0569709b36f2c607c1751f3 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Mon, 18 Nov 2019 22:26:41 +0100 Subject: [PATCH 01/32] [CMake] Set CPack variables for packages meta-data --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e3c5b9fb56..ee959112a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,21 @@ endif() # like the TopologyToolKit.so file for paraview option(BUILD_SHARED_LIBS "Build TTK as shared lib" ON) +set(CPACK_PACKAGE_NAME "TTK") +set(CPACK_PACKAGE_FILE_NAME "ttk") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Topology ToolKit") +set(CPACK_PACKAGE_VERSION_MAJOR ${TTK_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${TTK_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH ${TTK_VERSION_PATCH}) +set(CPACK_GENERATOR "DEB") +set(CPACK_PACKAGE_CONTACT "Julien Tierny ") +set(CPACK_PACKAGE_VENDOR "LIP6 - Sorbonne Université") +set(CPACK_PACKAGE_HOMEPAGE_URL "https://topology-tool-kit.github.io/") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "ttk-paraview (= 5.8.0), python3-sklearn") +# autogenerate dependency information +set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +include(CPack) + if(TTK_BUILD_STANDALONE_APPS AND NOT TTK_BUILD_VTK_WRAPPERS) message(WARNING "Can't build standalones without the VTK wrappers: disable") set(TTK_BUILD_STANDALONE_APPS OFF CACHE BOOL "Build the cmd and gui commands" FORCE) From 6f6a51d9344e6aaebad2a3ca117a37843eafd594 Mon Sep 17 00:00:00 2001 From: pierre-guillou <47317188+pierre-guillou@users.noreply.github.com> Date: Wed, 12 Aug 2020 11:10:49 +0200 Subject: [PATCH 02/32] Create main.yml --- .github/workflows/main.yml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..74cbac4a90 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,79 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Install Ubuntu dependencies + run: | + sudo apt update + # ParaView dependencies + sudo apt install -y \ + qt5-default \ + qttools5-dev \ + qtxmlpatterns5-dev-tools \ + libqt5x11extras5-dev \ + libqt5svg5-dev \ + # TTK dependencies + sudo apt install -y \ + libboost-dev \ + libeigen3-dev \ + libgraphviz-dev \ + libsqlite3-dev \ + graphviz \ + python3-sklearn \ + zlib1g-dev + + - name: Install Spectra dependency + run: | + git clone --depth 1 https://github.com/yixuan/spectra + mkdir build_spectra && cd build_spectra + cmake ../spectra + sudo make install + + - name: Install ZFP dependency + run: | + git clone --depth 1 https://github.com/LLNL/zfp + mkdir build_zfp && cd build_zfp + cmake \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + ../zfp + sudo make -j$(nproc) install + + - name: Build & install patched ParaView + run: | + git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk + mkdir build_paraview && cd build_paraview + cmake \ + -DVTK_ENABLE_OSPRAY=OFF \ + ../paraview-ttk + sudo make -j$(nproc) install + + - name: Create & configure TTK build directory + run: | + mkdir build + cd build + cmake \ + $GITHUB_WORKSPACE + + - name: Build TTK + run: | + cd build + make -j$(nproc) From fc223dbf210f73690c99e3eeab11acd62cd1950d Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 12 Aug 2020 15:03:06 +0200 Subject: [PATCH 03/32] Cache ParaView build --- .github/workflows/main.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74cbac4a90..4f6517d84d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,21 +57,35 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Build & install patched ParaView + - name: Clone ParaView & create build directory run: | git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk mkdir build_paraview && cd build_paraview - cmake \ - -DVTK_ENABLE_OSPRAY=OFF \ - ../paraview-ttk - sudo make -j$(nproc) install + # copy ParaView version file into build directory + cp ../paraview-ttk/version.txt . + + - name: Cache ParaView build directory + id: cache-paraview + uses: actions/cache@v2 + with: + path: build_paraview + key: ${{ runner.os }}-paraview-${{ hashFiles('build_paraview/version.txt') }} + + - name: Build patched ParaView + if: steps.cache-paraview.outputs.cache-hit != 'true' + run: | + cd build_paraview + cmake -DVTK_ENABLE_OSPRAY=OFF ../paraview-ttk + make -j$(nproc) + + - name: Install ParaView cached artifacts + run: cd build_paraview && sudo make install - name: Create & configure TTK build directory run: | mkdir build cd build - cmake \ - $GITHUB_WORKSPACE + cmake $GITHUB_WORKSPACE - name: Build TTK run: | From 7aea3730fd231cc9dcf4d41ee40d4071d353c54b Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 12 Aug 2020 16:56:06 +0200 Subject: [PATCH 04/32] Simplify ParaView caching --- .github/workflows/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f6517d84d..a9d3f4346d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,19 +57,16 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Clone ParaView & create build directory + - name: Clone ParaView repository to get access to version.txt run: | git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk - mkdir build_paraview && cd build_paraview - # copy ParaView version file into build directory - cp ../paraview-ttk/version.txt . - name: Cache ParaView build directory id: cache-paraview uses: actions/cache@v2 with: path: build_paraview - key: ${{ runner.os }}-paraview-${{ hashFiles('build_paraview/version.txt') }} + key: ${{ runner.os }}-paraview-${{ hashFiles('paraview_ttk/version.txt') }} - name: Build patched ParaView if: steps.cache-paraview.outputs.cache-hit != 'true' From 8bf4897669bb4c3cdec443acd0543e217ea3e45b Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 12 Aug 2020 18:52:07 +0200 Subject: [PATCH 05/32] Use install folder as cache --- .github/workflows/main.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9d3f4346d..3a557e8907 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,15 @@ jobs: python3-sklearn \ zlib1g-dev + - name: Cache ParaView/Spectra/ZFP install directory + id: cache-paraview + uses: actions/cache@v2 + with: + path: /usr/local + key: ${{ runner.os }}-deps-v5.8.0 + - name: Install Spectra dependency + if: steps.cache-paraview.outputs.cache-hit != 'true' run: | git clone --depth 1 https://github.com/yixuan/spectra mkdir build_spectra && cd build_spectra @@ -48,6 +56,7 @@ jobs: sudo make install - name: Install ZFP dependency + if: steps.cache-paraview.outputs.cache-hit != 'true' run: | git clone --depth 1 https://github.com/LLNL/zfp mkdir build_zfp && cd build_zfp @@ -57,26 +66,13 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Clone ParaView repository to get access to version.txt - run: | - git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk - - - name: Cache ParaView build directory - id: cache-paraview - uses: actions/cache@v2 - with: - path: build_paraview - key: ${{ runner.os }}-paraview-${{ hashFiles('paraview_ttk/version.txt') }} - - - name: Build patched ParaView + - name: Build & install patched ParaView if: steps.cache-paraview.outputs.cache-hit != 'true' run: | - cd build_paraview + git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk + mkdir build_paraview && cd build_paraview cmake -DVTK_ENABLE_OSPRAY=OFF ../paraview-ttk - make -j$(nproc) - - - name: Install ParaView cached artifacts - run: cd build_paraview && sudo make install + sudo make -j$(nproc) install - name: Create & configure TTK build directory run: | From ca175fd50fdf62332c1ec024122177eee7308864 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 12 Aug 2020 22:04:58 +0200 Subject: [PATCH 06/32] Build .deb packages --- .github/workflows/main.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a557e8907..a09ead3a76 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,7 @@ jobs: qtxmlpatterns5-dev-tools \ libqt5x11extras5-dev \ libqt5svg5-dev \ + dpkg-dev # TTK dependencies sudo apt install -y \ libboost-dev \ @@ -40,15 +41,7 @@ jobs: python3-sklearn \ zlib1g-dev - - name: Cache ParaView/Spectra/ZFP install directory - id: cache-paraview - uses: actions/cache@v2 - with: - path: /usr/local - key: ${{ runner.os }}-deps-v5.8.0 - - name: Install Spectra dependency - if: steps.cache-paraview.outputs.cache-hit != 'true' run: | git clone --depth 1 https://github.com/yixuan/spectra mkdir build_spectra && cd build_spectra @@ -56,7 +49,6 @@ jobs: sudo make install - name: Install ZFP dependency - if: steps.cache-paraview.outputs.cache-hit != 'true' run: | git clone --depth 1 https://github.com/LLNL/zfp mkdir build_zfp && cd build_zfp @@ -66,13 +58,24 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Build & install patched ParaView + - name: Cache ParaView .deb package + id: cache-paraview + uses: actions/cache@v2 + with: + path: ttk-paraview.deb + key: ${{ runner.os }}-pv-deb-v5.8.0 + + - name: Build patched ParaView if: steps.cache-paraview.outputs.cache-hit != 'true' run: | git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk mkdir build_paraview && cd build_paraview cmake -DVTK_ENABLE_OSPRAY=OFF ../paraview-ttk - sudo make -j$(nproc) install + cd .. + cmake --build build_paraview --target package -- -j$(nproc) + + - name: Install ParaView .deb + run: sudo dpkg -i ttk-paraview.deb - name: Create & configure TTK build directory run: | @@ -82,5 +85,4 @@ jobs: - name: Build TTK run: | - cd build - make -j$(nproc) + cmake --build build --target package -- -j$(nproc) From 4de2ccb31c8fb2e4fd3d487a6e9323dedf87221e Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Fri, 14 Aug 2020 15:09:51 +0200 Subject: [PATCH 07/32] Fix build package? --- .github/workflows/main.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a09ead3a76..7c6808188b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: id: cache-paraview uses: actions/cache@v2 with: - path: ttk-paraview.deb + path: build_paraview/ttk-paraview.deb key: ${{ runner.os }}-pv-deb-v5.8.0 - name: Build patched ParaView @@ -71,18 +71,28 @@ jobs: git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk mkdir build_paraview && cd build_paraview cmake -DVTK_ENABLE_OSPRAY=OFF ../paraview-ttk - cd .. - cmake --build build_paraview --target package -- -j$(nproc) + make -j$(nproc) package - name: Install ParaView .deb - run: sudo dpkg -i ttk-paraview.deb + run: | + cd build_paraview + sudo dpkg -i ttk-paraview.deb - name: Create & configure TTK build directory run: | mkdir build cd build - cmake $GITHUB_WORKSPACE + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DTTK_INSTALL_PLUGIN_DIR=/usr/lib/plugins \ + -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \ + -DTTK_BUILD_VTK_WRAPPERS=TRUE \ + -DTTK_BUILD_STANDALONE_APPS=TRUE \ + -DTTK_ENABLE_KAMIKAZE=FALSE \ + $GITHUB_WORKSPACE - name: Build TTK run: | - cmake --build build --target package -- -j$(nproc) + cd build + make -j$(nproc) package From 1f088254bef2bc9eb8fd04cf697d5ff841645a3d Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Fri, 14 Aug 2020 17:28:12 +0200 Subject: [PATCH 08/32] Enable kamikaze --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c6808188b..ae006eedee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,7 +89,7 @@ jobs: -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \ -DTTK_BUILD_VTK_WRAPPERS=TRUE \ -DTTK_BUILD_STANDALONE_APPS=TRUE \ - -DTTK_ENABLE_KAMIKAZE=FALSE \ + -DTTK_ENABLE_KAMIKAZE=TRUE \ $GITHUB_WORKSPACE - name: Build TTK From 2d3bc58d1ac49b6d8b259e730004f8b42e26cb86 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Mon, 17 Aug 2020 12:12:02 +0200 Subject: [PATCH 09/32] Install TTK & test examples --- .github/workflows/main.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae006eedee..e53277f07c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -92,7 +92,25 @@ jobs: -DTTK_ENABLE_KAMIKAZE=TRUE \ $GITHUB_WORKSPACE - - name: Build TTK + - name: Build & install TTK run: | cd build make -j$(nproc) package + sudo dpkg -i ttk.deb + + - name: Test TTK examples + run: | + cd examples/pvpython + pvpython example.py ../data/inputData.vtu + cd ../python + python example.py ../data/inputData.vtu + cd ../c++ + mkdir build && cd build + cmake .. + make + ./ttkExample-c++ ../../data/inputData.off + cd ../../vtk-c++ + mkdir build && cd build + cmake .. + make + ./ttkExample-vtk-c++ ../../data/inputData.vtu From 04125f42083d930556b93e034517de11852b6847 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Tue, 25 Aug 2020 18:22:59 +0200 Subject: [PATCH 10/32] Fetch ParaView release from GitHub --- .github/workflows/main.yml | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e53277f07c..76a5fbcd4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,25 +58,10 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Cache ParaView .deb package - id: cache-paraview - uses: actions/cache@v2 - with: - path: build_paraview/ttk-paraview.deb - key: ${{ runner.os }}-pv-deb-v5.8.0 - - - name: Build patched ParaView - if: steps.cache-paraview.outputs.cache-hit != 'true' - run: | - git clone --depth 1 https://github.com/pierre-guillou/paraview-ttk - mkdir build_paraview && cd build_paraview - cmake -DVTK_ENABLE_OSPRAY=OFF ../paraview-ttk - make -j$(nproc) package - - - name: Install ParaView .deb + - name: Fetch & install ParaView .deb run: | - cd build_paraview - sudo dpkg -i ttk-paraview.deb + wget https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + sudo dpkg -i ttk-paraview.deb || sudo apt -f install - name: Create & configure TTK build directory run: | From 73ae30ce4cd120281086d0d45f2a193bc344873a Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Tue, 25 Aug 2020 18:59:08 +0200 Subject: [PATCH 11/32] Set environment variables --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 76a5fbcd4c..fbb7ca74c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,6 +85,9 @@ jobs: - name: Test TTK examples run: | + export PV_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/paraview-5.8/plugins/TopologyToolKit + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH + export PYTHONPATH=$PYTHONPATH:/usr/lib/x86_64-linux-gnu/python3.6/site-packages cd examples/pvpython pvpython example.py ../data/inputData.vtu cd ../python From 4c9bb7f9b979a223f8c70721ea9426cd0135ad2a Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 26 Aug 2020 18:50:00 +0200 Subject: [PATCH 12/32] Upload deb package --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbb7ca74c8..257359a6fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,6 +83,12 @@ jobs: make -j$(nproc) package sudo dpkg -i ttk.deb + - name: Upload TTK .deb package + uses: actions/upload-artifact@v2 + with: + name: ttk.deb + path: build/ttk.deb + - name: Test TTK examples run: | export PV_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/paraview-5.8/plugins/TopologyToolKit From b97a41d5534a7c1e6a7406fe4f07b751095d4e2c Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 26 Aug 2020 21:50:01 +0200 Subject: [PATCH 13/32] Test install in /usr/local? --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 257359a6fb..19489d3d0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,8 +69,6 @@ jobs: cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DTTK_INSTALL_PLUGIN_DIR=/usr/lib/plugins \ -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \ -DTTK_BUILD_VTK_WRAPPERS=TRUE \ -DTTK_BUILD_STANDALONE_APPS=TRUE \ @@ -91,7 +89,8 @@ jobs: - name: Test TTK examples run: | - export PV_PLUGIN_PATH=/usr/lib/x86_64-linux-gnu/paraview-5.8/plugins/TopologyToolKit + dpkg -L ttk + export PV_PLUGIN_PATH=/usr/lib/paraview-5.8/plugins/TopologyToolKit export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH export PYTHONPATH=$PYTHONPATH:/usr/lib/x86_64-linux-gnu/python3.6/site-packages cd examples/pvpython From 21c127b56a181f86e671de03a5a5a7093e9ac0e7 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 27 Aug 2020 12:38:13 +0200 Subject: [PATCH 14/32] Test without PYTHONPATH --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19489d3d0c..d81153ea1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,10 +89,8 @@ jobs: - name: Test TTK examples run: | - dpkg -L ttk export PV_PLUGIN_PATH=/usr/lib/paraview-5.8/plugins/TopologyToolKit export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH - export PYTHONPATH=$PYTHONPATH:/usr/lib/x86_64-linux-gnu/python3.6/site-packages cd examples/pvpython pvpython example.py ../data/inputData.vtu cd ../python From 08bc19c444f89b78b2073cc8d8d8dff877740f40 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 27 Aug 2020 14:33:57 +0200 Subject: [PATCH 15/32] Split CI in two jobs --- .github/workflows/main.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d81153ea1a..f2696c0df6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,11 +75,10 @@ jobs: -DTTK_ENABLE_KAMIKAZE=TRUE \ $GITHUB_WORKSPACE - - name: Build & install TTK + - name: Build TTK run: | cd build make -j$(nproc) package - sudo dpkg -i ttk.deb - name: Upload TTK .deb package uses: actions/upload-artifact@v2 @@ -87,6 +86,26 @@ jobs: name: ttk.deb path: build/ttk.deb + test: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Fetch & install ParaView .deb + run: | + wget https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + sudo dpkg -i ttk-paraview.deb || sudo apt -f install + + - name: Fetch TTK .deb artifact + uses: actions/download-artifact@v2 + with: + name: ttk.deb + + - name: Install TTK .deb + run: | + sudo dpkg -i ttk.deb || sudo apt -f install + - name: Test TTK examples run: | export PV_PLUGIN_PATH=/usr/lib/paraview-5.8/plugins/TopologyToolKit From ca84d430183c6b15d979e90ddd06a5a5af1bf9d1 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 27 Aug 2020 15:09:00 +0200 Subject: [PATCH 16/32] Save ParaView deb URL in environment variable --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2696c0df6..60ad6c6daa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,9 @@ on: push: branches: [ master ] +env: + PV_DEB: https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" @@ -60,7 +63,7 @@ jobs: - name: Fetch & install ParaView .deb run: | - wget https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + wget ${{ env.PV_DEB }} sudo dpkg -i ttk-paraview.deb || sudo apt -f install - name: Create & configure TTK build directory @@ -94,7 +97,7 @@ jobs: - name: Fetch & install ParaView .deb run: | - wget https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + wget ${{ env.PV_DEB }} sudo dpkg -i ttk-paraview.deb || sudo apt -f install - name: Fetch TTK .deb artifact From ca51fedf704ae912774befab8b037c21cbba7769 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 27 Aug 2020 17:26:24 +0200 Subject: [PATCH 17/32] Set PV_PLUGIN_PATH at build time --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60ad6c6daa..94a2e7fab6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,7 @@ on: env: PV_DEB: https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb + PV_PLUGIN_PATH: /usr/lib/paraview-5.8/plugins/TopologyToolKit # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -111,7 +112,6 @@ jobs: - name: Test TTK examples run: | - export PV_PLUGIN_PATH=/usr/lib/paraview-5.8/plugins/TopologyToolKit export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH cd examples/pvpython pvpython example.py ../data/inputData.vtu From b71648d25d87ab69e80b8dc149a41e940f010086 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 27 Aug 2020 17:43:45 +0200 Subject: [PATCH 18/32] Set run-time env variables inside /etc/profile.d --- .github/workflows/main.yml | 3 ++- CMakeLists.txt | 8 ++++++++ ttk-env.sh.in | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ttk-env.sh.in diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 94a2e7fab6..aac60831a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,6 +73,7 @@ jobs: cd build cmake \ -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \ -DTTK_BUILD_VTK_WRAPPERS=TRUE \ -DTTK_BUILD_STANDALONE_APPS=TRUE \ @@ -112,7 +113,7 @@ jobs: - name: Test TTK examples run: | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH + source /etc/profile cd examples/pvpython pvpython example.py ../data/inputData.vtu cd ../python diff --git a/CMakeLists.txt b/CMakeLists.txt index ee959112a4..ee6ebbd5bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,6 +169,14 @@ if(TTK_BUILD_STANDALONE_APPS) add_subdirectory(standalone) endif() +# Environment variables +# --------------------- + +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + configure_file(ttk-env.sh.in ttk-env.sh) + install(FILES "${PROJECT_BINARY_DIR}/ttk-env.sh" DESTINATION /etc/profile.d) +endif() + # Status # ------ diff --git a/ttk-env.sh.in b/ttk-env.sh.in new file mode 100644 index 0000000000..c499a27b8e --- /dev/null +++ b/ttk-env.sh.in @@ -0,0 +1,6 @@ +# help ParaView find TTK plugin and autoload it +export PV_PLUGIN_PATH=${TTK_INSTALL_PLUGIN_DIR} +# help the dynamic linker find TTK's shared libraries +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH +# help the Python interpreter find the TTK and the VTK modules +export PYTHONPATH=$PYTHONPATH:${CMAKE_INSTALL_PREFIX}/${TTK_PYTHON_MODULE_DIR} From 6c4d82408da5cd1428bb612780f30e667507e69e Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Sat, 29 Aug 2020 13:58:14 +0200 Subject: [PATCH 19/32] Fix paraview-ttk tag name --- .github/workflows/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aac60831a4..2d44fcb7df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,6 @@ on: branches: [ master ] env: - PV_DEB: https://github.com/pierre-guillou/paraview-ttk/releases/download/v5.8.0-test/ttk-paraview.deb PV_PLUGIN_PATH: /usr/lib/paraview-5.8/plugins/TopologyToolKit # A workflow run is made up of one or more jobs that can run sequentially or in parallel @@ -62,9 +61,14 @@ jobs: ../zfp sudo make -j$(nproc) install - - name: Fetch & install ParaView .deb + - uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "pierre-guillou/paraview-ttk" + version: "latest" + file: "ttk-paraview.deb" + + - name: Install ParaView .deb run: | - wget ${{ env.PV_DEB }} sudo dpkg -i ttk-paraview.deb || sudo apt -f install - name: Create & configure TTK build directory @@ -97,9 +101,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Fetch & install ParaView .deb + - uses: dsaltares/fetch-gh-release-asset@master + with: + repo: "pierre-guillou/paraview-ttk" + version: "latest" + file: "ttk-paraview.deb" + + - name: Install ParaView .deb run: | - wget ${{ env.PV_DEB }} sudo dpkg -i ttk-paraview.deb || sudo apt -f install - name: Fetch TTK .deb artifact From 7aef9802381cebc1bb0356921acce255aeeb1baf Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Mon, 31 Aug 2020 17:42:30 +0200 Subject: [PATCH 20/32] Try to modify dependencies list --- .github/workflows/main.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d44fcb7df..832f26fa48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,6 +89,20 @@ jobs: cd build make -j$(nproc) package + - name: Update package informations + run: | + cd build + # unpack deb package to access control file + mkdir tmp + dpkg-deb -x ttk.deb tmp + dpkg-deb --control ttk.deb tmp/DEBIAN + # modify control file, remove libgcc-s1 dependency + sed 's/libgcc-s1[^,]*, //g' -i tmp/DEBIAN/control + # build updated deb package + dpkg -b tmp ttk.deb.new + # replace old package with new + mv ttk.deb.new ttk.deb + - name: Upload TTK .deb package uses: actions/upload-artifact@v2 with: @@ -118,15 +132,16 @@ jobs: - name: Install TTK .deb run: | + dpkg --info ttk.deb sudo dpkg -i ttk.deb || sudo apt -f install - name: Test TTK examples run: | source /etc/profile cd examples/pvpython - pvpython example.py ../data/inputData.vtu + PYTHONPATH= pvpython example.py ../data/inputData.vtu cd ../python - python example.py ../data/inputData.vtu + python3 example.py ../data/inputData.vtu cd ../c++ mkdir build && cd build cmake .. From f2809ea784b249ff41d29ed1fe6587a6cce92585 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Tue, 1 Sep 2020 23:35:10 +0200 Subject: [PATCH 21/32] [TopologicalCompression] Hide Zlib dependency in cpp file --- .../TopologicalCompression.cpp | 27 ++++++++----- .../TopologicalCompression.h | 38 ++++++++----------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/core/base/topologicalCompression/TopologicalCompression.cpp b/core/base/topologicalCompression/TopologicalCompression.cpp index f386dc0929..7f92c58c45 100644 --- a/core/base/topologicalCompression/TopologicalCompression.cpp +++ b/core/base/topologicalCompression/TopologicalCompression.cpp @@ -104,22 +104,31 @@ int ttk::TopologicalCompression::CompressWithZFP(FILE *file, return (int)zfpsize; } -#endif +#endif // TTK_ENABLE_ZFP #ifdef TTK_ENABLE_ZLIB -void ttk::TopologicalCompression::CompressWithZlib(bool decompress, - Bytef *dest, - uLongf *destLen, - const Bytef *source, - uLong sourceLen) { +#include + +unsigned long + ttk::TopologicalCompression::GetZlibDestLen(const unsigned long sourceLen) { + return compressBound(sourceLen); +} + +void ttk::TopologicalCompression::CompressWithZlib( + bool decompress, + unsigned char *dest, + unsigned long &destLen, + const unsigned char *const source, + const unsigned long sourceLen) { + if(decompress) - uncompress(dest, destLen, source, sourceLen); + uncompress(dest, &destLen, source, sourceLen); else - compress(dest, destLen, source, sourceLen); + compress(dest, &destLen, source, sourceLen); } -#endif +#endif // TTK_ENABLE_ZLIB unsigned int ttk::TopologicalCompression::log2(int val) { if(val == 0) diff --git a/core/base/topologicalCompression/TopologicalCompression.h b/core/base/topologicalCompression/TopologicalCompression.h index b0938c8dd8..dc61b3f9b2 100644 --- a/core/base/topologicalCompression/TopologicalCompression.h +++ b/core/base/topologicalCompression/TopologicalCompression.h @@ -29,10 +29,6 @@ #include #include -#ifdef TTK_ENABLE_ZLIB -#include -#endif - namespace ttk { enum class CompressionType { PersistenceDiagram = 0, Other = 1 }; @@ -307,11 +303,12 @@ namespace ttk { #endif #ifdef TTK_ENABLE_ZLIB + unsigned long GetZlibDestLen(const unsigned long sourceLen); void CompressWithZlib(bool decompress, - Bytef *dest, - uLongf *destLen, - const Bytef *source, - uLong sourceLen); + unsigned char *dest, + unsigned long &destLen, + const unsigned char *const source, + const unsigned long sourceLen); #endif private: @@ -547,18 +544,17 @@ int ttk::TopologicalCompression::WriteToFile(FILE *fp, #ifdef TTK_ENABLE_ZLIB // [fm->ff] Compress fm. - uLong sourceLen = (uLong)rawFileLength; - Bytef *source = reinterpret_cast(buf); - uLongf destLen = compressBound(sourceLen); - std::vector ddest(destLen); - Bytef *dest = ddest.data(); - CompressWithZlib(false, dest, &destLen, source, sourceLen); + auto sourceLen = static_cast(rawFileLength); + const auto source = reinterpret_cast(buf); + auto destLen = GetZlibDestLen(sourceLen); + std::vector ddest(destLen); + CompressWithZlib(false, ddest.data(), destLen, source, sourceLen); this->printMsg("Data successfully compressed."); // [fm->fp] Copy fm to fp. Write(fp, destLen); // Compressed size... Write(fp, sourceLen); - WriteByteArray(fp, dest, destLen); + WriteByteArray(fp, ddest.data(), destLen); this->printMsg("Data successfully written to filesystem."); #else @@ -665,20 +661,18 @@ int ttk::TopologicalCompression::ReadFromFile( #ifdef TTK_ENABLE_ZLIB if(useZlib) { // [fp->ff] Read compressed data. - uLongf sl = Read(fp); // Compressed size... - uLongf dl = Read(fp); // Uncompressed size... + auto sl = Read(fp); // Compressed size... + auto dl = Read(fp); // Uncompressed size... - unsigned long sourceLen = (uLongf)sl; destLen = dl; - std::vector ssource(sl); - Bytef *source = ssource.data(); - ReadByteArray(fp, source, sl); + std::vector ssource(sl); + ReadByteArray(fp, ssource.data(), sl); this->printMsg("Successfully read compressed data."); // [ff->fm] Decompress data. ddest.resize(destLen); dest = ddest.data(); - CompressWithZlib(true, dest, &destLen, source, sourceLen); + CompressWithZlib(true, dest, destLen, ssource.data(), sl); this->printMsg("Successfully uncompressed data."); } else { From 5d4ac83ecfbd42ad83741d91cfcda2f3c1ce10c1 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Tue, 1 Sep 2020 23:53:25 +0200 Subject: [PATCH 22/32] [TTKBaseConfig] Remove unnecessary dependencies --- core/base/TTKBaseConfig.cmake.in | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/core/base/TTKBaseConfig.cmake.in b/core/base/TTKBaseConfig.cmake.in index 3ec3c0c7a1..42ec1a6280 100644 --- a/core/base/TTKBaseConfig.cmake.in +++ b/core/base/TTKBaseConfig.cmake.in @@ -5,10 +5,6 @@ find_dependency(Boost REQUIRED COMPONENTS system) # Was TTK built with optional dependencies? -if (@TTK_ENABLE_EIGEN@) - find_dependency(Eigen3 REQUIRED NO_MODULE) -endif() - if (@TTK_ENABLE_MPI@) find_package(MPI REQUIRED) endif() @@ -17,17 +13,5 @@ if (@TTK_ENABLE_OPENMP@) find_dependency(OpenMP REQUIRED) endif() -if (@TTK_ENABLE_ZFP@) - set(ZFP_DIR "@ZFP_DIR@" CACHE PATH "Use TTK ZFP dir" FORCE) - find_dependency(ZFP REQUIRED @ZFP_DIR@) -endif() - -if (@TTK_ENABLE_ZLIB@) - find_dependency(ZLIB REQUIRED) -endif() - - - # Include the actual targets for TTK Base include("${CMAKE_CURRENT_LIST_DIR}/TTKBaseTargets.cmake") - From 028bd36c661180db2d87ce5fba68e3775c85a52e Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Wed, 2 Sep 2020 20:38:11 +0200 Subject: [PATCH 23/32] Use apt to install local packages --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 832f26fa48..988c14ec27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: - name: Install ParaView .deb run: | - sudo dpkg -i ttk-paraview.deb || sudo apt -f install + sudo apt install ./ttk-paraview.deb - name: Create & configure TTK build directory run: | @@ -123,7 +123,7 @@ jobs: - name: Install ParaView .deb run: | - sudo dpkg -i ttk-paraview.deb || sudo apt -f install + sudo apt install ./ttk-paraview.deb - name: Fetch TTK .deb artifact uses: actions/download-artifact@v2 @@ -133,7 +133,7 @@ jobs: - name: Install TTK .deb run: | dpkg --info ttk.deb - sudo dpkg -i ttk.deb || sudo apt -f install + sudo apt install ./ttk.deb - name: Test TTK examples run: | From 581461959435e22ee8061fd5d36e0dda8eda17c3 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 3 Sep 2020 14:43:09 +0200 Subject: [PATCH 24/32] Generate packages named according to base OS version --- .github/workflows/main.yml | 51 ++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 988c14ec27..e88067bcc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,10 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -65,11 +68,11 @@ jobs: with: repo: "pierre-guillou/paraview-ttk" version: "latest" - file: "ttk-paraview.deb" + file: "ttk-paraview-${{ matrix.os }}.deb" - name: Install ParaView .deb run: | - sudo apt install ./ttk-paraview.deb + sudo apt install ./ttk-paraview-${{ matrix.os }}.deb - name: Create & configure TTK build directory run: | @@ -99,19 +102,20 @@ jobs: # modify control file, remove libgcc-s1 dependency sed 's/libgcc-s1[^,]*, //g' -i tmp/DEBIAN/control # build updated deb package - dpkg -b tmp ttk.deb.new - # replace old package with new - mv ttk.deb.new ttk.deb + dpkg -b tmp ttk-${{ matrix.os }}.deb - name: Upload TTK .deb package uses: actions/upload-artifact@v2 with: - name: ttk.deb - path: build/ttk.deb + name: ttk-${{ matrix.os }}.deb + path: build/ttk-${{ matrix.os }}.deb test: needs: build - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04] steps: - uses: actions/checkout@v2 @@ -119,21 +123,20 @@ jobs: with: repo: "pierre-guillou/paraview-ttk" version: "latest" - file: "ttk-paraview.deb" + file: "ttk-paraview-${{ matrix.os }}.deb" - name: Install ParaView .deb run: | - sudo apt install ./ttk-paraview.deb + sudo apt install ./ttk-paraview-${{ matrix.os }}.deb - name: Fetch TTK .deb artifact uses: actions/download-artifact@v2 with: - name: ttk.deb + name: ttk-${{ matrix.os }}.deb - name: Install TTK .deb run: | - dpkg --info ttk.deb - sudo apt install ./ttk.deb + sudo apt install ./ttk-${{ matrix.os }}.deb - name: Test TTK examples run: | @@ -142,13 +145,13 @@ jobs: PYTHONPATH= pvpython example.py ../data/inputData.vtu cd ../python python3 example.py ../data/inputData.vtu - cd ../c++ - mkdir build && cd build - cmake .. - make - ./ttkExample-c++ ../../data/inputData.off - cd ../../vtk-c++ - mkdir build && cd build - cmake .. - make - ./ttkExample-vtk-c++ ../../data/inputData.vtu + # cd ../c++ + # mkdir build && cd build + # cmake .. + # make + # ./ttkExample-c++ ../../data/inputData.off + # cd ../../vtk-c++ + # mkdir build && cd build + # cmake .. + # make + # ./ttkExample-vtk-c++ ../../data/inputData.vtu From a5784676ace0a89228a6fd4246178c1c1be89114 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Fri, 4 Sep 2020 15:13:43 +0200 Subject: [PATCH 25/32] Try to build C++ examples --- .github/workflows/main.yml | 97 ++++++++++++++++++++++++++------------ CMakeLists.txt | 3 +- ttk-env.sh.in | 2 + 3 files changed, 72 insertions(+), 30 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e88067bcc2..2c8607351c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,10 @@ name: CI # events but only for the master branch on: push: - branches: [ master ] + branch-ignore: + - 'master' + tags: + - 'latest' env: PV_PLUGIN_PATH: /usr/lib/paraview-5.8/plugins/TopologyToolKit @@ -29,14 +32,6 @@ jobs: - name: Install Ubuntu dependencies run: | sudo apt update - # ParaView dependencies - sudo apt install -y \ - qt5-default \ - qttools5-dev \ - qtxmlpatterns5-dev-tools \ - libqt5x11extras5-dev \ - libqt5svg5-dev \ - dpkg-dev # TTK dependencies sudo apt install -y \ libboost-dev \ @@ -45,7 +40,8 @@ jobs: libsqlite3-dev \ graphviz \ python3-sklearn \ - zlib1g-dev + zlib1g-dev \ + dpkg-dev - name: Install Spectra dependency run: | @@ -85,6 +81,8 @@ jobs: -DTTK_BUILD_VTK_WRAPPERS=TRUE \ -DTTK_BUILD_STANDALONE_APPS=TRUE \ -DTTK_ENABLE_KAMIKAZE=TRUE \ + -DTTK_ENABLE_DOUBLE_TEMPLATING=TRUE \ + -DTTK_ENABLE_CPU_OPTIMIZATION=FALSE \ $GITHUB_WORKSPACE - name: Build TTK @@ -97,7 +95,7 @@ jobs: cd build # unpack deb package to access control file mkdir tmp - dpkg-deb -x ttk.deb tmp + dpkg-deb --extract ttk.deb tmp dpkg-deb --control ttk.deb tmp/DEBIAN # modify control file, remove libgcc-s1 dependency sed 's/libgcc-s1[^,]*, //g' -i tmp/DEBIAN/control @@ -125,33 +123,74 @@ jobs: version: "latest" file: "ttk-paraview-${{ matrix.os }}.deb" - - name: Install ParaView .deb - run: | - sudo apt install ./ttk-paraview-${{ matrix.os }}.deb - - name: Fetch TTK .deb artifact uses: actions/download-artifact@v2 with: name: ttk-${{ matrix.os }}.deb - - name: Install TTK .deb + - name: Install generated .deb packages run: | + sudo apt update + sudo apt install ./ttk-paraview-${{ matrix.os }}.deb sudo apt install ./ttk-${{ matrix.os }}.deb - name: Test TTK examples run: | source /etc/profile - cd examples/pvpython - PYTHONPATH= pvpython example.py ../data/inputData.vtu - cd ../python + # base layer + cd $GITHUB_WORKSPACE/examples/c++ + mkdir build && cd build + cmake .. + make + ./ttkExample-c++ -i ../../data/inputData.off + # VTK layer + cd $GITHUB_WORKSPACE/examples/vtk-c++ + mkdir build && cd build + cmake .. + make + ./ttkExample-vtk-c++ -i ../../data/inputData.vtu + # pure Python + cd $GITHUB_WORKSPACE/examples/python python3 example.py ../data/inputData.vtu - # cd ../c++ - # mkdir build && cd build - # cmake .. - # make - # ./ttkExample-c++ ../../data/inputData.off - # cd ../../vtk-c++ - # mkdir build && cd build - # cmake .. - # make - # ./ttkExample-vtk-c++ ../../data/inputData.vtu + # pvpython + cd $GITHUB_WORKSPACE/examples/pvpython + pvpython example.py ../data/inputData.vtu + + create-release: + runs-on: ubuntu-latest + needs: test + steps: + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: true + + - name: Fetch all uploaded artifacts + uses: actions/download-artifact@v2 + + - name: Upload Ubuntu Bionic .deb as Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ttk-ubuntu-18.04.deb/ttk-ubuntu-18.04.deb + asset_name: ttk-ubuntu-18.04.deb + asset_content_type: application/vnd.debian.binary-package + + - name: Upload Ubuntu Focal .deb as Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ttk-ubuntu-20.04.deb/ttk-ubuntu-20.04.deb + asset_name: ttk-ubuntu-20.04.deb + asset_content_type: application/vnd.debian.binary-package diff --git a/CMakeLists.txt b/CMakeLists.txt index ee6ebbd5bb..65f0024533 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,8 @@ set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_CONTACT "Julien Tierny ") set(CPACK_PACKAGE_VENDOR "LIP6 - Sorbonne Université") set(CPACK_PACKAGE_HOMEPAGE_URL "https://topology-tool-kit.github.io/") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "ttk-paraview (= 5.8.0), python3-sklearn") +set(CPACK_DEBIAN_PACKAGE_DEPENDS + "ttk-paraview (= 5.8.0), python3-sklearn, qt5-default, qttools5-dev, libqt5x11extras5-dev, libqt5svg5-dev, libboost-system-dev, python3-dev, libxt-dev" ) # autogenerate dependency information set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) include(CPack) diff --git a/ttk-env.sh.in b/ttk-env.sh.in index c499a27b8e..9c9db9b847 100644 --- a/ttk-env.sh.in +++ b/ttk-env.sh.in @@ -4,3 +4,5 @@ export PV_PLUGIN_PATH=${TTK_INSTALL_PLUGIN_DIR} export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH # help the Python interpreter find the TTK and the VTK modules export PYTHONPATH=$PYTHONPATH:${CMAKE_INSTALL_PREFIX}/${TTK_PYTHON_MODULE_DIR} +# help CMake find the configuration files +export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:${CMAKE_INSTALL_PREFIX}/lib/cmake/ttk From 17c84aa72bc4659e943ab0d6655e9d04cbe98898 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Fri, 4 Sep 2020 17:36:04 +0200 Subject: [PATCH 26/32] [CMake] Hide optional dependencies --- CMake/BaseCode.cmake | 4 ---- core/base/eigenField/CMakeLists.txt | 8 ++------ core/base/harmonicField/CMakeLists.txt | 5 ++--- core/base/laplacian/CMakeLists.txt | 5 ++--- core/base/topologicalCompression/CMakeLists.txt | 11 ++++++----- 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/CMake/BaseCode.cmake b/CMake/BaseCode.cmake index da23060047..e50c8662f7 100644 --- a/CMake/BaseCode.cmake +++ b/CMake/BaseCode.cmake @@ -168,10 +168,6 @@ function(ttk_set_compile_options library) target_compile_definitions(${library} PUBLIC TTK_ENABLE_SCIKIT_LEARN) endif() - if (TTK_ENABLE_ZLIB) - target_compile_definitions(${library} PUBLIC TTK_ENABLE_ZLIB) - endif() - # TODO per module if (TTK_ENABLE_GRAPHVIZ AND GRAPHVIZ_FOUND) target_compile_definitions(${library} PUBLIC TTK_ENABLE_GRAPHVIZ) diff --git a/core/base/eigenField/CMakeLists.txt b/core/base/eigenField/CMakeLists.txt index 6df3c17382..d142d9bd51 100644 --- a/core/base/eigenField/CMakeLists.txt +++ b/core/base/eigenField/CMakeLists.txt @@ -7,15 +7,11 @@ ttk_add_base_library(eigenField geometry laplacian triangulation - OPTIONAL_DEPENDS - Eigen3::Eigen ) -if (EIGEN3_FOUND) - target_compile_definitions(eigenField PUBLIC TTK_ENABLE_EIGEN) -endif() - if(TTK_ENABLE_SPECTRA) + target_compile_definitions(eigenField PRIVATE TTK_ENABLE_EIGEN) + target_include_directories(eigenField SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) target_compile_definitions(eigenField PRIVATE TTK_ENABLE_SPECTRA) target_include_directories(eigenField SYSTEM PRIVATE ${SPECTRA_INCLUDE_DIR}) endif() diff --git a/core/base/harmonicField/CMakeLists.txt b/core/base/harmonicField/CMakeLists.txt index d857197687..acef3be85f 100644 --- a/core/base/harmonicField/CMakeLists.txt +++ b/core/base/harmonicField/CMakeLists.txt @@ -7,10 +7,9 @@ ttk_add_base_library(harmonicField geometry laplacian triangulation - OPTIONAL_DEPENDS - Eigen3::Eigen ) if (EIGEN3_FOUND) - target_compile_definitions(harmonicField PUBLIC TTK_ENABLE_EIGEN) + target_compile_definitions(harmonicField PRIVATE TTK_ENABLE_EIGEN) + target_include_directories(harmonicField SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) endif() diff --git a/core/base/laplacian/CMakeLists.txt b/core/base/laplacian/CMakeLists.txt index b68e9b019f..a1c2fcc520 100644 --- a/core/base/laplacian/CMakeLists.txt +++ b/core/base/laplacian/CMakeLists.txt @@ -6,10 +6,9 @@ ttk_add_base_library(laplacian DEPENDS geometry triangulation - OPTIONAL_DEPENDS - Eigen3::Eigen ) if (EIGEN3_FOUND) - target_compile_definitions(laplacian PUBLIC TTK_ENABLE_EIGEN) + target_compile_definitions(laplacian PRIVATE TTK_ENABLE_EIGEN) + target_include_directories(laplacian SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) endif() diff --git a/core/base/topologicalCompression/CMakeLists.txt b/core/base/topologicalCompression/CMakeLists.txt index 7ad65672de..196dcc6b55 100755 --- a/core/base/topologicalCompression/CMakeLists.txt +++ b/core/base/topologicalCompression/CMakeLists.txt @@ -9,15 +9,16 @@ ttk_add_base_library(topologicalCompression triangulation topologicalSimplification ftmTreePP - OPTIONAL_DEPENDS - zfp::zfp - ZLIB::ZLIB ) -if (TTK_ENABLE_ZLIB) - target_include_directories(topologicalCompression PUBLIC ${ZLIB_INCLUDE_DIR}) +if(TTK_ENABLE_ZLIB) + target_compile_definitions(topologicalCompression PUBLIC TTK_ENABLE_ZLIB) + target_include_directories(topologicalCompression SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR}) + target_link_libraries(topologicalCompression PRIVATE ${ZLIB_LIBRARIES}) endif() if(TTK_ENABLE_ZFP) target_compile_definitions(topologicalCompression PUBLIC TTK_ENABLE_ZFP) + target_include_directories(topologicalCompression SYSTEM PRIVATE ${ZFP_INCLUDE_DIR}) + target_link_libraries(topologicalCompression PRIVATE ${ZFP_LIBRARIES}) endif() From 8d1d0e701baec39b4adc0d0e99ed5ce891628775 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Mon, 7 Sep 2020 13:32:10 +0200 Subject: [PATCH 27/32] Use ttk-paraview dependencies --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 65f0024533..b3b69fb378 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ set(CPACK_PACKAGE_CONTACT "Julien Tierny " set(CPACK_PACKAGE_VENDOR "LIP6 - Sorbonne Université") set(CPACK_PACKAGE_HOMEPAGE_URL "https://topology-tool-kit.github.io/") set(CPACK_DEBIAN_PACKAGE_DEPENDS - "ttk-paraview (= 5.8.0), python3-sklearn, qt5-default, qttools5-dev, libqt5x11extras5-dev, libqt5svg5-dev, libboost-system-dev, python3-dev, libxt-dev" ) + "ttk-paraview (= 5.8.0), python3-sklearn, libboost-system-dev, python3-dev, libgraphviz-dev, libsqlite3-dev") # autogenerate dependency information set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) include(CPack) From 9a5e9b4ebbda8b0d64da0773bfd1903499a8aad7 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Tue, 8 Sep 2020 20:34:19 +0200 Subject: [PATCH 28/32] Generate shared base libraries to embed zfp --- .github/workflows/main.yml | 1 + CMake/BaseCode.cmake | 11 ++++++----- CMake/Print.cmake | 1 + config.cmake | 3 +++ ttk-env.sh.in | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c8607351c..3d769ffbc3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,6 +83,7 @@ jobs: -DTTK_ENABLE_KAMIKAZE=TRUE \ -DTTK_ENABLE_DOUBLE_TEMPLATING=TRUE \ -DTTK_ENABLE_CPU_OPTIMIZATION=FALSE \ + -DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE \ $GITHUB_WORKSPACE - name: Build TTK diff --git a/CMake/BaseCode.cmake b/CMake/BaseCode.cmake index e50c8662f7..e33c8e9ac4 100644 --- a/CMake/BaseCode.cmake +++ b/CMake/BaseCode.cmake @@ -10,11 +10,12 @@ function(ttk_add_base_library library) cmake_parse_arguments(ARG "" "" "SOURCES;HEADERS;DEPENDS;OPTIONAL_DEPENDS" ${ARGN}) - add_library(${library} - STATIC - ${ARG_SOURCES} - ${ARG_HEADERS} - ) + if(TTK_ENABLE_SHARED_BASE_LIBRARIES) + add_library(${library} SHARED ${ARG_SOURCES} ${ARG_HEADERS}) + else() + add_library(${library} STATIC ${ARG_SOURCES} ${ARG_HEADERS}) + endif() + set_target_properties(${library} PROPERTIES POSITION_INDEPENDENT_CODE TRUE diff --git a/CMake/Print.cmake b/CMake/Print.cmake index ff2457f0f0..b057926208 100644 --- a/CMake/Print.cmake +++ b/CMake/Print.cmake @@ -4,6 +4,7 @@ function(ttk_print_summary) message(STATUS "TTK_ENABLE_64BIT_IDS: ${TTK_ENABLE_64BIT_IDS}") message(STATUS "TTK_ENABLE_CPU_OPTIMIZATION: ${TTK_ENABLE_CPU_OPTIMIZATION}") message(STATUS "TTK_ENABLE_DOUBLE_TEMPLATING: ${TTK_ENABLE_DOUBLE_TEMPLATING}") + message(STATUS "TTK_ENABLE_SHARED_BASE_LIBRARIES: ${TTK_ENABLE_SHARED_BASE_LIBRARIES}") message(STATUS "TTK_ENABLE_EIGEN: ${TTK_ENABLE_EIGEN}") message(STATUS "TTK_ENABLE_GRAPHVIZ: ${TTK_ENABLE_GRAPHVIZ}") message(STATUS "TTK_ENABLE_KAMIKAZE: ${TTK_ENABLE_KAMIKAZE}") diff --git a/config.cmake b/config.cmake index 3386af5053..a83412270d 100644 --- a/config.cmake +++ b/config.cmake @@ -75,6 +75,9 @@ mark_as_advanced(TTK_ENABLE_CPU_OPTIMIZATION) option(TTK_ENABLE_DOUBLE_TEMPLATING "Use double templating for bivariate data" OFF) mark_as_advanced(TTK_ENABLE_DOUBLE_TEMPLATING) +option(TTK_ENABLE_SHARED_BASE_LIBRARIES "Generate shared base libraries instead of static ones" OFF) +mark_as_advanced(TTK_ENABLE_SHARED_BASE_LIBRARIES) + option(TTK_BUILD_DOCUMENTATION "Build doxygen developer documentation" OFF) if(TTK_BUILD_DOCUMENTATION) find_package(Doxygen) diff --git a/ttk-env.sh.in b/ttk-env.sh.in index 9c9db9b847..38035beb14 100644 --- a/ttk-env.sh.in +++ b/ttk-env.sh.in @@ -1,7 +1,7 @@ # help ParaView find TTK plugin and autoload it export PV_PLUGIN_PATH=${TTK_INSTALL_PLUGIN_DIR} # help the dynamic linker find TTK's shared libraries -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PV_PLUGIN_PATH +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CMAKE_INSTALL_FULL_LIBDIR}/ttk:$PV_PLUGIN_PATH # help the Python interpreter find the TTK and the VTK modules export PYTHONPATH=$PYTHONPATH:${CMAKE_INSTALL_PREFIX}/${TTK_PYTHON_MODULE_DIR} # help CMake find the configuration files From 54bf9921c1806c3682fd3ab2d623a30e856ce5fe Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 17 Sep 2020 11:03:45 +0200 Subject: [PATCH 29/32] Fetch ParaView assets from topology-tool-kit repository --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d769ffbc3..e7dbba1fb2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,8 +62,8 @@ jobs: - uses: dsaltares/fetch-gh-release-asset@master with: - repo: "pierre-guillou/paraview-ttk" - version: "latest" + repo: "topology-tool-kit/ttk-paraview" + version: "tags/v5.8.0" file: "ttk-paraview-${{ matrix.os }}.deb" - name: Install ParaView .deb @@ -120,8 +120,8 @@ jobs: - uses: dsaltares/fetch-gh-release-asset@master with: - repo: "pierre-guillou/paraview-ttk" - version: "latest" + repo: "topology-tool-kit/ttk-paraview" + version: "tags/v5.8.0" file: "ttk-paraview-${{ matrix.os }}.deb" - name: Fetch TTK .deb artifact From d3a46b422ea1fba9b4295e5066a0a7a00f90e5d5 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 17 Sep 2020 11:13:34 +0200 Subject: [PATCH 30/32] Execute CI on specific tags --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7dbba1fb2..d74acbab9a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,9 +7,10 @@ name: CI on: push: branch-ignore: - - 'master' + - '*' tags: - - 'latest' + - 'v*' + - 'dev*' env: PV_PLUGIN_PATH: /usr/lib/paraview-5.8/plugins/TopologyToolKit From f59969d3808f1e655964c8a9f9d80d1e0912e281 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 17 Sep 2020 11:33:02 +0200 Subject: [PATCH 31/32] Fix Boost system dependency --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d74acbab9a..4ef59e906b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: sudo apt update # TTK dependencies sudo apt install -y \ - libboost-dev \ + libboost-system-dev \ libeigen3-dev \ libgraphviz-dev \ libsqlite3-dev \ From 2c016ee46b8fef37a61740c40c96eadd85687bf1 Mon Sep 17 00:00:00 2001 From: Pierre Guillou Date: Thu, 17 Sep 2020 17:10:16 +0200 Subject: [PATCH 32/32] [CMake] Avoid hard coded installation path --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3b69fb378..6aaf03e316 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,7 +175,10 @@ endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") configure_file(ttk-env.sh.in ttk-env.sh) - install(FILES "${PROJECT_BINARY_DIR}/ttk-env.sh" DESTINATION /etc/profile.d) + install( + FILES "${PROJECT_BINARY_DIR}/ttk-env.sh" + DESTINATION "${CMAKE_INSTALL_FULL_SYSCONFDIR}/profile.d" + ) endif() # Status