Skip to content

Instantly share code, notes, and snippets.

@oogali
Last active December 4, 2025 19:16
Show Gist options
  • Select an option

  • Save oogali/16a4ccc3eaeef47c4e4b57ef72923063 to your computer and use it in GitHub Desktop.

Select an option

Save oogali/16a4ccc3eaeef47c4e4b57ef72923063 to your computer and use it in GitHub Desktop.
Build IfcOpenShell on MacOS M1 (arm64)
brew install boost swig cmake ftgl cgal gmp libaec ninja opencascade hdf5 python3 zlib
git clone git@github.com:IfcOpenShell/IfcOpenShell.git
cd IfcOpenShell/
git submodule init
git submodule update --recursive
mkdir build
cd build/
cmake -G Ninja \
../cmake \
-DOCC_INCLUDE_DIR=$(brew --prefix)/include/opencascade \
-DCOLLADA_SUPPORT=0 \
-DHDF5_INCLUDE_DIR=$(brew --prefix)/include \
-DHDF5_LIBRARY_DIR=$(brew --prefix)/lib \
-DPYTHON_EXECUTABLE=$(which python3) \
-DPYTHON_INCLUDE_DIR=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var; from os.path import join; print(join(get_config_var('LIBDIR'), 'libpython{}.dylib'.format(get_config_var('VERSION'))))") \
-DCGAL_INCLUDE_DIR=$(brew --prefix)/include \
-DGMP_INCLUDE_DIR=$(brew --prefix)/include \
-DGMP_LIBRARY_DIR=$(brew --prefix)/lib \
-DMPFR_INCLUDE_DIR=$(brew --prefix)/include \
-DMPFR_LIBRARY_DIR=$(brew --prefix)/lib \
-DZLIB_INCLUDE_DIR=$(brew --prefix)/opt/zlib/include \
-DZLIB_LIBRARY_DIR=$(brew --prefix)/opt/zlib/lib
cmake --build .
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index c8d69e4f..83356381 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -454,6 +454,7 @@ if(NOT MINIMAL_BUILD AND HDF5_SUPPORT)
# result of the HDF5 ctest package
# Find zlib using cmake find_library. How should this be implemented?
# FIND_LIBRARY(NAMES z libz libz_debug PATHS ... NO_DEFAULT_PATH)
+ FIND_PACKAGE(ZLIB)
if ("$ENV{CONDA_BUILD}" STREQUAL "")
@@ -473,9 +474,9 @@ if(NOT MINIMAL_BUILD AND HDF5_SUPPORT)
SET(HDF5_LIBRARIES
"${HDF5_LIBRARY_DIR}/libhdf5_cpp${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libhdf5${debug_postfix}.${lib_ext}"
- "${HDF5_LIBRARY_DIR}/libz${zlib_post}${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}"
"${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}"
+ "${ZLIB_LIBRARY_DIR}/libz${debug_postfix}.${lib_ext}"
)
ELSE()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment