From b299694ca0f466ee95efbd673fe6cd114533a0c6 Mon Sep 17 00:00:00 2001 From: Dirk Olbrich Date: Tue, 13 Sep 2022 18:06:08 +0200 Subject: [PATCH] doc: library flags for macos build --- README.md | 6 ++++-- src/ifcopenshell-python/docs/ifcopenshell/installation.rst | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 22eca488ef..b3b472ba2b 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,8 @@ $ git clone --recurse-submodules https://github.com/IfcOpenShell/IfcOpenShell.gi ```{shell} $ cd /path/to/IfcOpenShell $ mkdir build && cd build +# set library flags +$ export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress" $ cmake ../cmake -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.10 \ -DPYTHON_LIBRARY=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib \ @@ -195,8 +197,8 @@ $ cmake ../cmake -DHDF5_LIBRARY_DIR=/opt/homebrew/lib/ \ -DHDF5_INCLUDE_DIR=/opt/homebrew/include/ \ -DCOLLADA_SUPPORT=0 -# Replace X with number of CPU cores, which you can get with sysctl -n hw.ncpu -$ make -j X +# `sysctl -n hw.ncpu` returns the number of cpu cores on macOS +$ make -j$(sysctl -n hw.ncpu) ``` Note: Make sure to compile using the XCode provided Apple Clang compiler, installed with `xcode-select --install diff --git a/src/ifcopenshell-python/docs/ifcopenshell/installation.rst b/src/ifcopenshell-python/docs/ifcopenshell/installation.rst index cb58924a96..33ac16898e 100644 --- a/src/ifcopenshell-python/docs/ifcopenshell/installation.rst +++ b/src/ifcopenshell-python/docs/ifcopenshell/installation.rst @@ -188,6 +188,8 @@ GCC (4.7 or newer) or Clang (any version) is required. $ cd /path/to/IfcOpenShell $ mkdir build && cd build + # set library flags + $ export LDFLAGS="$LDFLAGS -Wl,-flat_namespace,-undefined,suppress" $ cmake ../cmake -DPYTHON_EXECUTABLE=/opt/homebrew/bin/python3.10 \ -DPYTHON_LIBRARY=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/lib/libpython3.10.dylib \ @@ -200,8 +202,8 @@ GCC (4.7 or newer) or Clang (any version) is required. -DHDF5_LIBRARY_DIR=/opt/homebrew/lib/ \ -DHDF5_INCLUDE_DIR=/opt/homebrew/include/ \ -DCOLLADA_SUPPORT=0 \ - # Replace X with number of CPU cores, which you can get with sysctl -n hw.ncpu - $ make -j X + # `sysctl -n hw.ncpu` returns the number of cpu cores on macOS + $ make -j$(sysctl -n hw.ncpu) Compiling on Windows (Visual Studio) ------------------------------------