OSArch Community

Building IfcOpenShell on a Mac

  1. M

    I was going to take a stab at building IfcOpenShell from source on a Mac, but just wanted to check if anyone else has done this. On a quick glance, I've already found I'll need to find some alternate sources to build the dependencies (it doesn't look like all of them are on homebrew), so I was just curious if this has been done successfully before.

  2. M

    @mclare you're probably already aware that there are bot builds available for Mac (except for the arm chips) and have other reasons for wanting to build on a mac (contributing, perhaps? :) ) But I thought I'd mention it anyway.

  3. M

    Yep @Moult , I was trying to build for contributing, but ran into a snag at the tail end with my favorite compilation error: undefined symbol for architecture x86_64, which is happening when linking IfcConvert and `IfcGeomServer. I might not have the correct boost libraries installed (I've got whatever's the latest from brew, which is v1.76.0).

    I'm stumped on how I need to change the order of the build to get around the errors I'm getting here:

    https://github.com/IfcOpenShell/IfcOpenShell/issues/1740

  4. M

    Glad to see this is solved and I apologise I couldn't help.

  5. S

    My flow to use IfcOpenShell on Mac:

    Update Xcode developer tools

    Install Homebrew

    brew install cmake

    brew install opencascade

    Had to install OpenCollada from sources (download/clone, cmake + make + make install). In there, I had to tweak the GeneratedSaxParserUtils.cpp file to find std::isnan properly. Then added the necessary OPENCOLLADA_INCLUDE_DIR and ..._LIBRARY_DIR into my bash/zsh profile. I also had the problem that I temporarily had to remove PCRE during compilation.

    brew install icu4c

    brew install boost --with-icu4c

    Added the ICU bin and sbin folder to my $PATH

    brew install pcre

    brew install pkgconfig

    brew install python3

    brew install swig

    I also had to force C++11 in de CMAKE instructions.

    brew install libxml2

    Install JSON for Modern C++ header file (https://github.com/nlohmann/json)

    And finally my build string

    cmake -DOCC_INCLUDE_DIR=/usr/local/include/opencascade -DOCC_LIBRARY_DIR=/usr/local/lib -DOPENCOLLADA_INCLUDE_DIR=/usr/local/include/opencollada -DOPENCOLLADA_LIBRARY_DIR=/usr/local/lib/opencollada -DBUILD_IFCPYTHON=ON -DJSON_INCLUDE_DIR=/usr/local/include -DGLTF_SUPPORT=ON -DLIBXML2_LIBRARIES=/usr/local/opt/libxml2/lib/libxml2.dylib -DLIBXML2_INCLUDE_DIR=/usr/local/opt/libxml2/include/libxml2 -DIFCXML_SUPPORT=ON -DENABLE_BUILD_OPTIMIZATIONS=1 ../IfcOpenShell/cmake

    The rest just takes time

    make -j16

    sudo make install

    make clean

  6. S

    It was more involved when I also wanted the full PythonOCC support. That took some attempts, especially once homebrew updated opencascade beyond the latest supported version known to PythonOCC and removed the previous version completely.

  7. M

    @StefanBoeykens Thanks for the response! I managed to get it up and running with some trial and error using brew, similar to what you did. I would like to use my brew installed gcc compiler instead of XCode’s, but it got too far into the cmake hole to figure out how to manually override the compiler chosen.

Login or Register to reply.