Skip to content

Support for macOS platform - #10

Open
raphael-nabet wants to merge 4 commits into
SalomePlatform:masterfrom
raphael-nabet:support-for-macos-platform
Open

raphael-nabet wants to merge 4 commits into
SalomePlatform:masterfrom
raphael-nabet:support-for-macos-platform

Conversation

@raphael-nabet

@raphael-nabet raphael-nabet commented Oct 28, 2026 •

Copy link
Copy Markdown

MacOS support on arm64

Hi @nitawa ,

To ensure that KERNEL is compatible with the build of SALOME on macOS, we modified some elements:

  • src/Container/Component_i.cxx,
  • src/Container/Container_i.cxx,
  • src/DSC/DSC_Python/calcium.i,
  • src/DSC/DSC_User/Datastream/Calcium/CalciumC.c,
  • src/Launcher/SALOME_ExternalServerLauncher.cxx,
  • src/ParallelContainer/SALOME_ParallelComponent_i.cxx,
  • src/SALOMESDS/SALOMESDS_KeyWaiter.cxx,
  • src/SALOMESDS/SALOMESDS_KeyWaiter.hxx,
  • src/SALOMETraceCollector/SALOMETraceCollector.cxx,
  • src/TestContainer/CMakeLists.txt:

Build and runtime fixes for macOS (clang, libc++, no glibc extensions). All the changes apply on macOS
only.

Threads: pthread_t is a pointer on macOS

Component_i.cxx, SALOME_ParallelComponent_i.cxx: _ThreadId > 0 is an ordered comparison of a
pointer with 0, rejected by clang. On macOS it is replaced by a non-null test and pthread_equal() in
Kill/Stop/Suspend/Resume/CpuUsed.

Semaphores: unnamed POSIX semaphores are not implemented

sem_init() fails on macOS. SALOMESDS::KeyWaiter and SALOMETraceCollector use a GCD
dispatch_semaphore_t instead. In SALOMETraceCollector, the semaphore of a previous instance is
released before a new one is created.

glibc-only functions

  • Container_i.cxx: the environment is read with *_NSGetEnviron() in GetOSEnvironment(), as
    environ is not available to dylibs.
  • SALOME_ExternalServerLauncher.cxx: get_current_dir_name() replaced by getcwd(nullptr, 0).

Calcium / DSC

  • CalciumC.c: clang rejects implicit function declarations. Added the C prototypes of the ecp_*
    functions defined in C++ by CALCIUM_C2CPP_INTERFACE_CXX_.
  • calcium.i: explicit PyArrayObject* cast in array_type().

Link

TestContainer: the libraries already linked on Windows are also linked on macOS, where dylibs must
resolve all their symbols at link time.

Depends on SalomePlatform/salome_bootstrap#3 (BaseTraceCollector::_sem as a dispatch_semaphore_t).

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