PositionBasedDynamics icon indicating copy to clipboard operation
PositionBasedDynamics copied to clipboard

macOS compatibility (v1, for SPlisHSPlasH)

Open ruberith opened this issue 3 years ago • 0 comments

These adaptations allow builds using Clang on recent versions of macOS (tested on Apple silicon):

  • An updated and adapted version of Discregrid is used (see Discregrid#19). If the pull requests are accepted, CMakeLists.txt has to be updated to point to the original repository again.
  • Clang seems to mistake some version files for headers, so these are given an extension.
  • The optimization flag -mcpu=apple-m1 is used for Apple silicon, for which -march=native is not yet supported.
  • OpenGL is deprecated for years on macOS, but still supported, so the corresponding warnings are silenced.
  • _NSGetExecutablePath is used to find program paths on macOS.
  • Recent versions of CMake automatically determine the correct flags for OpenMP and provide a target to link against. Nevertheless, Clang does not include an OpenMP implementation on macOS by default, but the user can easily install a build of LLVM libomp (e.g. via Homebrew) to be shared by all projects requiring OpenMP which is then detected by CMake.

The changes are similar to those in #123, but based on the version of commit 67cea44, which is used and wrapped in SPlisHSPlasH. For this purpose, they could be pulled into a new branch.

ruberith avatar Apr 09 '22 10:04 ruberith

With commit 12bef59 updating the PBD version of SPlisHSPlasH to v2, this pull request becomes obsolete and is superseded by #123.

ruberith avatar Aug 29 '22 14:08 ruberith