How to build on macOS ARM?

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: How to build on macOS ARM?

Post by chennes »

I don't know that it is much help, but that file loads fine for me:

Code: Select all

OS: macOS 13.2
Word size of FreeCAD: 64-bit
Version: 0.21.0.31821 (Git)
Build type: Release
Branch: refactorDataSource
Hash: e52f7aac17685e7543200afd46079c1997743a08
Python 3.10.9, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.5, OCC 7.6.3
Locale: English/United States (en_US)
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5534
Joined: Thu Apr 05, 2018 5:15 pm

Re: How to build on macOS ARM?

Post by adrianinsaval »

could this be related too? viewtopic.php?t=76479
oursland
Posts: 55
Joined: Sat Mar 11, 2023 9:33 pm

Re: How to build on macOS ARM?

Post by oursland »

I do not believe it's a python mismatch as I am operating in the conda environment for all operations, build, test, and debug.

I managed to get LLDB attached after downgrading openssl (current conda version causes an invalid instruction). The issue is triggered when attempting to read an integer from the iostream at the end of the BRep file. The integer is the last component of the BRep file as a part of the ShapeSet.

Not only am I encountering an exception when attempting to read a file, I am also getting a bad access error when attempting to write to a new file.

Code: Select all

(lldb) c
Process 24310 resuming
2023-03-16 10:11:56.547660-0700 FreeCAD[24310:11488514] +[CATransaction synchronize] called within transaction
Process 24310 stopped
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
    frame #0: 0x000000019e34d09c libc++.1.dylib`std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_signed<long>(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, long&) const + 68
libc++.1.dylib`std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::__do_get_signed<long>:
->  0x19e34d09c <+68>: ldr    w8, [x3, #0x8]
    0x19e34d0a0 <+72>: mov    w9, #0x4a
    0x19e34d0a4 <+76>: ands   w8, w8, w9
    0x19e34d0a8 <+80>: str    x5, [sp, #0x10]
Target 0: (FreeCAD) stopped.
When looking into what may be causing the issue, I again encounter an iostream issue:

Code: Select all

(lldb) up
frame #2: 0x0000000297ad0330 Sketcher.so`Sketcher::PropertyConstraintList::Save(this=0x000000010dba18a0, writer=0x000000016fdf8fb8) const at PropertyConstraintList.cpp:306:67
   303 
   304  void PropertyConstraintList::Save(Writer &writer) const
   305  {
-> 306      writer.Stream() << writer.ind() << "<ConstraintList count=\"" << getSize() <<"\">" << endl;
   307      writer.incInd();
   308      for (int i = 0; i < getSize(); i++)
   309          _lValueList[i]->Save(writer);
LLDB highlights the << getSize() as the source of the error.

I am quite confused now. I would suspect a possible locale issue, but OCCT is quite explicit throughout in setting the locale to std::locale::classic() as seen here: https://git.dev.opencascade.org/gitweb/ ... ac855#l597

I have been working with @JohnOCFII on Discord to try and get the compile to work, but he's encountering the same issue. It's a real bummer I cannot get Homebrew to build the dependencies, but also that conda produces a build that's broken. I think I may have to return to Linux for development if there are no obvious solutions.
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: How to build on macOS ARM?

Post by chennes »

Which Homebrew dependency are you currently stuck on?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
oursland
Posts: 55
Joined: Sat Mar 11, 2023 9:33 pm

Re: How to build on macOS ARM?

Post by oursland »

Starting from a freshly tapped freecad/freecad here's what I encounter:

Code: Select all

~/code$ brew install --only-dependencies freecad    
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%
Warning: Treating freecad as a formula. For the cask, use homebrew/cask/freecad
==> Fetching dependencies for freecad/freecad/freecad@0.20.1: freecad/freecad/swig@4.0.2, freecad/freecad/med-file, freecad/freecad/shiboken2@5.15.5, freecad/freecad/pyside2@5.15.5, and orocos-kdl
==> Fetching freecad/freecad/swig@4.0.2
==> Downloading https://downloads.sourceforge.net/project/swig/swig/swig-4.0.2/swig-4.0.2.tar.gz
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/89a36233d09f4573b4852efcc11df24c023ab61977b369cd2a59a964df95e132--swig-4.0.2.tar.gz
==> Fetching freecad/freecad/med-file@4.1.1
==> Downloading https://raw.githubusercontent.com/archlinux/svntogit-community/458b52e0d43ebbcf67f9025aad66c76454573a06/trunk/hdf5-1.12.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/1bedb86bef42de206c897730e953c014c727d5c52c55f4354fdb56d681d31ca5--hdf5-1.12.patch
==> Downloading https://files.salome-platform.org/Salome/other/med-4.1.1.tar.gz
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7dcf99218d0dc407132afdc6ebe9e83793e2808f13744a3cb004cb0bbc8335c8--med-4.1.1.tar.gz
==> Fetching freecad/freecad/shiboken2@5.15.5
==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken-numpy-1.23.compat.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/ed6d1a59a76d10fd011fc6a95bd26ef96d7d91262ac5666e48592f259e6259ab--libshiboken-numpy-1.23.compat.patch
==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken2-python10-compat.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/35da8d9458288cd8048d657eebe1815741c26d6750ab2f8a9edf499244351925--libshiboken2-python10-compat.patch
==> Downloading https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.5-src/pyside-setup-opensource-src-5.15.5.zip
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7e478bd63671464e429850a09bc66eeda44c95ddd8ab0b66cfc8224ffd477cc9--pyside-setup-opensource-src-5.15.5.zip
==> Fetching freecad/freecad/pyside2@5.15.5
==> Downloading https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.5-src/pyside-setup-opensource-src-5.15.5.zip
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7e478bd63671464e429850a09bc66eeda44c95ddd8ab0b66cfc8224ffd477cc9--pyside-setup-opensource-src-5.15.5.zip
==> Fetching orocos-kdl
==> Downloading https://ghcr.io/v2/homebrew/core/orocos-kdl/manifests/1.5.1
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/c3dace39ce0285564caf38a41219e45e00d574ba10a3bf22adcb42857cda7c56--orocos-kdl-1.5.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/orocos-kdl/blobs/sha256:49449b3bff3c05cad2d5ba7d7271d86a9b76a32ac0272e88a7544abc080c1e72
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/f16672e5a47c035c2f3b079692c7d1f8dc41761735c1c536ef0f774fe75a2e06--orocos-kdl--1.5.1.arm64_ventura.bottle.tar.gz
==> Installing freecad@0.20.1 from freecad/freecad
==> Installing dependencies for freecad/freecad/freecad@0.20.1: freecad/freecad/swig@4.0.2, freecad/freecad/med-file, freecad/freecad/shiboken2@5.15.5, freecad/freecad/pyside2@5.15.5, and orocos-kdl
==> Installing freecad/freecad/freecad@0.20.1 dependency: freecad/freecad/swig@4.0.2
==> ./configure --prefix=/opt/homebrew/Cellar/swig@4.0.2/4.0.2_2
==> make
==> make install
🍺  /opt/homebrew/Cellar/swig@4.0.2/4.0.2_2: 727 files, 5.5MB, built in 19 seconds
==> Installing freecad/freecad/freecad@0.20.1 dependency: freecad/freecad/med-file
==> Patching
==> Applying hdf5-1.12.patch
patching file 'config/cmake_files/medMacros.cmake'
patching file 'src/ci/MEDfileCompatibility.c'
patching file 'src/hdfi/_MEDattributeNumWrByName.c'
patching file 'src/hdfi/_MEDattributeNumWr.c'
patching file 'src/hdfi/_MEDcheckAttributeStringFunc.c'
patching file 'src/hdfi/_MEDchecknSublinkFunc.c'
patching file 'src/hdfi/_MEDdatagroupExist.c'
patching file 'src/hdfi/_MEDdatasetExist.c'
patching file 'src/hdfi/_MEDfileCreate.c'
patching file 'src/hdfi/_MEDfileOpen.c'
patching file 'src/hdfi/_MEDlinkObjs.c'
patching file 'src/hdfi/_MEDmemFileOpen.c'
patching file 'src/hdfi/_MEDparFileCreate.c'
patching file 'src/hdfi/_MEDparFileOpen.c'
patching file 'tools/medimport/2.3.6/_MEDconvertStringDatasets.c'
==> cmake .. -DMEDFILE_BUILD_PYTHON=ON -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/hdf5/lib;/opt/homebrew/opt/gcc/lib -DCMAKE_INSTALL_RPATH=@loader_path/../lib
==> make
Last 15 lines from /Users/jso/Library/Logs/Homebrew/med-file@4.1.1/02.make:
[ 96%] Linking C executable mdump2
cd /tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/tools/mdump && /opt/homebrew/Cellar/cmake/3.26.0/bin/cmake -E cmake_link_script CMakeFiles/mdump2.dir/link.txt --verbose=1
cd /tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/tools/medimport && /opt/homebrew/Cellar/cmake/3.26.0/bin/cmake -E cmake_symlink_library libmedimport.0.4.0.dylib libmedimport.0.dylib libmedimport.dylib
/opt/homebrew/Library/Homebrew/shims/mac/super/clang -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mdump2.dir/mdump2.c.o CMakeFiles/mdump2.dir/MED23meshIterators.c.o CMakeFiles/mdump2.dir/MED23fieldIterators.c.o -o mdump2  -Wl,-rpath,/tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/src ../../src/libmedC.11.1.1.dylib /opt/homebrew/opt/hdf5/lib/libhdf5.dylib /opt/homebrew/lib/libsz.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libdl.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libm.tbd 
[ 96%] Built target medimportengine
[ 96%] Linking C executable mdump4
cd /tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/tools/mdump && /opt/homebrew/Cellar/cmake/3.26.0/bin/cmake -E cmake_link_script CMakeFiles/mdump4.dir/link.txt --verbose=1
[ 96%] Linking C executable mdump3
cd /tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/tools/mdump && /opt/homebrew/Cellar/cmake/3.26.0/bin/cmake -E cmake_link_script CMakeFiles/mdump3.dir/link.txt --verbose=1
/opt/homebrew/Library/Homebrew/shims/mac/super/clang -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mdump4.dir/mdump4.c.o CMakeFiles/mdump4.dir/MED23meshIterators.c.o CMakeFiles/mdump4.dir/MED23fieldIterators.c.o -o mdump4  -Wl,-rpath,/tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/src ../../src/libmedC.11.1.1.dylib /opt/homebrew/opt/hdf5/lib/libhdf5.dylib /opt/homebrew/lib/libsz.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libdl.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libm.tbd 
/opt/homebrew/Library/Homebrew/shims/mac/super/clang -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/mdump3.dir/mdump3.c.o CMakeFiles/mdump3.dir/MED23meshIterators.c.o CMakeFiles/mdump3.dir/MED23fieldIterators.c.o -o mdump3  -Wl,-rpath,/tmp/med-fileA4.1.1-20230316-83264-bgy2sx/med-4.1.1_SRC/build/src ../../src/libmedC.11.1.1.dylib /opt/homebrew/opt/hdf5/lib/libhdf5.dylib /opt/homebrew/lib/libsz.dylib /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libz.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libdl.tbd /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/lib/libm.tbd 
[ 96%] Built target mdump2
[ 96%] Built target mdump4
[ 96%] Built target mdump3
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/freecad/homebrew-freecad/issues

These open issues may also help:
installing 0.20.1 on Apple M1 (errors installing med-file@4.1.1) https://github.com/FreeCAD/homebrew-freecad/issues/374
However, there appears to be an issue and workaround for med-file@4.1.1 noted here: https://github.com/FreeCAD/homebrew-freecad/issues/374

When I follow these steps I encounter the following issue:

Code: Select all

~/code$ cd /opt/homebrew/Library/Taps/freecad/homebrew-freecad 

~/code$ git fetch origin pull/375/head:issue.374
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), 1.00 KiB | 205.00 KiB/s, done.
From https://github.com/freecad/homebrew-freecad
 * [new ref]         refs/pull/375/head -> issue.374

/opt/homebrew/Library/Taps/freecad/homebrew-freecad$ git switch issue.374
Switched to branch 'issue.374'

/opt/homebrew/Library/Taps/freecad/homebrew-freecad$ brew install --only-dependencies freecad               
Warning: Treating freecad as a formula. For the cask, use homebrew/cask/freecad
==> Fetching dependencies for freecad/freecad/freecad@0.20.1: freecad/freecad/med-file, freecad/freecad/shiboken2@5.15.5, freecad/freecad/pyside2@5.15.5, and orocos-kdl
==> Fetching freecad/freecad/med-file@4.1.1
==> Downloading https://raw.githubusercontent.com/archlinux/svntogit-community/458b52e0d43ebbcf67f9025aad66c76454573a06/trunk/hdf5-1.12.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/1bedb86bef42de206c897730e953c014c727d5c52c55f4354fdb56d681d31ca5--hdf5-1.12.patch
==> Downloading https://files.salome-platform.org/Salome/other/med-4.1.1.tar.gz
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7dcf99218d0dc407132afdc6ebe9e83793e2808f13744a3cb004cb0bbc8335c8--med-4.1.1.tar.gz
==> Fetching freecad/freecad/shiboken2@5.15.5
==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken-numpy-1.23.compat.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/ed6d1a59a76d10fd011fc6a95bd26ef96d7d91262ac5666e48592f259e6259ab--libshiboken-numpy-1.23.compat.patch
==> Downloading https://raw.githubusercontent.com/FreeCAD/homebrew-freecad/8944b8b362c7fd87c515efb07eb0fb022e946610/patches/libshiboken2-python10-compat.patch
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/35da8d9458288cd8048d657eebe1815741c26d6750ab2f8a9edf499244351925--libshiboken2-python10-compat.patch
==> Downloading https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.5-src/pyside-setup-opensource-src-5.15.5.zip
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7e478bd63671464e429850a09bc66eeda44c95ddd8ab0b66cfc8224ffd477cc9--pyside-setup-opensource-src-5.15.5.zip
==> Fetching freecad/freecad/pyside2@5.15.5
==> Downloading https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.5-src/pyside-setup-opensource-src-5.15.5.zip
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/7e478bd63671464e429850a09bc66eeda44c95ddd8ab0b66cfc8224ffd477cc9--pyside-setup-opensource-src-5.15.5.zip
==> Fetching orocos-kdl
==> Downloading https://ghcr.io/v2/homebrew/core/orocos-kdl/manifests/1.5.1
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/c3dace39ce0285564caf38a41219e45e00d574ba10a3bf22adcb42857cda7c56--orocos-kdl-1.5.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/orocos-kdl/blobs/sha256:49449b3bff3c05cad2d5ba7d7271d86a9b76a32ac0272e88a7544abc080c1e72
Already downloaded: /Users/jso/Library/Caches/Homebrew/downloads/f16672e5a47c035c2f3b079692c7d1f8dc41761735c1c536ef0f774fe75a2e06--orocos-kdl--1.5.1.arm64_ventura.bottle.tar.gz
==> Installing freecad@0.20.1 from freecad/freecad
==> Installing dependencies for freecad/freecad/freecad@0.20.1: freecad/freecad/med-file, freecad/freecad/shiboken2@5.15.5, freecad/freecad/pyside2@5.15.5, and orocos-kdl
==> Installing freecad/freecad/freecad@0.20.1 dependency: freecad/freecad/med-file
==> Patching
==> Applying hdf5-1.12.patch
patching file 'config/cmake_files/medMacros.cmake'
patching file 'src/ci/MEDfileCompatibility.c'
patching file 'src/hdfi/_MEDattributeNumWrByName.c'
patching file 'src/hdfi/_MEDattributeNumWr.c'
patching file 'src/hdfi/_MEDcheckAttributeStringFunc.c'
patching file 'src/hdfi/_MEDchecknSublinkFunc.c'
patching file 'src/hdfi/_MEDdatagroupExist.c'
patching file 'src/hdfi/_MEDdatasetExist.c'
patching file 'src/hdfi/_MEDfileCreate.c'
patching file 'src/hdfi/_MEDfileOpen.c'
patching file 'src/hdfi/_MEDlinkObjs.c'
patching file 'src/hdfi/_MEDmemFileOpen.c'
patching file 'src/hdfi/_MEDparFileCreate.c'
patching file 'src/hdfi/_MEDparFileOpen.c'
patching file 'tools/medimport/2.3.6/_MEDconvertStringDatasets.c'
==> cmake .. -DMEDFILE_BUILD_PYTHON=ON -DMEDFILE_BUILD_TESTS=OFF -DMEDFILE_INSTALL_DOC=OFF -DPYTHON_EXECUTABLE=/opt/homebrew/opt/python@3.10/bin/python3.10" -DPYTHON_LIBRARY=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/Current/lib/libpython3.10.dylib -DCMAKE_PREFIX_PATH=/op
==> make
==> make install
🍺  /opt/homebrew/Cellar/med-file@4.1.1/4.1.1: 105 files, 9.7MB, built in 29 seconds
==> Installing freecad/freecad/freecad@0.20.1 dependency: freecad/freecad/shiboken2@5.15.5
==> Patching
==> Applying libshiboken-numpy-1.23.compat.patch
patching file 'sources/shiboken2/libshiboken/sbknumpyarrayconverter.cpp'
==> Applying libshiboken2-python10-compat.patch
patching file 'sources/shiboken2/libshiboken/pep384impl.cpp'
==> cmake -DCMAKE_PREFIX_PATH=/opt/homebrew/opt/qt@5/lib -DPYTHON_EXECUTABLE=/opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/bin/python3 -DCMAKE_INSTALL_RPATH=/opt/homebrew/Cellar/shiboken2@5.15.5/5.15.5_1/lib ../sources/shiboken2
Last 15 lines from /Users/jso/Library/Logs/Homebrew/shiboken2@5.15.5/01.cmake:
-- Check for working CXX compiler: /opt/homebrew/Library/Homebrew/shims/mac/super/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using Qt 5
-- Found PythonInterp: /opt/homebrew/opt/python@3.10/Frameworks/Python.framework/Versions/3.10/bin/python3  
-- Found PythonLibs: /opt/homebrew/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/lib/libpython3.11.dylib (found version "3.11.2") 
-- PYTHON_ARCH:             
-- CLANG: /opt/homebrew/opt/llvm, /opt/homebrew/opt/llvm/lib/libclang.dylib detected by LLVM_INSTALL_DIR
-- Looking for C++ include clang-c/Index.h
-- Looking for C++ include clang-c/Index.h - found
CMake Error at CMakeLists.txt:51 (message):
  Could not identify shiboken version.  Error:


-- Configuring incomplete, errors occurred!

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
  https://github.com/freecad/homebrew-freecad/issues
Currently I am stuck at building shiboken2. This failure persists if I return the freecad/freecad tap back to the master branch.
oursland
Posts: 55
Joined: Sat Mar 11, 2023 9:33 pm

Re: How to build on macOS ARM?

Post by oursland »

The primary issue preventing the builds of the freecad/freecad tap comes down to the fact that Homebrew has long since upgraded to Python 3.11 AND CMake 3.26.0. Consequently, the build scripts that assumes python3 is Python 3.10 and that PYTHON_EXECUTABLE controls the CMake FindPython script, both assumptions which are no longer valid.

After correcting these, I began encountering issues in which Homebrew dependencies such as boost-python3 have since migrated to Python 3.11 and no longer support Python 3.10.
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: How to build on macOS ARM?

Post by chennes »

Yeah, I had to manually downgrade boost and boost-python3, if I recall correctly. I had to scrounge through the boost-python git repo to find where they upgraded to Python 3.11, then manually check out the commit before that and turn it into a package in the freecad/freecad tap.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: How to build on macOS ARM?

Post by chennes »

I'm attaching the three scripts that I can remember having to doctor to get things working for me: these are a month or so old now, I am not sure if they are adequate (and I'm using cMake 3.24). I had to add the txt extension to make the phpbb happy.
Attachments
elmer.rb.txt
(2.72 KiB) Downloaded 26 times
boost-python3.rb.txt
(4.25 KiB) Downloaded 27 times
boost.rb.txt
(3.61 KiB) Downloaded 26 times
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3868
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: How to build on macOS ARM?

Post by chennes »

Maybe this one too (or maybe this one instead of Elmer?)...
Attachments
med-file@4.1.1.rb.txt
(2.18 KiB) Downloaded 32 times
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
oursland
Posts: 55
Joined: Sat Mar 11, 2023 9:33 pm

Re: How to build on macOS ARM?

Post by oursland »

Thank you! I'll give these a shot.

I'm going to continue with trying to debug the issue with BRep files being read incorrectly in conda with the aim to get Apple Silicon into the weekly builds.
Post Reply