197.2. opencascade-7.9.3
Open CASCADE Technology, the B-rep CAD kernel with STEP, IGES and glTF exchange
| Version | 7.9.3, release 1 |
| Shelf | cad — Mechanical, architectural and 2D CAD, geometry kernels, meshing and FEM |
| Phase | 42_graphics (Graphics Stack), 70 of 189 in build order |
| Licence | LGPL-2.1-only WITH OCCT-exception-1.0 |
| Homepage | https://dev.opencascade.org/ |
| Build time | 35.1 SBU |
| Installed size | 105.6 MiB in 7718 files |
| Recipe | ports/core/cad/opencascade/kpkgbuild |
About
Open CASCADE Technology (OCCT) is a boundary-representation geometry kernel: solid modelling, Boolean operations, meshing, and data exchange through STEP, IGES, glTF, OBJ, PLY, STL and VRML. In KDOS it is there for other programs: FreeCAD, KiCad, netgen, gmsh, IfcOpenShell, LibrePCB, Horizon EDA and PrusaSlicer link it, for their geometry and their STEP import and export.
Sources
opencascade-7.9.3.tar.gz(46.3 MiB)
sha2565ecf094ec6b12d5413dfb851d8c3590c354058aee556e32e408bdfbf8c357d57
upstream: https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_9_3.tar.gz
archive copy: sources-1/cad--opencascade-7.9.3.tar.gz
Dependencies
Depends on: cmake, ninja, freetype2, fontconfig, rapidjson, draco, mesa, libglvnd.
Required by (8): freecad, gmsh, horizon-eda, ifcopenshell, kicad, librepcb, netgen, prusaslicer.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DUSE_XLIB=OFF, line 28: libX11 (explained with the switches below)-DUSE_TK=OFF, line 31: tk-DUSE_FFMPEG=OFF, line 35: ffmpeg-DUSE_TBB=OFF, line 37: onetbb (explained with the switches below)-DUSE_EIGEN=OFF, line 38: eigen (explained with the switches below)-DUSE_VTK=OFF, line 39: vtk (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
no_backtrace.patch— Removes#include <execinfo.h>and the body ofStandard::StackTrace()that callsbacktrace()andbacktrace_symbols(), so the function returns false. musl has noexecinfo.h, and without the patch the file does not compile.no_feenableexcept.patch— Rewrites two#ifdef __linux__lines ofOSD_signal.cxx, around the<cfenv>include and the SIGFPE handler’s call toOSD::SetFloatingSignal(), as#ifdef __linux__ && defined(__GLIBC__); see the Notes for what that does.no_mallinfo.patch— Replaces themallinfo()heap figures ofOSD_MemInfowithgetrusage()’s peak resident set size (ru_maxrss), in the Linux branch and the Emscripten one. On Linux the unpatched code already readsmallinfoonly under glibc and reports 0 otherwise; with the patch, on musl, the heap-usage counter reports the peak resident size in KiB instead of 0.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install opencascade'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/cad/opencascade.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/cad/opencascade
echo '5ecf094ec6b12d5413dfb851d8c3590c354058aee556e32e408bdfbf8c357d57 opencascade-7.9.3.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/opencascade
SRC=$SRC_ROOT/opencascade-7.9.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf opencascade-7.9.3.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _tag and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no_mallinfo.patch"
patch -p1 -i "$PORT_SRC/no_feenableexcept.patch"
patch -p1 -i "$PORT_SRC/no_backtrace.patch"
mkdir -p build && cd build
cmake .. -G Ninja -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_LIBRARY_TYPE=Shared \
-DINSTALL_DIR_LIB=lib \
-DINSTALL_DIR_CMAKE=lib/cmake/opencascade \
-DINSTALL_DIR_SCRIPT=share/opencascade/scripts \
-DBUILD_MODULE_Draw=OFF \
-DBUILD_DOC_Overview=OFF \
-DINSTALL_SAMPLES=OFF \
-DINSTALL_TEST_CASES=OFF \
-DUSE_XLIB=OFF \
-DUSE_OPENGL=ON \
-DUSE_GLES2=OFF \
-DUSE_TK=OFF \
-DUSE_FREETYPE=ON \
-DUSE_RAPIDJSON=ON \
-DUSE_FREEIMAGE=OFF \
-DUSE_FFMPEG=OFF \
-DUSE_DRACO=ON \
-DUSE_TBB=OFF \
-DUSE_EIGEN=OFF \
-DUSE_VTK=OFF \
-DUSE_OPENVR=OFF
ninja
DESTDIR=$PKG ninja install
rm -rf "$PKG/usr/share/doc"
readelf -d "$PKG/usr/lib/libTKDEGLTF.so" | grep -q libdraco
The switches, and why each is set:
-DBUILD_LIBRARY_TYPE=Shared— Build the toolkits (libTKernel.so,libTKMath.so,libTKDESTEP.soand the rest) as shared libraries rather than static archives.-DINSTALL_DIR_LIB=lib,-DINSTALL_DIR_CMAKE=lib/cmake/opencascade— Where the libraries and theOpenCASCADEConfig.cmakefiles go. Consumers find OCCT withfind_package(OpenCASCADE), which reads that directory.-DINSTALL_DIR_SCRIPT=share/opencascade/scripts— Install the environment scripts OCCT generates (env.sh,custom.shand thecustom_*scripts they source) undershare. For the Unix layout their default is thebindirectory, which would put them in/usr/binas commands.-DBUILD_MODULE_Draw=OFF,-DUSE_TK=OFF— Do not build Draw (DRAWEXE), OCCT’s Tcl/Tk test shell, nor use Tk, which only Draw’s user interface uses. The one program left isExpToCasExe, from the DETools module, which is on by default: it generates OCCT classes from a STEP EXPRESS schema and is installed in/usr/bin.-DBUILD_DOC_Overview=OFF,-DINSTALL_SAMPLES=OFF,-DINSTALL_TEST_CASES=OFF— Generate no HTML overview, and install neither the samples nor the non-regression test scripts.-DUSE_XLIB=OFF— Build the OpenGL driver,libTKOpenGl, on EGL instead of GLX and Xlib: withHAVE_XLIBundefined on Linux, OCCT definesHAVE_EGLand linkslibGLandlibEGLinstead oflibGLandlibX11. OCCT’s viewer then works in any EGL context, a Wayland one among them; built with Xlib it is GLX and X11 only.-DUSE_OPENGL=ON,-DUSE_GLES2=OFF— Build the visualization module against desktop OpenGL through libglvnd, not OpenGL ES 2.0.-DUSE_FREETYPE=ON— Render text with FreeType, from the font directoriesFont_FontMgrasks fontconfig for; the switch is also what linkslibfontconfig.-DUSE_RAPIDJSON=ON,-DUSE_DRACO=ON— Read and write glTF: RapidJSON parses the JSON of a glTF file, and Draco decodes meshes compressed with theKHR_draco_mesh_compressionextension. Both are off by default.-DUSE_FREEIMAGE=OFF,-DUSE_FFMPEG=OFF,-DUSE_OPENVR=OFF— Build without FreeImage (image files in the visualization module), FFmpeg (recording a view to video) and OpenVR (virtual reality). All three are off by default. FreeImage and OpenVR are not in the tree; ffmpeg is, and the switch keeps the visualization module from linking it.-DUSE_TBB=OFF— Run OCCT’s parallel algorithms on its own thread pool instead of Intel’s Threading Building Blocks. Upstream’s description says OCCT stays parallel without it; onetbb is in the tree, and with the switch on the toolkits that listCSF_TBB,libTKernel,libTKMath,libTKGeomBase,libTKTopAlgo, the Boolean toolkitlibTKBO,libTKV3dandlibTKOpenGl, would link it.-DUSE_EIGEN=OFF— Do not search for Eigen. No toolkit of this release listsCSF_EIGENin itsEXTERNLIB, so the switch changes no library.-DUSE_VTK=OFF— Build without the VTK Integration Services, OCCT’s bridge from its shapes to VTK pipelines.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/opencascade, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf opencascade-7.9.3-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/opencascade, and runs the triggers its paths call for.
Contents
Installed programs: ExpToCasExe, ExpToCasExe-7.9.3.
Installed libraries: libTKBO.so, libTKBRep.so, libTKBin.so, libTKBinL.so, libTKBinTObj.so, libTKBinXCAF.so, libTKBool.so, libTKCAF.so, libTKCDF.so, libTKDE.so, libTKDECascade.so, libTKDEGLTF.so, libTKDEIGES.so, libTKDEOBJ.so, libTKDEPLY.so, libTKDESTEP.so, libTKDESTL.so, libTKDEVRML.so, libTKExpress.so, libTKFeat.so, libTKFillet.so, libTKG2d.so, libTKG3d.so, libTKGeomAlgo.so, libTKGeomBase.so, libTKHLR.so, libTKLCAF.so, libTKMath.so, libTKMesh.so, libTKMeshVS.so, libTKOffset.so, libTKOpenGl.so, libTKPrim.so, libTKRWMesh.so, libTKService.so, libTKShHealing.so, libTKStd.so, libTKStdL.so, libTKTObj.so, libTKTopAlgo.so, libTKV3d.so, libTKVCAF.so, libTKXCAF.so, libTKXMesh.so, libTKXSBase.so, libTKXml.so, libTKXmlL.so, libTKXmlTObj.so, libTKXmlXCAF.so, libTKernel.so.
Installed directories: /usr/include/opencascade, /usr/lib/cmake/opencascade, /usr/share/licenses/opencascade, /usr/share/opencascade.
Notes
no_feenableexcept.patchchanges nothing. Its header says it limitsfeenableexcept()andfedisableexcept(), which musl lacks, to glibc. The calls it means are already guarded bydefined(__linux__) && defined(__GLIBC__)in this release’sOSD::SetFloatingSignal. The two lines it edits read#ifdef __linux__ && defined(__GLIBC__), and#ifdeftakes one name: the compiler warns about the extra tokens and tests__linux__alone, as before the patch.- The Draco check. The last line of
build.shrequireslibTKDEGLTF.so, the glTF toolkit, to havelibdracoamong itsNEEDEDentries, so a configure that did not find Draco stops the build instead of installing a glTF reader that cannot open compressed meshes.