Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
# checkout, setup pixi, compilers and ccache/sccache
# submodules: recursive is required for thirdparty/pythonocc-core (vendored SWIG sources
# needed at CMake configure time for the python-internal bindings, see cmake/FindPythonOCC.cmake)
- uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up Visual Studio shell
if: startsWith(inputs.os, 'windows')
uses: egor-tensin/vs-shell@v2
Expand All @@ -76,6 +80,10 @@ jobs:
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
environments: ${{ inputs.pixienv }}

- name: Check CPACS schema
run: pixi run -e default check-schema
if: ${{inputs.os == 'ubuntu-latest' && inputs.config == 'Debug' }}

# configure, build and install tigl3
- name: Configure TiGL (Linux, MacOS)
run: pixi run -e ${{ inputs.pixienv }} configure ${{ inputs.config }} ${{ inputs.nightly }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
package: "OFF"
- os: "windows-2022"
config: "Release"
pixienv: "occt-static"
pixienv: "default"
documentation: "ON"
package: "ON"
- os: "ubuntu-latest"
Expand All @@ -65,12 +65,12 @@ jobs:
pixienv: "default"
documentation: "OFF"
package: "OFF"
#- os: "macos-13"
# config: "Release"
# pixienv: "occt-static"
# documentation: "OFF"
# # create macos package (dmg) only on release and scheduled (nightly) builds due to time constraints of macos runners
# package: ${{ ( (github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))) && 'ON') || 'OFF' }}
- os: "macos-latest"
config: "Release"
pixienv: "default"
documentation: "OFF"
# create macos package (dmg) only on release and scheduled (nightly) builds due to time constraints of macos runners
package: ${{ ( (github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))) && 'ON') || 'OFF' }}
uses: ./.github/workflows/build-test.yml
secrets: inherit
with:
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
url = https://github.com/DLR-SC/cpacs_tigl_gen.git
branch = master
ignore = dirty
[submodule "thirdparty/pythonocc-core"]
path = thirdparty/pythonocc-core
url = https://github.com/tpaviot/pythonocc-core.git
ignore = dirty
10 changes: 10 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ Changes since last release
----------------
2025/09/26
-General changes
- Include the external cpacs schema tool in our repo and CI workflow to directly check an edited CPACS XSD for correctness ([#1420](https://github.com/DLR-SC/tigl/issues/1420)).
- Build system: migrated TiGL's build dependencies from the `dlr-sc` conda channel to `conda-forge` ([#1286](https://github.com/DLR-SC/tigl/issues/1286)). OpenCASCADE is now the stock, unpatched conda-forge `occt` package (dynamic only, bumped 7.6.2 → 7.9.3), and TiXI comes from conda-forge's `tixi` package. Also fixes the `macos-latest`/Apple Silicon CI breakage from the `macos-13` runner retirement ([#1273](https://github.com/DLR-SC/tigl/issues/1273)) and adds `osx-arm64` as a supported platform, and may fix stale TBB linking on Linux ([#964](https://github.com/DLR-SC/tigl/issues/964)).
- Build system: `pythonocc-core`'s SWIG interface sources (not shipped by the conda-forge package) are now vendored as a git submodule at `thirdparty/pythonocc-core`; `swig` pinned to `4.4.*` to match. The submodule tag must stay in sync with the `pythonocc-core`/`occt` versions in `pixi.toml` — once [conda-forge/pythonocc-feedstock](https://github.com/conda-forge/pythonocc-feedstock) ships these sources, the vendoring can be dropped and `cmake/FindPythonOCC.cmake` restored to its pre-migration behaviour.
- Build system: MATLAB SDK headers/import-libs (no conda-forge equivalent) are now vendored at `thirdparty/matlab-sdk/{win-64,osx-64}`; skipped automatically on Apple Silicon, where no SDK is vendored and `cmake/FindMATLAB.cmake` previously mislinked against the Intel one.
- Build system: widened the `python` version cap to `<3.15` (was `<3.13`) now that conda-forge has 3.14 builds for all of TiGL's dependencies; still resolves to python 3.12 by default.
- Build system: fixed a Linux `-lGL` link error and a nightly-build version-string corruption bug (packed git refs after `git gc`).
- `WingSegmentGuideCurves.DISABLED_tiglWingGetSegmentUpperSurfaceAreaTrimmed` remains disabled: its golden value depends on the dlr-sc Coons-C2 patch conda-forge's OCCT lacks.
- `MakePatches::BuildSurface` (`src/contrib/MakePatches.cxx`) now returns null (existing convention for malformed input) instead of dereferencing an unset `Handle` when a guide-curve loft's boundary curves don't form a closed quad within tolerance. (Defensive hardening; this turned out *not* to be the cause of the `osx-arm64` CI abort — see the test-suite entry below.)
- Fixed a SIGABRT (`malloc: pointer being freed was not allocated`) in the unit tests on `osx-arm64` CI: tests that passed a locally-constructed `std::ifstream` to `BRepTools::Read` crashed inside `TopTools_ShapeSet::Read`'s `std::locale` handling, because the test binary (built with AppleClang against the system libc++) and conda-forge's occt (linked against conda's `libcxx`) load two different libc++ runtimes into one process. The affected tests now use the filename overload of `BRepTools::Read`, which constructs the stream inside occt. TiGL's own library code only uses the filename overloads and is unaffected.
- Fixed `CTiglWingHelper`'s major/deep-axis heuristic being platform-dependent for wings at exactly 45° (e.g. dihedral 45°, test wing `W14_ChaDih`): the accumulated |span| components along two axes are then mathematically equal, and the plain `>=` comparisons picked the winner based on last-ulp rounding (FMA contraction/libm differences on `osx-arm64`), flipping the wing's major axis and thus `GetSweep`/`GetDihedral` by their complement after `SetSweep`. Near-ties (relative 1e-8) are now resolved deterministically in favor of the conventional axis.
- Update the internal CPACS schema to version 3.5.1. For further CPACS updates, observe the important note in the belonging PR [#1028](https://github.com/DLR-SC/tigl/issues/1028).
- TiGLCreator: Draw option menus are now updated when adding new wings or fuselages.
- TiGLCreator: Bi-directional selection of shapes via the GUI or the CPACSTree is supported now [#1275](https://github.com/DLR-SC/tigl/issues/1275).
Expand Down
4 changes: 0 additions & 4 deletions bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ if (TIGL_BINDINGS_PYTHON)
if (DEFINED ENV{CONDA_PREFIX})
if (WIN32)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "$ENV{CONDA_PREFIX}/Library")
# Helps to find PythonOCC automatically
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "$ENV{CONDA_PREFIX}/Library/src/pythonocc-core")
else()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "$ENV{CONDA_PREFIX}")
# Helps to find PythonOCC automatically
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "$ENV{CONDA_PREFIX}/src/pythonocc-core")
endif()
endif()

Expand Down
38 changes: 36 additions & 2 deletions cmake/FindMATLAB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,37 @@
if (NOT MATLAB_DIR)
if (NOT $ENV{MATLABDIR} STREQUAL "")
set (MATLAB_DIR "$ENV{MATLABDIR}" CACHE PATH "Installation prefix for MATLAB." FORCE)
else ()
elseif (NOT $ENV{MATLAB_DIR} STREQUAL "")
set (MATLAB_DIR "$ENV{MATLAB_DIR}" CACHE PATH "Installation prefix for MATLAB." FORCE)
endif ()
endif ()

# No real MATLAB installation configured: fall back to the vendored MATLAB SDK headers and
# import-stub libraries (mex.h, matrix.h, libmex/libmx/libmat) under thirdparty/matlab-sdk.
# These are the same files previously shipped by the dlr-sc "matlab-libs" conda package -- there
# is no conda-forge equivalent, so they're committed in-repo instead. Only win-64 and osx-64
# (Intel) are vendored: on Linux, MATLAB ships "mex"/"make" itself, so users compile against
# their own installation (see doc/installation.md); on osx-arm64 (Apple Silicon) there is no
# vendored SDK at all, so MATLAB bindings are simply skipped there (MATLAB_FOUND stays false)
# unless the user points MATLAB_DIR at their own Apple Silicon MATLAB installation.
if (NOT MATLAB_DIR)
if (WIN32)
set (_TIGL_MATLAB_SDK_DIR "${CMAKE_SOURCE_DIR}/thirdparty/matlab-sdk/win-64")
elseif (APPLE AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" AND NOT CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
set (_TIGL_MATLAB_SDK_DIR "${CMAKE_SOURCE_DIR}/thirdparty/matlab-sdk/osx-64")
elseif (APPLE AND (CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR (NOT CMAKE_OSX_ARCHITECTURES AND (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64"))))
set (_TIGL_MATLAB_SDK_DIR "${CMAKE_SOURCE_DIR}/thirdparty/matlab-sdk/osx-arm64")
endif ()
if (_TIGL_MATLAB_SDK_DIR AND EXISTS "${_TIGL_MATLAB_SDK_DIR}/extern/include/mex.h")
set (MATLAB_DIR "${_TIGL_MATLAB_SDK_DIR}" CACHE PATH "Installation prefix for MATLAB." FORCE)
endif ()
if (NOT MATLAB_DIR AND APPLE AND (CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR (NOT CMAKE_OSX_ARCHITECTURES AND (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64"))))
message(WARNING "MATLAB bindings will not be built on Apple Silicon (osx-arm64): no vendored SDK available. "
"Set MATLAB_DIR to a local Apple Silicon MATLAB installation to enable them. "
"See doc/installation.md §thirdpartysources.")
endif ()
unset (_TIGL_MATLAB_SDK_DIR)
endif ()

if(NOT MATLAB_LIB_DIR)
set(MATLAB_LIB_DIR "$ENV{MATLAB_LIB_DIR}" CACHE PATH "Library path for MATLAB mex files." FORCE)
Expand All @@ -125,8 +152,15 @@ IF(UNIX)
SET( MATLAB_ARCH maci )
SET( MATLAB_MEX_SUFFIX .mexmaci CACHE STRING "Mex shared library file suffix" )
SET( MATLAB_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" CACHE INTERNAL
"${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" CACHE INTERNAL
"extra CFLAGS to suppress linker errors in Mac OS X" )
# Apple Silicon: either explicitly cross-compiling for arm64, or a native (non-cross)
# build where CMAKE_OSX_ARCHITECTURES is unset and CMAKE_SYSTEM_PROCESSOR reflects the
# host. MATLAB only added native arm64 support (mexmaca64) in R2023a; this find module
# predates that, so without this branch it silently mislabels arm64 builds as maci64.
ELSEIF( CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR (NOT CMAKE_OSX_ARCHITECTURES AND (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")) )
SET( MATLAB_ARCH maca64 )
SET( MATLAB_MEX_SUFFIX .mexmaca64)
ELSE()
SET( MATLAB_ARCH maci64 )
SET( MATLAB_MEX_SUFFIX .mexmaci64)
Expand Down
26 changes: 24 additions & 2 deletions cmake/FindPythonOCC.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# Look for the interface file
# The pythonocc-core SWIG interface files (src/SWIG_files/...) are not shipped by the
# conda-forge pythonocc-core package (only the compiled OCC Python module is). Until that is
# addressed upstream (https://github.com/conda-forge/pythonocc-feedstock), TiGL vendors the
# matching pythonocc-core release as a git submodule at thirdparty/pythonocc-core -- keep its
# pinned tag in sync with the pythonocc-core/occt version in pixi.toml.
FIND_PATH(PythonOCC_SOURCE_DIR
NAMES src/SWIG_files/wrapper/Standard.i
PATH_SUFFIXES src/pythonocc-core
PATHS ${CMAKE_SOURCE_DIR}/thirdparty/pythonocc-core
NO_DEFAULT_PATH
)

IF(NOT PythonOCC_SOURCE_DIR)
# Fall back to a conda-provided source tree, if any (e.g. a non-conda-forge channel).
FIND_PATH(PythonOCC_SOURCE_DIR
NAMES src/SWIG_files/wrapper/Standard.i
PATH_SUFFIXES src/pythonocc-core
)
ENDIF()

IF(NOT PythonOCC_SOURCE_DIR)
MESSAGE(WARNING
"pythonocc-core SWIG sources not found under ${CMAKE_SOURCE_DIR}/thirdparty/pythonocc-core. "
"This is a git submodule and is not populated by a plain 'git clone' -- run "
"'git submodule update --init --recursive' from the repository root and reconfigure. "
"(pixi's 'configure' task does this automatically; only needed manually if configuring outside of pixi.)"
)
ENDIF()

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonOCC
REQUIRED_VARS PythonOCC_SOURCE_DIR)
Expand Down
13 changes: 10 additions & 3 deletions cmake/GetGitRevisionDescription.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ if(HEAD_CONTENTS MATCHES "ref")
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
set(HEAD_HASH "${HEAD_REF}")
elseif(EXISTS "@GIT_DIR@/packed-refs")
# The branch's ref isn't a loose file, e.g. after "git gc"/"git pack-refs" -- look it up
# in packed-refs instead. (This used to fall back to the branch's reflog file and set
# HEAD_HASH to the ref *name* itself rather than a real commit hash, silently corrupting
# any version string built from it.)
file(STRINGS "@GIT_DIR@/packed-refs" _tigl_packed_ref_line REGEX "^[0-9a-f]+ ${HEAD_REF}$")
if(_tigl_packed_ref_line)
string(REGEX REPLACE "^([0-9a-f]+) .*" "\\1" HEAD_HASH "${_tigl_packed_ref_line}")
endif()
unset(_tigl_packed_ref_line)
endif()
else()
# detached HEAD
Expand Down
42 changes: 30 additions & 12 deletions doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ TiGL is a CMake project, so in simple terms, TiGL can be configured and built vi

The minimum requirements to build TiGL are a C++17 compliant compiler and CMake, TiXI and OpenCascade Technology (OCCT). Qt5 is needed if you want to build the TiGLCreator.

All build dependencies of TiGL are available as conda packages. Most dependencies are supplied in a decicated channel at [https://anaconda.org/dlr-sc/](https://anaconda.org/dlr-sc/).
Specifically, this channel contains a recommended variant of opencascade, which includes a patch for G2-continuous Coons patches.
The recipes for the conda packages in the dlr-sc channel can be found at [https://github.com/DLR-SC/tigl-conda](https://github.com/DLR-SC/tigl-conda).
All build dependencies of TiGL are available as conda packages, mostly from the [conda-forge](https://conda-forge.org/) channel.
TiGL no longer requires a patched variant of OpenCASCADE; the stock conda-forge `occt` package is used directly.

@subsection pixi Using the Pixi package manager

Expand All @@ -71,23 +70,21 @@ Will build and install TiGL using cmake and ninja. This will be done using the t

will invoke unit tests and integration tests

pixi run tiglcreator
pixi run -e default tiglcreator

will start the TiGLCreator from the install directory.

To use another environment than `default`, we need to invoke the command like this:
To build and run tests, use the `default` environment:

pixi run -e occt-static configure
pixi run install
pixi run unittests

This command configures TiGL for a Release build that statically links against OpenCascade, installs TiGL in a subdirectory of the build directory and run the unit tests, but not the integration tests.
pixi run -e default configure
pixi run -e default install
pixi run -e default unittests

The `configure` task has additional arguments. For instance

pixi run -e occt-static configure Debug
pixi run -e default configure Debug

will configure a Debug build of TiGL that links in OCCT statically.
will configure a Debug build of TiGL.

@subsection internalpython Internal Python bindings

Expand Down Expand Up @@ -116,6 +113,27 @@ The code generator is included as a git submodule to this repository. For conven

will update the git submodule, build the code generator and invoke the code generator on the input files in the directory `cpacs_gen_input/`.

@subsection thirdpartysources Vendored third-party sources

Two dependencies that aren't (fully) available as conda-forge packages are vendored directly in the repository:

- `thirdparty/pythonocc-core` (git submodule): the pythonocc-core SWIG interface files used by TiGL's
internal Python bindings (`TIGL_BINDINGS_PYTHON_INTERNAL`) to reuse OCCT type wrappers. The
conda-forge `pythonocc-core` package only ships the compiled `OCC` Python module, not these sources.
The pixi `generate` and `python-internal configure` tasks initialize this submodule automatically.
When building without pixi, run `git submodule update --init --recursive` before configuring.
**Important**: keep the submodule's pinned tag in sync with the `pythonocc-core` and `occt` versions
in `pixi.toml` (see the pinned version comments there). SWIG's cross-module runtime type sharing
breaks silently across large version gaps.
- `thirdparty/matlab-sdk/{win-64,osx-64}`: MATLAB's `extern/include` headers and `mex`/`mx`/`mat`
import-stub libraries needed to build the MATLAB (MEX) bindings (`TIGL_BINDINGS_MATLAB`) without a
full MATLAB installation. No conda-forge equivalent exists. Not needed on Linux, where MATLAB itself
provides `mex`/`make` for building the bindings against a real local installation (see @ref matlab).
`cmake/FindMATLAB.cmake` uses these automatically as a fallback when `MATLAB_DIR`/`MATLABDIR` aren't
set to a real MATLAB installation. Only an Intel (`osx-64`) SDK is vendored — on Apple Silicon
(`osx-arm64`) the MATLAB bindings are skipped with a CMake warning unless you point `MATLAB_DIR`
at your own Apple Silicon MATLAB installation.

@subsection cmakeoptions CMake Options

Here is a complete list of TiGL's CMake options.
Expand Down
Loading
Loading