diff --git a/.github/workflows/ccache.yml b/.github/workflows/ccache.yml index 0a044a6aa5..c3d5c84f37 100644 --- a/.github/workflows/ccache.yml +++ b/.github/workflows/ccache.yml @@ -171,14 +171,123 @@ jobs: name: ttk-ccache-macOS path: /Users/runner/work/ttk/ttk-ccache.tar.gz + # ------- # + # Windows # + # ------- # + ccache-windows: + runs-on: windows-latest + env: + CONDA_ROOT: C:\Miniconda + steps: + - uses: actions/checkout@v2 + name: Checkout TTK source code + + - uses: s-weigand/setup-conda@v1 + + - name: Install dependencies with conda + shell: bash + run: | + conda install -c conda-forge boost glew eigen spectralib zfp \ + scikit-learn packaging openmp graphviz ninja sccache + # add sccache to PATH + echo "$CONDA_ROOT/bin" >> $GITHUB_PATH + + - name: Remove hosted Python + shell: bash + run: | + rm -rf C:/hostedtoolcache/windows/Python + + - name: Fetch TTK-ParaView headless Windows installer + run: | + Invoke-WebRequest ` + -OutFile ttk-paraview-headless.exe ` + -Uri https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless.exe + + - name: Install ParaView + shell: cmd + run: | + ttk-paraview-headless.exe /S + + - name: Create & configure TTK build directory + shell: cmd + run: | + set CMAKE_PREFIX_PATH=%CONDA_ROOT%\Library\lib\cmake;%CONDA_ROOT%\Library\share\eigen3\cmake;%CONDA_ROOT%\Library\cmake;%ProgramFiles%\TTK-ParaView\lib\cmake + set CC=clang-cl.exe + set CXX=clang-cl.exe + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + sccache --stop-server + sccache --start-server + mkdir build + cd build + cmake ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_POLICY_DEFAULT_CMP0092=NEW ^ + -DBUILD_SHARED_LIBS:BOOL=TRUE ^ + -DCMAKE_C_COMPILER_LAUNCHER=sccache ^ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^ + -DPython3_ROOT_DIR="%CONDA_ROOT%" ^ + -DGraphviz_INCLUDE_DIR="%CONDA_ROOT%\Library\include\graphviz" ^ + -DGraphviz_CDT_LIBRARY="%CONDA_ROOT%\Library\lib\cdt.lib" ^ + -DGraphviz_GVC_LIBRARY="%CONDA_ROOT%\Library\lib\gvc.lib" ^ + -DGraphviz_CGRAPH_LIBRARY="%CONDA_ROOT%\Library\lib\cgraph.lib" ^ + -DGraphviz_PATHPLAN_LIBRARY="%CONDA_ROOT%\Library\lib\pathplan.lib" ^ + -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE ^ + -DTTK_BUILD_VTK_WRAPPERS=TRUE ^ + -DTTK_BUILD_STANDALONE_APPS=TRUE ^ + -DTTK_ENABLE_KAMIKAZE=TRUE ^ + -DTTK_ENABLE_OPENMP=TRUE ^ + -DTTK_ENABLE_CPU_OPTIMIZATION=FALSE ^ + -DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE ^ + -DTTK_IMPLICIT_PRECONDITIONS_THRESHOLD=64*64*64 ^ + -GNinja ^ + .. + + - name: Fix clang-cl OpenMP flags in build.ninja + shell: bash + run: | + sed -i 's/-Xclang -fopenmp/-openmp/' build/build.ninja + + - name: Build & install TTK + shell: cmd + run: | + cd build + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cmake --build . --config Release --parallel --target install + + - name: Archive cache + shell: bash + run: | + cd /c/Users/runneradmin/AppData/Local/Mozilla/sccache + tar czf ttk-sccache.tar.gz cache + + - name: Upload sccache archive + uses: actions/upload-artifact@v2 + with: + name: ttk-sccache-windows + path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\ttk-sccache.tar.gz + + # --------------------- # # Upload release assets # # --------------------- # create-release: runs-on: ubuntu-latest - needs: [ccache-ubuntu, ccache-macos] + needs: [ccache-ubuntu, ccache-macos, ccache-windows] steps: + - name: Delete previous release + uses: actions/github-script@v6 + continue-on-error: true + with: + script: | + const { owner, repo } = context.repo + const { data: { id } } = await github.rest.repos.getReleaseByTag({ + owner, + repo, + tag: "ccache" + }) + await github.rest.repos.deleteRelease({ owner, repo, release_id: id }) + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -224,3 +333,11 @@ jobs: tag: ${{ github.ref }} file: ttk-ccache-macOS/ttk-ccache.tar.gz asset_name: ttk-ccache-macOS.tar.gz + + - name: Upload sccache Windows archive + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} + file: ttk-sccache-windows/ttk-sccache.tar.gz + asset_name: ttk-sccache-windows.tar.gz diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index c586fa8266..fdccc17161 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -320,7 +320,7 @@ jobs: shell: bash run: | conda install -c conda-forge "qt>=5.12" boost eigen spectralib zfp \ - scikit-learn packaging openmp "graphviz>=2.50" + scikit-learn packaging openmp graphviz - name: Remove hosted Python shell: bash @@ -410,7 +410,7 @@ jobs: shell: bash run: | conda install -c conda-forge "qt>=5.12" boost eigen spectralib zfp \ - scikit-learn packaging openmp "graphviz>=2.50" + scikit-learn packaging openmp graphviz - name: Remove hosted Python shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b062f359b..8ff913c276 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -328,13 +328,36 @@ jobs: shell: bash run: | conda install -c conda-forge boost glew eigen spectralib zfp \ - scikit-learn packaging openmp "graphviz>=2.50" + scikit-learn packaging openmp graphviz ninja sccache + # add sccache to PATH + echo "$CONDA_ROOT/bin" >> $GITHUB_PATH + # add TTK & ParaView install folders to PATH + echo "$PV_DIR/bin" >> $GITHUB_PATH + echo "$TTK_DIR/bin" >> $GITHUB_PATH - name: Remove hosted Python shell: bash run: | rm -rf C:/hostedtoolcache/windows/Python + - uses: dsaltares/fetch-gh-release-asset@master + continue-on-error: true + name: Fetch archived ccache + with: + repo: "topology-tool-kit/ttk" + version: "tags/ccache" + file: "ttk-sccache-windows.tar.gz" + target: "ttk-sccache.tar.gz" + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Decompress ccache archive + continue-on-error: true + shell: bash + run: | + tar xzf ttk-sccache.tar.gz + mkdir -p /c/Users/runneradmin/AppData/Local/Mozilla/sccache + mv cache /c/Users/runneradmin/AppData/Local/Mozilla/sccache + - name: Fetch TTK-ParaView headless Windows installer run: | Invoke-WebRequest ` @@ -350,11 +373,19 @@ jobs: shell: cmd run: | set CMAKE_PREFIX_PATH=%CONDA_ROOT%\Library\lib\cmake;%CONDA_ROOT%\Library\share\eigen3\cmake;%CONDA_ROOT%\Library\cmake;%ProgramFiles%\TTK-ParaView\lib\cmake + set CC=clang-cl.exe + set CXX=clang-cl.exe + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + sccache --stop-server + sccache --start-server mkdir build cd build cmake ^ + -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_POLICY_DEFAULT_CMP0092=NEW ^ -DBUILD_SHARED_LIBS:BOOL=TRUE ^ + -DCMAKE_C_COMPILER_LAUNCHER=sccache ^ + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^ -DPython3_ROOT_DIR="%CONDA_ROOT%" ^ -DGraphviz_INCLUDE_DIR="%CONDA_ROOT%\Library\include\graphviz" ^ -DGraphviz_CDT_LIBRARY="%CONDA_ROOT%\Library\lib\cdt.lib" ^ @@ -369,40 +400,48 @@ jobs: -DTTK_ENABLE_CPU_OPTIMIZATION=FALSE ^ -DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE ^ -DTTK_IMPLICIT_PRECONDITIONS_THRESHOLD=64*64*64 ^ - -G"Visual Studio 17 2022" ^ - -Tclangcl ^ + -GNinja ^ .. - - name: Build & install TTK + - name: Fix clang-cl OpenMP flags in build.ninja shell: bash + run: | + sed -i 's/-Xclang -fopenmp/-openmp/' build/build.ninja + + - name: Build & install TTK + shell: cmd run: | cd build + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cmake --build . --config Release --parallel --target install - # set PATH environment variable - echo "$PV_DIR/bin" >> $GITHUB_PATH - echo "$TTK_DIR/bin" >> $GITHUB_PATH - name: Test C++ example shell: cmd run: | + set CC=clang-cl.exe + set CXX=clang-cl.exe + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CMAKE_PREFIX_PATH=%TTK_DIR%\lib\cmake;%PV_DIR%\lib\cmake cd %GITHUB_WORKSPACE%\examples\c++ mkdir build cd build - cmake -G"Visual Studio 17 2022" -Tclangcl .. + cmake -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake --build . --config Release --parallel - Release\ttkExample-c++.exe -i ..\..\data\inputData.off + ttkExample-c++.exe -i ..\..\data\inputData.off - name: Test VTK-C++ example shell: cmd run: | + set CC=clang-cl.exe + set CXX=clang-cl.exe + call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set CMAKE_PREFIX_PATH=%TTK_DIR%\lib\cmake;%PV_DIR%\lib\cmake cd %GITHUB_WORKSPACE%\examples\vtk-c++ mkdir build cd build - cmake -G"Visual Studio 17 2022" -Tclangcl .. + cmake -DCMAKE_BUILD_TYPE=Release -GNinja .. cmake --build . --config Release --parallel - Release\ttkExample-vtk-c++.exe -i ..\..\data\inputData.vtu + ttkExample-vtk-c++.exe -i ..\..\data\inputData.vtu - name: Test Python example shell: cmd diff --git a/core/base/lDistanceMatrix/LDistanceMatrix.h b/core/base/lDistanceMatrix/LDistanceMatrix.h index 40139dc210..5787aefee0 100644 --- a/core/base/lDistanceMatrix/LDistanceMatrix.h +++ b/core/base/lDistanceMatrix/LDistanceMatrix.h @@ -53,8 +53,7 @@ int ttk::LDistanceMatrix::execute(std::vector> &output, // compute matrix upper triangle #ifdef TTK_ENABLE_OPENMP -#pragma omp parallel for num_threads(this->threadNumber_) schedule(dynamic) \ - firstprivate(worker) +#pragma omp parallel for num_threads(this->threadNumber_) firstprivate(worker) #endif // TTK_ENABLE_OPENMP for(size_t i = 0; i < nInputs; ++i) { for(size_t j = i + 1; j < nInputs; ++j) {