Skip to content

macOS Apple Silicon build fixes#6

Open
basile-simvia wants to merge 1 commit into
SalomePlatform:masterfrom
simvia-tech:local/macos-apple-silicon-9.14.0
Open

macOS Apple Silicon build fixes#6
basile-simvia wants to merge 1 commit into
SalomePlatform:masterfrom
simvia-tech:local/macos-apple-silicon-9.14.0

Conversation

@basile-simvia

Copy link
Copy Markdown

@mohd-afeef-badri @nitawa as discussed during our video call last week, here are the changes related to the Salome 9.14 version on macOS.

Adapt GUI to build on macOS (Apple Silicon) with Qt5, Qwt 6.2, VTK 9, ParaView 5.13, PyQt5 + SIP 6, recent graphviz, and the macOS OpenGL profile. All changes are guarded so non-macOS builds are not affected.

CMake

  • CMakeLists.txt: disable FIND_PACKAGE(SalomeSIP REQUIRED); SIP is provided directly by the Homebrew/PyQt5 install on this host.
  • src/PV3DViewer/CMakeLists.txt: remove PV3DViewer from its own _link_LIBRARIES list (self-dependency caused link failure).
  • src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt, src/SALOME_PYQT/SalomePyQt/CMakeLists.txt, tools/PyConsole/src/python/CMakeLists.txt, tools/PyEditor/src/python/CMakeLists.txt:
    • fix typo $(QT_INCLUDES) -> ${QT_INCLUDES};
    • add SIP build output dir to include path (_sip_SOURCES_sipbuild);
    • add -Dprotected=public -DSIP_PROTECTED_IS_PUBLIC for SIP 6;
    • build PyConsolePy and PyEditorPy as Python MODULEs instead of plain shared libs;
    • add ${QWT_INCLUDE_DIR} to PyConsole include path.

C++ portability

  • src/LightApp/LightApp_ExtInfoDlg.cxx: gvRenderData() takes 'size_t*' for the length parameter on recent graphviz (macOS), 'unsigned int*' elsewhere.
  • src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx: skip the GL_NUM_EXTENSIONS / glGetIntegerv code path on macOS (legacy GL profile only).

Qwt 6.2 compatibility (src/Plot2d/*)

  • Plot2d_Curve.cxx: setSamples(NULL, NULL, 0) is ambiguous in 6.2 - cast to 'const double*'.
  • Plot2d_Histogram.cxx: provide template alias QwtArray = QVector
    (removed in 6.2).
  • Plot2d_PlotItems.{cxx,h}: qwt_compat.h removed in 6.2, include qwt_global.h and redefine QwtDoubleRect = QRectF and qwtMin = qMin.
  • Plot2d_ViewFrame.{cxx,h}: typedef QList QwtValueList; in setCurveType(), QwtSplineCurveFitter is gone in 6.2 - use the built-in QwtPlotCurve::Fitted attribute instead.

VTK 9 compatibility (src/VTKViewer/*)

  • VTKViewer_GeometryFilter.cxx: replace GetCellLinks() with GetLinks() on VTK >= 9 (three call sites).
  • VTKViewer_OpenGLHelper.{cxx,h}: on macOS include <OpenGL/gl.h>
    instead of <GL/glx.h>; skip the glXGetProcAddressARB-based loader in Init() (ARB shader entry points are exposed directly on macOS); add GLcast/GLcastInv macros for the opaque GLhandleARB type on macOS and apply them to vglGetShaderivARB / vglGetShaderInfoLogARB / vglGetProgramivARB call sites.
  • VTKViewer_OpenGLRenderer.cxx, VTKViewer_Texture.cxx: drop the vtkglew / vtk_glew includes on macOS.
  • VTKViewer_PolyDataMapper.cxx: wrap current_program with GLcastInv() before passing to vglUseProgramObjectARB().

ParaView 5.13 compatibility

  • src/PVViewer/PVViewer_Core.cxx: pqOptions is gone in PV 5.13. Comment out the GetHelpSelected/GetUnknownArgument/... block and the argv free/delete (now owned by pqPVApplicationCore), and include vtkProcessModule + vtkCLIOptions for the replacement API (left commented out, no current call site needs it).

Adapt GUI to build on macOS (Apple Silicon) with Qt5, Qwt 6.2,
VTK 9, ParaView 5.13, PyQt5 + SIP 6, recent graphviz, and the macOS
OpenGL profile. All changes are guarded so non-macOS builds are
not affected.

CMake
- CMakeLists.txt: disable FIND_PACKAGE(SalomeSIP REQUIRED); SIP is
  provided directly by the Homebrew/PyQt5 install on this host.
- src/PV3DViewer/CMakeLists.txt: remove PV3DViewer from its own
  _link_LIBRARIES list (self-dependency caused link failure).
- src/SALOME_PYQT/SALOME_PYQT_GUILight/CMakeLists.txt,
  src/SALOME_PYQT/SalomePyQt/CMakeLists.txt,
  tools/PyConsole/src/python/CMakeLists.txt,
  tools/PyEditor/src/python/CMakeLists.txt:
  * fix typo $(QT_INCLUDES) -> ${QT_INCLUDES};
  * add SIP build output dir to include path
    (_sip_SOURCES_sipbuild);
  * add -Dprotected=public -DSIP_PROTECTED_IS_PUBLIC for SIP 6;
  * build PyConsolePy and PyEditorPy as Python MODULEs instead of
    plain shared libs;
  * add ${QWT_INCLUDE_DIR} to PyConsole include path.

C++ portability
- src/LightApp/LightApp_ExtInfoDlg.cxx: gvRenderData() takes
  'size_t*' for the length parameter on recent graphviz (macOS),
  'unsigned int*' elsewhere.
- src/OpenGLUtils/OpenGLUtils_FrameBuffer.cxx: skip the
  GL_NUM_EXTENSIONS / glGetIntegerv code path on macOS
  (legacy GL profile only).

Qwt 6.2 compatibility (src/Plot2d/*)
- Plot2d_Curve.cxx: setSamples(NULL, NULL, 0) is ambiguous in
  6.2 - cast to 'const double*'.
- Plot2d_Histogram.cxx: provide template alias QwtArray<T> = QVector<T>
  (removed in 6.2).
- Plot2d_PlotItems.{cxx,h}: qwt_compat.h removed in 6.2, include
  qwt_global.h and redefine QwtDoubleRect = QRectF and qwtMin = qMin.
- Plot2d_ViewFrame.{cxx,h}: typedef QList<double> QwtValueList; in
  setCurveType(), QwtSplineCurveFitter is gone in 6.2 - use the
  built-in QwtPlotCurve::Fitted attribute instead.

VTK 9 compatibility (src/VTKViewer/*)
- VTKViewer_GeometryFilter.cxx: replace GetCellLinks() with
  GetLinks() on VTK >= 9 (three call sites).
- VTKViewer_OpenGLHelper.{cxx,h}: on macOS include <OpenGL/gl.h>
  instead of <GL/glx.h>; skip the glXGetProcAddressARB-based loader
  in Init() (ARB shader entry points are exposed directly on
  macOS); add GLcast/GLcastInv macros for the opaque GLhandleARB
  type on macOS and apply them to vglGetShaderivARB /
  vglGetShaderInfoLogARB / vglGetProgramivARB call sites.
- VTKViewer_OpenGLRenderer.cxx, VTKViewer_Texture.cxx: drop the
  vtkglew / vtk_glew includes on macOS.
- VTKViewer_PolyDataMapper.cxx: wrap current_program with
  GLcastInv() before passing to vglUseProgramObjectARB().

ParaView 5.13 compatibility
- src/PVViewer/PVViewer_Core.cxx: pqOptions is gone in PV 5.13.
  Comment out the GetHelpSelected/GetUnknownArgument/... block and
  the argv free/delete (now owned by pqPVApplicationCore), and
  include vtkProcessModule + vtkCLIOptions for the replacement
  API (left commented out, no current call site needs it).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant