diff --git a/.github/actions/build-occt/action.yml b/.github/actions/build-occt/action.yml index d0e058ebe3..058ea795c3 100644 --- a/.github/actions/build-occt/action.yml +++ b/.github/actions/build-occt/action.yml @@ -31,6 +31,10 @@ inputs: description: 'CMake build type (Release, Debug, etc)' required: false default: 'Release' + build-parallel-jobs: + description: 'Number of parallel build jobs (empty for auto)' + required: false + default: '' github-token: description: 'GitHub token for vcpkg NuGet package access' required: true @@ -75,7 +79,11 @@ runs: if: ${{ inputs.platform == 'linux' }} run: | cd build - cmake --build . --target install --config Release -- -j + if [ -n "${{ inputs.build-parallel-jobs }}" ]; then + cmake --build . --target install --config Release -- -j${{ inputs.build-parallel-jobs }} + else + cmake --build . --target install --config Release -- -j + fi shell: bash - name: Upload install directory diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml index 93a4aca21b..3736b37027 100644 --- a/.github/workflows/build-and-test-multiplatform.yml +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -63,7 +63,7 @@ jobs: - run-gtest-windows-x64 - run-gtest-macos-x64 - run-gtest-linux-clang-x64 - - run-gtest-macos-clang-no-pch + - run-gtest-linux-gcc-no-pch steps: - name: Checkout repository @@ -120,10 +120,10 @@ jobs: artifact-name: install-linux-clang-x64 github-token: ${{ secrets.GITHUB_TOKEN }} - prepare-and-build-macos-clang-no-pch: - name: Prepare and Build on macOS with Clang (No PCH) - needs: prepare-and-build-macos-x64 - runs-on: macos-15 + prepare-and-build-linux-gcc-no-pch: + name: Prepare and Build on Ubuntu with GCC (No PCH) + needs: prepare-and-build-linux-clang-x64 + runs-on: ubuntu-24.04 steps: - name: Checkout repository @@ -132,13 +132,14 @@ jobs: - name: Build OCCT uses: ./.github/actions/build-occt with: - platform: macos - compiler: clang - artifact-name: install-macos-clang-no-pch + platform: linux + compiler: gcc + artifact-name: install-linux-gcc-no-pch build-use-pch: 'false' build-opt-profile: 'Default' - additional-cmake-flags: '-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wno-error=cast-function-type-mismatch -Wno-error=deprecated-declarations" -D CMAKE_C_FLAGS="-Werror -Wall -Wextra -Wno-error=cast-function-type-mismatch -Wno-error=deprecated-declarations"' + additional-cmake-flags: '-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wno-error=cast-function-type -Wno-error=deprecated-declarations" -D CMAKE_C_FLAGS="-Werror -Wall -Wextra -Wno-error=cast-function-type -Wno-error=deprecated-declarations"' cmake-build-type: 'Debug' + build-parallel-jobs: '4' github-token: ${{ secrets.GITHUB_TOKEN }} test-windows-x64: @@ -300,10 +301,10 @@ jobs: install-artifact-name: install-linux-clang-x64 artifact-suffix: x64 - run-gtest-macos-clang-no-pch: - name: Run GTest on macOS with Clang (No PCH, Debug) - needs: prepare-and-build-macos-clang-no-pch - runs-on: macos-15 + run-gtest-linux-gcc-no-pch: + name: Run GTest on Ubuntu with GCC (No PCH, Debug) + needs: prepare-and-build-linux-gcc-no-pch + runs-on: ubuntu-24.04 steps: - name: Checkout repository @@ -312,9 +313,9 @@ jobs: - name: Run GTests uses: ./.github/actions/run-gtest with: - platform: macos - compiler: clang - install-artifact-name: install-macos-clang-no-pch + platform: linux + compiler: gcc + install-artifact-name: install-linux-gcc-no-pch artifact-suffix: no-pch test-summary: diff --git a/src/DataExchange/TKDESTEP/StepData/StepData_StepWriter.cxx b/src/DataExchange/TKDESTEP/StepData/StepData_StepWriter.cxx index 2c23544097..e93e9848f5 100644 --- a/src/DataExchange/TKDESTEP/StepData/StepData_StepWriter.cxx +++ b/src/DataExchange/TKDESTEP/StepData/StepData_StepWriter.cxx @@ -1186,7 +1186,7 @@ TCollection_AsciiString StepData_StepWriter::CleanTextForSend( if (aThirdChar == '2' || aThirdChar == '4' || aThirdChar == '0') { anIsDirective = true; - aDirectiveLength = 4; // Basic directive length: \X2\, \X4\, \X0\ + aDirectiveLength = 4; // Basic directive length: \X2\, \X4\, \X0\ (4 chars) // For \X2 and \X4, find the terminating \X0 sequence if (aThirdChar == '2' || aThirdChar == '4') diff --git a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Set.hxx b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Set.hxx index 0a68e35a62..62a346dca9 100644 --- a/src/FoundationClasses/TKMath/MathInteg/MathInteg_Set.hxx +++ b/src/FoundationClasses/TKMath/MathInteg/MathInteg_Set.hxx @@ -28,11 +28,11 @@ using namespace MathUtils; //! Result for vector function integration. struct SetResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional Values; //!< Integral of each component int NbEquations = 0; - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_Crout.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_Crout.hxx index 71d6f42db7..9e1008e732 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_Crout.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_Crout.hxx @@ -30,13 +30,13 @@ using namespace MathUtils; //! Specialized for symmetric matrices. struct CroutResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional L; //!< Lower triangular matrix (unit diagonal) std::optional D; //!< Diagonal elements std::optional Inverse; //!< Inverse matrix (lower triangle only) std::optional Determinant; //!< Matrix determinant - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_EigenSearch.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_EigenSearch.hxx index fed376aa0b..5f5ddbebf6 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_EigenSearch.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_EigenSearch.hxx @@ -28,12 +28,12 @@ using namespace MathUtils; //! Result for eigenvalue decomposition of tridiagonal matrix. struct EigenResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional EigenValues; //!< Computed eigenvalues std::optional EigenVectors; //!< Eigenvectors as columns int Dimension = 0; - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_Gauss.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_Gauss.hxx index 7c2b1ac432..85314b7f27 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_Gauss.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_Gauss.hxx @@ -30,13 +30,13 @@ using namespace MathUtils; //! Result for LU decomposition. struct LUResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional LU; //!< Combined L and U matrices std::optional Pivot; //!< Pivot indices std::optional Determinant; int Sign = 1; //!< Sign from row interchanges - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_Householder.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_Householder.hxx index 9d38c05c0f..c17950e9c6 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_Householder.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_Householder.hxx @@ -28,12 +28,12 @@ using namespace MathUtils; //! Result for QR decomposition using Householder reflections. struct QRResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional Q; //!< Orthogonal matrix Q (m x m) std::optional R; //!< Upper triangular matrix R (m x n) int Rank = 0; //!< Numerical rank - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_LeastSquares.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_LeastSquares.hxx index 345efe3c97..f9f75d4cd8 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_LeastSquares.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_LeastSquares.hxx @@ -38,13 +38,13 @@ enum class LeastSquaresMethod //! Result for least squares problems. struct LeastSquaresResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional Solution; //!< Least squares solution x std::optional Residual; //!< ||Ax - b||_2 (L2 norm of residual) std::optional ResidualSq; //!< ||Ax - b||_2^2 (squared residual) int Rank = 0; //!< Numerical rank of A (for SVD) - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathLin/MathLin_SVD.hxx b/src/FoundationClasses/TKMath/MathLin/MathLin_SVD.hxx index 674385f4c3..5374f80151 100644 --- a/src/FoundationClasses/TKMath/MathLin/MathLin_SVD.hxx +++ b/src/FoundationClasses/TKMath/MathLin/MathLin_SVD.hxx @@ -29,13 +29,13 @@ using namespace MathUtils; //! Result for SVD decomposition. struct SVDResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional U; //!< Left singular vectors (m x n) std::optional SingularValues; //!< Singular values (n elements) std::optional V; //!< Right singular vectors (n x n) int Rank = 0; //!< Numerical rank - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathOpt/MathOpt_Uzawa.hxx b/src/FoundationClasses/TKMath/MathOpt/MathOpt_Uzawa.hxx index 5f7b31daac..469f0860dd 100644 --- a/src/FoundationClasses/TKMath/MathOpt/MathOpt_Uzawa.hxx +++ b/src/FoundationClasses/TKMath/MathOpt/MathOpt_Uzawa.hxx @@ -29,7 +29,7 @@ using namespace MathUtils; //! Result for Uzawa constrained optimization. struct UzawaResult { - Status Status = Status::NotConverged; + MathUtils::Status Status = MathUtils::Status::NotConverged; std::optional Solution; //!< Solution vector X std::optional Dual; //!< Dual (Lagrange) variables std::optional Error; //!< X - X0 (difference from starting point) @@ -37,7 +37,7 @@ struct UzawaResult std::optional InverseCTC; //!< (C * C^T)^-1 for gradient computation int NbIterations = 0; - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } explicit operator bool() const { return IsDone(); } }; diff --git a/src/FoundationClasses/TKMath/MathSys/MathSys_Newton2D.hxx b/src/FoundationClasses/TKMath/MathSys/MathSys_Newton2D.hxx index 956056f3a7..695859d7b4 100644 --- a/src/FoundationClasses/TKMath/MathSys/MathSys_Newton2D.hxx +++ b/src/FoundationClasses/TKMath/MathSys/MathSys_Newton2D.hxx @@ -42,14 +42,14 @@ using namespace MathUtils; //! Result of 2D Newton iteration. struct Newton2DResult { - Status Status = Status::NotConverged; //!< Computation status - double U = 0.0; //!< Solution U coordinate - double V = 0.0; //!< Solution V coordinate - size_t NbIter = 0; //!< Number of iterations performed - double FNorm = 0.0; //!< Final |F| norm + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + double U = 0.0; //!< Solution U coordinate + double V = 0.0; //!< Solution V coordinate + size_t NbIter = 0; //!< Number of iterations performed + double FNorm = 0.0; //!< Final |F| norm //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } diff --git a/src/FoundationClasses/TKMath/MathUtils/MathUtils_Types.hxx b/src/FoundationClasses/TKMath/MathUtils/MathUtils_Types.hxx index 83f79919ac..2e3f12e0bd 100644 --- a/src/FoundationClasses/TKMath/MathUtils/MathUtils_Types.hxx +++ b/src/FoundationClasses/TKMath/MathUtils/MathUtils_Types.hxx @@ -43,14 +43,14 @@ enum class Status //! Contains the found root/minimum location and diagnostic information. struct ScalarResult { - Status Status = Status::NotConverged; //!< Computation status - size_t NbIterations = 0; //!< Number of iterations performed - std::optional Root; //!< Found root or minimum location - std::optional Value; //!< Function value at root/minimum - std::optional Derivative; //!< Derivative at root (if computed) + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + size_t NbIterations = 0; //!< Number of iterations performed + std::optional Root; //!< Found root or minimum location + std::optional Value; //!< Function value at root/minimum + std::optional Derivative; //!< Derivative at root (if computed) //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. //! Example: if (aResult) { use *aResult.Root; } @@ -61,12 +61,12 @@ struct ScalarResult //! Supports up to 4 real roots (for quartic equations). struct PolyResult { - Status Status = Status::NotConverged; //!< Computation status - size_t NbRoots = 0; //!< Number of real roots found - std::array Roots = {0.0, 0.0, 0.0, 0.0}; //!< Array of real roots (sorted) + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + size_t NbRoots = 0; //!< Number of real roots found + std::array Roots = {0.0, 0.0, 0.0, 0.0}; //!< Array of real roots (sorted) //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -81,7 +81,7 @@ struct PolyResult //! Contains the solution vector and optional gradient/Jacobian information. struct VectorResult { - Status Status = Status::NotConverged; //!< Computation status + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status size_t NbIterations = 0; //!< Number of iterations performed std::optional Solution; //!< Solution vector (set by solver on success) std::optional Value; //!< Function value at solution (if computed) @@ -89,7 +89,7 @@ struct VectorResult std::optional Jacobian; //!< Jacobian at solution (if computed) //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -99,12 +99,12 @@ struct VectorResult //! Contains the solution vector and matrix determinant if computed. struct LinearResult { - Status Status = Status::NotConverged; //!< Computation status + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status std::optional Solution; //!< Solution vector X in AX = B (set by solver) std::optional Determinant; //!< Determinant of matrix (if computed) //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -114,13 +114,13 @@ struct LinearResult //! Contains eigenvalues and optionally eigenvectors. struct EigenResult { - Status Status = Status::NotConverged; //!< Computation status + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status size_t NbIterations = 0; //!< Number of iterations performed std::optional EigenValues; //!< Computed eigenvalues (set by solver) std::optional EigenVectors; //!< Computed eigenvectors (set by solver) //! Returns true if computation succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -130,14 +130,14 @@ struct EigenResult //! Structure depends on decomposition type. struct DecompResult { - Status Status = Status::NotConverged; //!< Computation status + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status std::optional L; //!< Lower triangular (LU) or left singular vectors (SVD) std::optional U; //!< Upper triangular (LU) or right singular vectors (SVD) std::optional D; //!< Diagonal elements or singular values std::optional Determinant; //!< Matrix determinant (if computed) //! Returns true if decomposition succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -147,15 +147,15 @@ struct DecompResult //! Contains integral value and error estimates. struct IntegResult { - Status Status = Status::NotConverged; //!< Computation status - size_t NbIterations = 0; //!< Number of adaptive iterations + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + size_t NbIterations = 0; //!< Number of adaptive iterations size_t NbPoints = 0; //!< Total number of quadrature points used std::optional Value; //!< Computed integral value std::optional AbsoluteError; //!< Estimated absolute error (if computed) std::optional RelativeError; //!< Estimated relative error (if computed) //! Returns true if integration succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } @@ -165,12 +165,12 @@ struct IntegResult //! Contains the inverse matrix if computation succeeded. struct InverseResult { - Status Status = Status::NotConverged; //!< Computation status - std::optional Inverse; //!< Computed inverse matrix - std::optional Determinant; //!< Determinant of matrix (if computed) + MathUtils::Status Status = MathUtils::Status::NotConverged; //!< Computation status + std::optional Inverse; //!< Computed inverse matrix + std::optional Determinant; //!< Determinant of matrix (if computed) //! Returns true if inversion succeeded. - bool IsDone() const { return Status == Status::OK; } + bool IsDone() const { return Status == MathUtils::Status::OK; } //! Conversion to bool for convenient checking. explicit operator bool() const { return IsDone(); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GTests/GeomFill_CorrectedFrenet_Test.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GTests/GeomFill_CorrectedFrenet_Test.cxx index f26cb425c2..05613b27c4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GTests/GeomFill_CorrectedFrenet_Test.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GTests/GeomFill_CorrectedFrenet_Test.cxx @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -146,8 +147,8 @@ TEST(GeomFill_CorrectedFrenet, ActualReproducerCase) ShapeExtend_WireData anExtend; for (int i = 2; i <= aPoints.Length(); i++) { - occ::handle aCurve = GC_MakeSegment(aPoints(i - 1), aPoints(i)).Value(); - TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aCurve).Edge(); + occ::handle aCurve = GC_MakeSegment(aPoints(i - 1), aPoints(i)).Value(); + TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aCurve).Edge(); anExtend.Add(anEdge); } diff --git a/src/ModelingData/TKG3d/GeomGridEval/GeomGridEval_Parabola.cxx b/src/ModelingData/TKG3d/GeomGridEval/GeomGridEval_Parabola.cxx index c3af88b319..0b95b23538 100644 --- a/src/ModelingData/TKG3d/GeomGridEval/GeomGridEval_Parabola.cxx +++ b/src/ModelingData/TKG3d/GeomGridEval/GeomGridEval_Parabola.cxx @@ -240,8 +240,8 @@ NCollection_Array1 GeomGridEval_Parabola::EvaluateGridDN( NCollection_Array1 aResult(1, aNb); const gp_Parab& aParab = myGeom->Parab(); - const gp_Dir& aXDir = aParab.XAxis().Direction(); - const gp_Dir& aYDir = aParab.YAxis().Direction(); + const gp_Dir aXDir = aParab.XAxis().Direction(); + const gp_Dir aYDir = aParab.YAxis().Direction(); const double aFocal = aParab.Focal(); const double aXX = aXDir.X();