anybody have this working: brew install --HEAD freecad --with-macos-app

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
stepheneb
Posts: 15
Joined: Wed Mar 10, 2021 12:52 am

anybody have this working: brew install --HEAD freecad --with-macos-app

Post by stepheneb »

Am trying to build and install the latest version of FreeCad on macOs 11.6.1 using the homebrew formula.

Code: Select all

brew install --HEAD freecad  --with-macos-app
There is an error reported trying to use/integrate boost_python in BoostConfig.cmake

The issue is described here: https://github.com/FreeCAD/homebrew-freecad/issues/237

Just a bit earlier in the console outputI'm seeing this warning:

Code: Select all

Warning: Use freecad/freecad/python@3.9.6 instead of deprecated python3.9
stepheneb
Posts: 15
Joined: Wed Mar 10, 2021 12:52 am

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by stepheneb »

I've gotten farther

seems to perhaps be related to: fatal error finding OpenGL: 'GL/gl.h' file not found:

Code: Select all

$ brew install freecad --HEAD --with-macos-app --build-from-source --verbose --debug
...
file: freecad/Build/CMakeFiles/CMakeError.log

Code: Select all

$ cat ~/Library/Logs/Homebrew/freecad/Build/CMakeFiles/CMakeError.log 
Determining if the include file GL/gl.h exists failed with the following output:
Change Dir: /tmp/freecad-20211102-5104-1d8whyz/Build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/local/Homebrew/Library/Homebrew/shims/mac/super/gmake -f Makefile cmTC_03b51/fast && /Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_03b51.dir/build.make CMakeFiles/cmTC_03b51.dir/build
Building C object CMakeFiles/cmTC_03b51.dir/CheckIncludeFile.c.o
/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -MD -MT CMakeFiles/cmTC_03b51.dir/CheckIncludeFile.c.o -MF CMakeFiles/cmTC_03b51.dir/CheckIncludeFile.c.o.d -o CMakeFiles/cmTC_03b51.dir/CheckIncludeFile.c.o -c /tmp/freecad-20211102-5104-1d8whyz/Build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/tmp/freecad-20211102-5104-1d8whyz/Build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
         ^~~~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_03b51.dir/CheckIncludeFile.c.o] Error 1
make: *** [cmTC_03b51/fast] Error 2
Updated the issue here:
https://github.com/FreeCAD/homebrew-fre ... -958382668
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by doia »

Are you using an Intel or MacSilicone machine?
Maybe instead of building directly from Homebrew source, try to fork the git repo and build via Cmake.
stepheneb
Posts: 15
Joined: Wed Mar 10, 2021 12:52 am

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by stepheneb »

Am now trying to build FreeCAD from source using the homebrew freecad formula to install dependencies.

Documented and more complete results here:
https://gist.github.com/stepheneb/9bb11 ... d438a3c155

Am now getting this error:

Code: Select all

[  7%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/BoundBoxPyImp.cpp.o
[  7%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Builder3D.cpp.o
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Builder3D.cpp:39:
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Tools.h:37:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/usr/local/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name
class QStringList;
      ^
/usr/local/include/QtCore/qcontainerfwd.h:64:7: note: 'QStringList' declared here
using QStringList = QList<QString>;
Here's the shell output running the cmake generation step:

Code: Select all

$ cmake   -DCMAKE_INSTALL_LIBDIR=lib   -DCMAKE_BUILD_TYPE="Release"   -DCMAKE_FIND_FRAMEWORK=LAST   -DCMAKE_VERBOSE_MAKEFILE=OFF   -Wno-dev   -DBUILD_TESTING=OFF   -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk   -DBUILD_QT5=ON   -DUSE_PYTHON3=1   -DCMAKE_CXX_STANDARD=17   -DBUILD_ENABLE_CXX_STD:STRING=C++17   -DBUILD_FEM_NETGEN=1   -DBUILD_FEM=1   -DBUILD_FEM_NETGEN:BOOL=ON   -DBUILD_WEB=ON   -DFREECAD_USE_EXTERNAL_KDL=ON   -DPYTHON_EXECUTABLE=/usr/local/opt/python@3.9/bin/python3   -DPYTHON_INCLUDE_DIR=/usr/local/opt/python@3.9/Frameworks/Python.framework/Headers   -DCMAKE_PREFIX_PATH="$PREFIX_PATH"   -DFREECAD_CREATE_MAC_APP=1   -DCMAKE_INSTALL_PREFIX="./.."   ../FreeCAD
-- Compiler: AppleClang, version: 13.0.0.13000029
-- Force BOOST_PP_VARIADICS=1 for clang
-- prefix: /Users/stephen/dev/freecad
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib
-- cmake: 3.21.4
-- Detected Homebrew install at /usr/local
-- PyCXX found:
--   Headers:  /Users/stephen/dev/freecad/FreeCAD/src
--   Sources:  /Users/stephen/dev/freecad/FreeCAD/src/CXX
--   Version:  6.2.8
-- -- Found OCE/OpenCASCADE version: 7.5.0
-- -- OCE/OpenCASCADE include directory: /usr/local/opt/opencascade@7.5.0/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /usr/local/opt/opencascade@7.5.0/lib
-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType;vtkRenderingOpenGL2
-- Check for medfile (libmed and libmedc) ...
-- We guess that libmed was built using hdf5-serial version
-- Checking for one of the modules 'hdf5-serial'
-- Found Boost: /usr/local/opt/boost@1.75.0/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found suitable version "1.75.0", minimum required is "1.55") found components: filesystem program_options regex system thread date_time 
-- Found Netgen: /usr/local/opt/nglib/Contents/Resources/CMake
-- Found NETGEN version 6.2, calculated: 395829
-- Coin3D libraries found
-- Shiboken2Config: Using default python: .cpython-39-darwin
-- SHIBOKEN_PYTHON_INCLUDE_DIRS computed to value: '/usr/local/opt/python@3.9/Frameworks/Python.framework/Headers'
-- SHIBOKEN_PYTHON_LIBRARIES computed to value: '-undefined dynamic_lookup'
-- libshiboken built for Release
-- PYTHON_CONFIG_SUFFIX: .cpython-39-darwin
-- libshiboken built for Release
-- ===============================================
PySide2 Python module found at /usr/local/lib/python3.9/site-packages/PySide2.
===============================================

-- Found Matplotlib: /usr/local/lib/python3.9/site-packages/matplotlib (found version "3.3.3")
-- Platform is 64-bit, set -D_OCC64
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Found Boost: /usr/local/opt/boost@1.75.0/lib/cmake/Boost-1.75.0/BoostConfig.cmake (found version "1.75.0") found components: python39 
-- found Boost: 1_75
-- boost-incude dirs are: /usr/local/Cellar/boost@1.75.0/1.75.0_1/include
-- boost-python lib is: 
-- boost_LIBRARY_DIRS is: /usr/local/Cellar/boost@1.75.0/1.75.0_1/lib
-- Boost_LIBRARIES is: Boost::python
-- area module (for Path Workbench) will be installed to: /Users/stephen/dev/freecad/FreeCAD.app/Contents/lib
-- Checking for module 'icu-uc'
--   No package 'icu-uc' found
-- 
==============
Summary report
==============

-- Build type:          Release
-- Compiler:            /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ (13.0.0.13000029)
-- Flags:               -Wall -Wextra -Wpedantic -Wno-write-strings  -Wno-undefined-var-template
-- Standard:            Requires C++17
-- Python:              3.9.7 [/usr/local/bin/python3.9] [.cpython-39-darwin]
-- PCL:                 not enabled
-- pybind11:            not enabled
-- Boost:               1.75.0 (1.75.0)
-- XercesC:             3.2.3 [/usr/local/lib/libxerces-c.dylib] [/usr/local/include]
-- ZLIB:                1.2.11
-- PyCXX:               6.2.8 [/Users/stephen/dev/freecad/FreeCAD/src]
-- OCC:                 7.5.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP;TKHLR;TKFeat] [/usr/local/opt/opencascade@7.5.0/lib] [/usr/local/opt/opencascade@7.5.0/include/opencascade]
-- SMESH:               build internal
--  MEDFile:            4.0.0 [/usr/local/lib/libmedC.dylib;/usr/local/lib/libmed.dylib] [/usr/local/include]
--  HDF5:               1.12.1
--  VTK:                8.2.0
-- NETGEN:              6.2.2101 (6.2.2101) [-DNO_PARALLEL_THREADS;-DOCCGEOMETRY;-DNETGEN_VERSION=395829] [] [/usr/local/opt/nglib/Contents/Resources/include/include;/usr/local/opt/nglib/Contents/Resources/include] [nglib] [/usr/local/opt/nglib/Contents/Resources/include/include;/usr/local/opt/nglib/Contents/Resources/include]
-- SWIG:                4.0.2
-- Eigen3               3.4.0
-- Qt5Core:             5.15.2
-- Qt5Network:          5.15.2
-- Qt5Xml:              5.15.2
-- Qt5XmlPatterns:      5.15.2
-- Qt5Widgets:          5.15.2
-- Qt5PrintSupport:     5.15.2
-- Qt5OpenGL:           5.15.2
-- Qt5Svg:              5.15.2
-- Qt5UiTools:          5.15.2
-- Qt5Concurrent:       5.15.2
-- Qt5WebEngineWidgets: 5.15.2
-- Shiboken2:           5.15.2 [/usr/local/opt/shiboken2/lib/cmake/Shiboken2-5.15.2] [/usr/local/opt/shiboken2/include/shiboken2;/usr/local/opt/python@3.9/Frameworks/Python.framework/Headers]
-- PySide2:             5.15.2 [/usr/local/opt/pyside2/include/PySide2]
-- PySide2Tools:        [/usr/local/bin/uic] [/usr/local/bin/rcc]
-- Freetype:            2.11.0
-- OpenGL:              /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework
-- OpenGLU:             [/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework][/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework]
-- Coin3D:              4.0.0 [/usr/local/opt/coin@4.0.0/lib/libCoin.dylib] [/usr/local/opt/coin@4.0.0/include]
-- Pivy:                0.6.5
-- SPNAV:               [/usr/local/lib/libspnav.dylib] [/usr/local/include]
-- Matplotlib:          3.3.3
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             1.9.2
--  Language:           English
--  Coin3D_DOC:         not found
=================================================
Now run 'cmake --build /Users/stephen/dev/freecad/freecad-build' to build FreeCAD
=================================================

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/stephen/dev/freecad/freecad-build
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by doia »

You need to set the PATH to find the QT library.

This is my current setup to compile for macOS Big Sur on an Intel machine, which works fine so far. Will test on M1Max mid of December :D

Code: Select all

# create a FreeCAD folder which holds all source and build code
mkdir -p FreeCAD
cd FreeCAD

# clone the FreeCAD source code from Github
git clone https://github.com/FreeCAD/FreeCAD.git freecad-source

# install freecad dependencies via homebrew
brew tap freecad/freecad
brew install eigen
brew install --only-dependencies freecad --with-packaging-utils

# setup the build folder (eventually split into release and debug folder)
mkdir -p freecad-build

# change into the freecad build folder
cd freecad-build

# export path to installed dependencies
# here additional paths to the wiki page have to be defined
export PREFIX_PATH="\
/usr/local/opt/qt5152/lib/cmake;\
/usr/local/opt/nglib/Contents/Resources;\
/usr/local/opt/vtk@8.2.0/lib/cmake;\
/usr/local/opt/opencascade@7.5.0/lib/cmake;\
/usr/local/opt/med-file/share/cmake;\
/usr/local/opt/shiboken2/lib/cmake;\
/usr/local/opt/pyside2/lib/cmake;\
/usr/local/opt/coin@4.0.0;\
/usr/local/opt/boost@1.75.0/lib/cmake;\
/usr/local/opt/boost-python3@1.75.0/lib/cmake"

# build for Release version
# change to -DCMAKE_BUILD_TYPE="Debug" for debug version
# on macOS ARM change -DBUILD_WEB to OFF
cmake \
  -DCMAKE_INSTALL_LIBDIR=lib \
  -DCMAKE_BUILD_TYPE="Release" \
  -DCMAKE_FIND_FRAMEWORK=LAST \
  -DCMAKE_VERBOSE_MAKEFILE=OFF \
  -Wno-dev \
  -DBUILD_TESTING=OFF \
  -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
  -DBUILD_FEM=1 \
  -DBUILD_FEM_NETGEN=1 \
  -DBUILD_WEB=ON \
  -DFREECAD_USE_EXTERNAL_KDL=ON \
  -DPYTHON_EXECUTABLE=/usr/local/opt/python@3.9/bin/python3 \
  -DPYTHON_INCLUDE_DIR=/usr/local/opt/python@3.9/Frameworks/Python.framework/Headers \
  -DCMAKE_PREFIX_PATH="$PREFIX_PATH" \
  -DFREECAD_CREATE_MAC_APP=1 \
  -DCMAKE_INSTALL_PREFIX="./.." \
  ../freecad-source

# see https://forum.freecadweb.org/viewtopic.php?p=507588#p507588 for path to icu@67.1
# set before building
export LIBRARY_PATH="/usr/local/opt/icu4c@67.1/lib"
stepheneb
Posts: 15
Joined: Wed Mar 10, 2021 12:52 am

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by stepheneb »

I've now got it compiling without errors using the homebrew freecad tap formula with the changes in this pull request:

https://github.com/FreeCAD/homebrew-freecad/pull/264

Am getting this error after compiling when packaging the app:

Code: Select all

-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Sketcher_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Start_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/TechDraw_Colors.cfg
-- Installing: /usr/local/Cellar/freecad/HEAD-8527cab/FreeCAD.app/Contents/share/Gui/PreferencePackTemplates/Window_Colors.cfg
CMake Error at src/MacAppBundle/cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/tmp/freecad-20211115-25671-s2gnxp/src/MacAppBundle/import site": No such
  file or directory.
Call Stack (most recent call first):
  src/cmake_install.cmake:51 (include)
  cmake_install.cmake:68 (include)


make: *** [install] Error 1
/usr/local/Homebrew/Library/Homebrew/shims/shared/git --version
/usr/local/Homebrew/Library/Homebrew/shims/shared/curl --version
/usr/local/Homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise'
BuildError: Failed executing: make -j8 install
This issue is discussed here -- but I haven't yet figured out how to solve it in the formula.

- https://github.com/FreeCAD/homebrew-freecad/issues/163
- https://github.com/vejmarie/FreeCAD/com ... t-49953927
stepheneb
Posts: 15
Joined: Wed Mar 10, 2021 12:52 am

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by stepheneb »

Solved this problem:

Code: Select all

Make Error at src/MacAppBundle/cmake_install.cmake:55 (file):
  file INSTALL cannot find
  "/tmp/freecad-20211115-25671-s2gnxp/src/MacAppBundle/import site": No such
By only having sip@4.19.24 available.

Code: Select all

$ brew link --force sip@4.19.24
$ brew remove sip
Now I'm resolving errors Making bundle relocatable..:

Code: Select all

ERROR: Unable to find LC_DYLD_LOAD entry: @rpath/libc++abi.1.dylib
Changes to src/MacAppBundle/CMakeLists.txt I'm working with now:

Code: Select all

$ git diff
diff --git a/src/MacAppBundle/CMakeLists.txt b/src/MacAppBundle/CMakeLists.txt
index c0b6ccf09f..a795c30bce 100644
--- a/src/MacAppBundle/CMakeLists.txt
+++ b/src/MacAppBundle/CMakeLists.txt
@@ -83,7 +83,7 @@ endif(BUILD_QT5)
   install(FILES ${_pak_resolved_files} DESTINATION "${CMAKE_INSTALL_PREFIX}/")
 
   # add icudtl.dat
- 
+
   install(PROGRAMS "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/icudtl.dat" DESTINATION ${CMAKE_INSTALL_PREFIX}/)
        install(PROGRAMS "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/QtWebEngineCore.prl" DESTINATION ${CMAKE_INSTALL_PREFIX}/)
   endif(BUILD_WEB)
@@ -112,7 +112,7 @@ install(CODE "execute_process(COMMAND chmod -R a+w ${CMAKE_INSTALL_LIBDIR})")
 get_filename_component(APP_PATH ${CMAKE_INSTALL_PREFIX} PATH)
 
 execute_process(
-       COMMAND find /usr/local/Cellar/icu4c -name pkgconfig
+       COMMAND find /usr/local/Cellar/icu4c@67.1 -name pkgconfig
        RESULT_VARIABLE CMD_ERROR
        OUTPUT_VARIABLE CONFIG_ICU)
 set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CONFIG_ICU}")
@@ -123,13 +123,17 @@ execute_process(
        COMMAND find /usr/local/Cellar/nglib -name MacOS
        OUTPUT_VARIABLE CONFIG_NGLIB)
 
-install(CODE 
+execute_process(
+       COMMAND find /usr/local/Cellar/llvm -name lib
+       OUTPUT_VARIABLE CONFIG_LLVM)
+
+install(CODE
     "message(STATUS \"Making bundle relocatable...\")
     # The top-level CMakeLists.txt should prevent multiple package manager
     # prefixes from being set, so the lib path will resolve correctly...
     execute_process(
         COMMAND python2.7
         ${CMAKE_SOURCE_DIR}/src/Tools/MakeMacBundleRelocatable.py
-        ${APP_PATH} ${HOMEBREW_PREFIX}${MACPORTS_PREFIX}/lib ${ICU_PREFIX}/lib/ /usr/local/opt ${CONFIG_NGLIB} ${Qt5Core_DIR}/../../.. ${XCTEST_PATH} ${WEBKIT_FRAMEWORK_DIR}
+        ${APP_PATH} ${HOMEBREW_PREFIX}${MACPORTS_PREFIX}/lib ${ICU_PREFIX}/lib/ ${CONFIG_LLVM}/lib ${CONFIG_NGLIB} ${Qt5Core_DIR}/../../.. ${XCTEST_PATH} ${WEBKIT_FRAMEWORK_DIR}
     )"
 )

BUT ... even though I removed icu4c from brew and only have icu4c@67.1 installed MakeMacBundleRelocatable.py is still looking for /usr/local/opt/icu4c/lib/libicuuc.69.dylib

Code: Select all

-- Making bundle relocatable...
-- INFO: Analyzing bundle dependencies...
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: /usr/local/opt/icu4c/lib/libicuuc.69.dylib (No such file or directory)
-- ERROR: Failed to resolve dependency in /usr/local/opt/icu4c/lib/libicuuc.69.dylib
Traceback (most recent call last):
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 388, in <module>
    main()
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 371, in main
    build_deps_graph(graph, bundle_path, dir_filter, search_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 238, in build_deps_graph
    deps = create_dep_nodes(list_install_names(k2), s_paths)
  File "/Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py", line 111, in list_install_names
    output = check_output(["otool", "-L", path_macho])
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['otool', '-L', '/usr/local/opt/icu4c/lib/libicuuc.69.dylib']' returned non-zero exit status 1

Here's the last section of the generated cmake file src/MacAppBundle/cmake_install.cmake that's running this task:

Code: Select all

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  message(STATUS "Making bundle relocatable...")
    # The top-level CMakeLists.txt should prevent multiple package manager
    # prefixes from being set, so the lib path will resolve correctly...
    execute_process(
        COMMAND python2.7
        /Users/stephen/dev/freecad/FreeCAD/src/Tools/MakeMacBundleRelocatable.py
        /Users/stephen/dev/freecad/FreeCAD.app /usr/local/lib /usr/local/Cellar/icu4c@67.1/67.1_1/lib/ /usr/local/Cellar/llvm/13.0.0_1/lib
/usr/local/Cellar/llvm/13.0.0_1/lib/clang/13.0.0/lib
/usr/local/Cellar/llvm/13.0.0_1/Toolchains/LLVM13.0.0.xctoolchain/usr/lib
/usr/local/Cellar/llvm/13.0.0_1/Toolchains/LLVM13.0.0.xctoolchain/usr/lib/clang/13.0.0/lib
/lib /usr/local/Cellar/nglib/6.2.2101/Contents/MacOS
 /usr/local/opt/qt5152/lib/cmake/Qt5Core/../../.. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/Current 
    )
endif()
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by doia »

I think I found a weird reason for this bug:
stepheneb wrote: Thu Nov 11, 2021 5:45 am

Code: Select all

[  7%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Builder3D.cpp.o
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Builder3D.cpp:39:
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Tools.h:37:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/usr/local/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name
class QStringList;
      ^
/usr/local/include/QtCore/qcontainerfwd.h:64:7: note: 'QStringList' declared here
using QStringList = QList<QString>;
During one off my latest build I got the same error, even I did not change anything on the setup. But I had qt@5 and qt@6 (latest available version) installed at the same time, both via Homebrew. After deleting qt6 via brew uninstall qt the build went through.

So this must be some linking issue. Even qt@5 is specified as the to be used QT version (and recognized during cmake setup) the parallel installed qt@6 version seems to mess things up.
User avatar
ipatch
Posts: 112
Joined: Wed Apr 08, 2020 3:40 pm
Location: dfw
Contact:

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by ipatch »

doia wrote: Wed Jan 19, 2022 3:32 pm I think I found a weird reason for this bug:
stepheneb wrote: Thu Nov 11, 2021 5:45 am

Code: Select all

[  7%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Builder3D.cpp.o
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Builder3D.cpp:39:
In file included from /Users/stephen/dev/freecad/FreeCAD/src/Base/Tools.h:37:
In file included from /usr/local/opt/qt@5/lib/QtCore.framework/Headers/QString:1:
/usr/local/opt/qt@5/lib/QtCore.framework/Headers/qstring.h:78:7: error: definition of type 'QStringList' conflicts with type alias of the same name
class QStringList;
      ^
/usr/local/include/QtCore/qcontainerfwd.h:64:7: note: 'QStringList' declared here
using QStringList = QList<QString>;
During one off my latest build I got the same error, even I did not change anything on the setup. But I had qt@5 and qt@6 (latest available version) installed at the same time, both via Homebrew. After deleting qt6 via brew uninstall qt the build went through.

So this must be some linking issue. Even qt@5 is specified as the to be used QT version (and recognized during cmake setup) the parallel installed qt@6 version seems to mess things up.
pretty sure this error arises when multiple qt installations exist on a system. the quick fix for me was to unlink the homebrew-core installation of qt with

```
brew unlink qt
```

which bumped build along further not encountering this error. i'm sure mileage will vary as there's so many moving parts to building freecad. i also commented on the below github issue for somebody in came across this issue as well...

https://github.com/rohit-px2/nvui/issue ... 1179622358
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: anybody have this working: brew install --HEAD freecad --with-macos-app

Post by doia »

Yeah, brew unlink [formulae] usually suffices. No need to uninstall the package, as homebrew does a pretty good job in isolating installed packages.

Would be a cool feature of homebrew though to enable separate environments. brew env [xyz] and brew does all the work of unlinking and linking versioned formulaes. Kind of like Pythons virtualenv.
Post Reply