diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fd393f..91a2996 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,14 @@ -name: Workflow +name: Build Project + on: push: - branches: - - '*' + branches: ['*'] pull_request: - branches: - - '*' + branches: ['*'] release: types: [published] -jobs: +jobs: build_linux: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} @@ -17,26 +16,23 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest'] + steps: - - name: "Clone SMESH" uses: actions/checkout@v2 with: submodules: 'recursive' - - name: "Fix dependencies" - run: | - sudo apt-get install libxext-dev - sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib64 - - name: "Configure conda" - shell: pwsh - run: | - conda init --all + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-version: latest + use-mamba: true + channels: conda-forge - name: "Install conda build" shell: pwsh - run: conda install -c conda-forge conda-build + run: mamba install conda-build python-patch - name: "Check conda" shell: pwsh @@ -44,18 +40,21 @@ jobs: conda info -a conda list - - name: Prepare sources + - name: "Install Linux Dependencies" + run: | + sudo apt-get install -y libxext-dev + sudo ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib64 + + - name: "Prepare sources" shell: pwsh run: | - conda activate - conda install -c conda-forge python-patch python prepare.py - name: "Run conda build" shell: pwsh run: | mkdir conda - conda build ci/conda -c conda-forge --output-folder conda + conda build ci/conda --output-folder conda - name: "Upload conda package" uses: actions/upload-artifact@v2 @@ -63,52 +62,47 @@ jobs: name: smesh-${{ matrix.os }} path: conda - build_win: + build_osx: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: ['windows-latest'] + os: ['macos-latest'] + steps: - - name: "Clone SMESH" uses: actions/checkout@v2 with: submodules: 'recursive' - - name: "Add conda to PATH" - shell: bash -l {0} - run: echo "$CONDA/Scripts" >> $GITHUB_PATH - - name: "Configure conda" - shell: bash -l {0} - run: | - conda init --all + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-version: latest + use-mamba: true + channels: conda-forge - name: "Install conda build" - shell: bash -l {0} - run: conda install -c conda-forge conda-build + shell: sh -l {0} + run: mamba install conda-build python-patch - name: "Check conda" - shell: bash -l {0} + shell: sh -l {0} run: | conda info -a conda list - - name: Prepare sources - shell: bash -l {0} + - name: "Prepare sources" + shell: sh -l {0} run: | - conda activate - conda install -c conda-forge python-patch python prepare.py - name: "Run conda build" - shell: bash -l {0} + shell: sh -l {0} run: | mkdir conda - source activate - conda build ci/conda -c conda-forge --output-folder conda + conda build ci/conda --output-folder conda - name: "Upload conda package" uses: actions/upload-artifact@v2 @@ -116,50 +110,51 @@ jobs: name: smesh-${{ matrix.os }} path: conda - build_macos: + build_windows: name: Build (${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: ['macos-latest'] + os: ['windows-latest'] + steps: - - name: "Clone SMESH" uses: actions/checkout@v2 with: submodules: 'recursive' - name: "Configure conda" - shell: pwsh - run: | - conda init --all + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-version: latest + use-mamba: true + channels: conda-forge - name: "Install conda build" - shell: pwsh - run: conda install -c conda-forge conda-build + shell: sh -l {0} + run: mamba install conda-build python-patch - name: "Check conda" - shell: pwsh + shell: sh -l {0} run: | conda info -a conda list - - name: Prepare sources - shell: pwsh + - name: "Prepare sources" + shell: sh -l {0} run: | - conda activate - conda install -c conda-forge python-patch python prepare.py - name: "Run conda build" - shell: pwsh + shell: sh -l {0} run: | mkdir conda - conda build ci/conda -c conda-forge --output-folder conda + conda build ci/conda --output-folder conda - name: "Upload conda package" uses: actions/upload-artifact@v2 with: name: smesh-${{ matrix.os }} path: conda + diff --git a/.gitmodules b/.gitmodules index 877ad5f..309681d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,16 +1,20 @@ [submodule "external/Netgen"] - path = external/Netgen - url = https://github.com/NGSolve/netgen.git + path = external/Netgen + url = https://github.com/NGSolve/netgen.git branch = netgen-5.3 [submodule "external/NETGENPlugin"] - path = external/NETGENPlugin - url = https://git.salome-platform.org/gitpub/plugins/netgenplugin.git + path = external/NETGENPlugin + url = https://git.salome-platform.org/gitpub/plugins/netgenplugin.git + branch = V9_9_0 [submodule "external/SMESH"] - path = external/SMESH - url = https://git.salome-platform.org/gitpub/modules/smesh.git + path = external/SMESH + url = https://git.salome-platform.org/gitpub/modules/smesh.git + branch = V9_9_0 [submodule "external/Kernel"] - path = external/Kernel - url = https://git.salome-platform.org/gitpub/modules/kernel.git + path = external/Kernel + url = https://git.salome-platform.org/gitpub/modules/kernel.git + branch = V9_9_0 [submodule "external/Geom"] - path = external/Geom - url = https://git.salome-platform.org/gitpub/modules/geom.git + path = external/Geom + url = https://git.salome-platform.org/gitpub/modules/geom.git + branch = V9_9_0 diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml index 3df58d9..68514cc 100644 --- a/ci/conda/meta.yaml +++ b/ci/conda/meta.yaml @@ -1,6 +1,6 @@ package: name: smesh4pyocct - version: "9.8.0.2" + version: "9.9.0.0" source: path: ../.. @@ -18,7 +18,7 @@ requirements: - ninja host: - - occt ==7.6 + - occt - boost-cpp - tbb-devel - vtk @@ -26,7 +26,7 @@ requirements: - pthreads-win32 # [win] run: - - occt ==7.6 + - {{ pin_compatible('occt', max_pin='x.x.x') }} - vtk - boost-cpp - zlib @@ -49,7 +49,7 @@ test: - {{ cdt('libxxf86vm') }} # [linux] - cmake - ninja - - catch2 + - catch2 < 3.0 about: home: https://github.com/trelau/SMESH diff --git a/patch/SMESH_swap_bool_vector.patch b/patch/SMESH_swap_bool_vector.patch new file mode 100644 index 0000000..cfbdc5a --- /dev/null +++ b/patch/SMESH_swap_bool_vector.patch @@ -0,0 +1,11 @@ +--- a/src/SMESH/SMESH_MeshEditor.cxx 2023-05-13 20:04:14.611798489 +0800 ++++ b/src/SMESH/SMESH_MeshEditor.cxx 2023-05-15 05:58:50.875607024 +0800 +@@ -4307,7 +4307,7 @@ + std::swap( itNN[0], itNN[1] ); + std::swap( prevNod[0], prevNod[1] ); + std::swap( nextNod[0], nextNod[1] ); +- std::swap( isSingleNode[0], isSingleNode[1] ); ++ isSingleNode.swap( isSingleNode[0], isSingleNode[1] ); + if ( nbSame > 0 ) + sames[0] = 1 - sames[0]; + iNotSameNode = 1 - iNotSameNode; diff --git a/prepare.py b/prepare.py index 57768a2..e3112b6 100644 --- a/prepare.py +++ b/prepare.py @@ -3,7 +3,6 @@ import patch - def prepare_netgen(): """ Prepare sources for Netgen. @@ -154,6 +153,11 @@ def prepare_smesh(): if not success: raise RuntimeError('Failed to apply StdMeshers_ViscousLayers patch.') + pset = patch.fromfile('patch/SMESH_swap_bool_vector.patch') + success = pset.apply(strip=0, root='src/SMESH') + if not success: + raise RuntimeError('Failed to apply SMESH_swap_bool_vector patch.') + # Copy MeshVSLink sources shutil.copytree('extra/MeshVSLink', 'src/SMESH/src/MeshVSLink', dirs_exist_ok=True)