Mac build and python C API

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Mac build and python C API

Post by doia »

FreddyFreddy wrote: Sun Jul 10, 2022 3:54 am Did you look at https://forum.freecadweb.org/viewtopic.php?f=4&t=69923
I think the Py_complex and Py_UNICODE errors are a different issue from the above mentioned QT5.15.5 bug.
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: Mac build and python C API

Post by FreddyFreddy »

I get through build ok, but fail towads the end of install. 12.4 Intel
Here's my cmake output. Note pivy failed. Otherwise looks ok AFAICT.

Code: Select all

/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -W no-dev -D CMAKE_PREFIX_PATH=/usr/local/opt/coin3d;/usr/local/opt/hdf5;/usr/local/opt/opencascade@7.5.3;/usr/local/opt/qt@5;/usr/local/opt/vtk@8.2;/usr/local/opt/xerces-c;/usr/local/opt/icu4c;/usr/local/Cellar/matplotlib@3.4.3;/usr/local/Cellar/open-mpi/4.1.3;/usr/local/opt/llvm@11;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -D CMAKE_BUILD_TYPE=Release -D PYTHON_EXECUTABLE=/usr/local/bin/python3 -D PYTHON_INCLUDE_DIR=/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -D PYTHON_LIBRARY=/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib -D FREECAD_CREATE_MAC_APP=ON -D FREECAD_USE_PYBIND11=OFF -D FREECAD_USE_EXTERNAL_KDL=OFF -D BUILD_FEM=ON -D CMAKE_INSTALL_PREFIX=~/ -S /Users/bernie/CLionProjects/FreeCAD -B /Users/bernie/CLionProjects/FreeCAD/cmake-build-release
-- The C compiler identification is Clang 11.1.0
-- The CXX compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/opt/llvm@11/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/opt/llvm@11/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiler: Clang, version: 11.1.0
-- Looking for GL/gl.h
-- Looking for GL/gl.h - not found
-- Looking for C++ include istream
-- Looking for C++ include istream - found
-- Looking for C++ include ostream
-- Looking for C++ include ostream - found
-- Looking for C++ include fstream
-- Looking for C++ include fstream - found
-- Looking for C++ include sstream
-- Looking for C++ include sstream - found
-- Looking for C++ include ios
-- Looking for C++ include ios - found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Looking for C++ include iomanip
-- Looking for C++ include iomanip - found
-- Looking for C++ include iostream
-- Looking for C++ include iostream - found
-- Check for STD namespace
-- Check for STD namespace - found
-- Force BOOST_PP_VARIADICS=1 for clang
-- prefix: /Users/bernie
-- bindir: bin
-- datadir: share
-- docdir: share/doc/FreeCAD
-- includedir: include
-- libdir: lib
-- cmake: 3.23.2
-- Found Doxygen: /usr/local/bin/doxygen (found version "1.9.4") found components: doxygen missing components: dot
-- Detected Homebrew install at /usr/local
-- Found Python3: /usr/local/Frameworks/Python.framework/Versions/3.9/bin/python3.9 (found version "3.9.13") found components: Interpreter Development Development.Module Development.Embed 
-- Found XercesC: /usr/local/opt/xerces-c/lib/libxerces-c.dylib (found version "3.2.3") 
-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libz.tbd (found version "1.2.11") 
-- PyCXX found:
--   Headers:  /Users/bernie/CLionProjects/FreeCAD/src
--   Sources:  /Users/bernie/CLionProjects/FreeCAD/src/CXX
--   Version:  6.2.8
-- Found OCC: /usr/local/opt/opencascade@7.5.3/include/opencascade (found version "7.5.3") 
-- -- Found OCE/OpenCASCADE version: 7.5.3
-- -- OCE/OpenCASCADE include directory: /usr/local/opt/opencascade@7.5.3/include/opencascade
-- -- OCE/OpenCASCADE shared libraries directory: /usr/local/opt/opencascade@7.5.3/lib
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework   
-- Found OpenGLU: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework
-- VTK components: vtkCommonCore;vtkCommonDataModel;vtkFiltersVerdict;vtkIOXML;vtkFiltersCore;vtkFiltersGeneral;vtkIOLegacy;vtkFiltersExtraction;vtkFiltersSources;vtkFiltersGeometry;vtkhdf5;vtkRenderingCore;vtkInteractionStyle;vtkRenderingFreeType;vtkRenderingOpenGL2
-- Check for medfile (libmed and libmedc) ...
-- Found MEDFile: /usr/local/include  
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 
-- We guess that libmed was built using hdf5-serial version
-- Checking for one of the modules 'hdf5-serial'
-- Found HDF5: /usr/local/opt/hdf5/lib/libhdf5.dylib;/usr/local/opt/libaec/lib/libsz.dylib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libz.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libdl.tbd;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/libm.tbd (found version "1.12.2")  
-- Checking for one of the modules 'ompi-cxx'
-- Found Boost: /usr/local/lib/cmake/Boost-1.79.0/BoostConfig.cmake (found suitable version "1.79.0", minimum required is "1.55") found components: filesystem program_options regex system thread date_time 
-- Found SWIG: /usr/local/bin/swig (found version "4.0.2")  
-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.4.0", minimum required is "2.91.0") 
-- Found Freetype: /usr/local/lib/libfreetype.dylib (found version "2.12.1") 
-- Coin3D libraries found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: module 'pivy' has no attribute '__version__'
-- Found Spnav: /usr/local/lib/libspnav.dylib  
-- Shiboken2Config: Using default python: .cpython-39-darwin
-- Found PythonInterp: /usr/local/Frameworks/Python.framework/Versions/3.9/bin/python3.9 (found suitable version "3.9.13", minimum required is "3") 
-- Found PythonLibs: /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib (found suitable version "3.9.13", minimum required is "3") 
-- SHIBOKEN_PYTHON_INCLUDE_DIRS computed to value: '/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9'
-- 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.4.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
-- Found Threads: TRUE  
-- [E57] Revison ID: E57Format-2.2.1-x86_64-darwin
-- [E57] Building static library
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
-- setting gcc options: -Wall -Werror -Wno-deprecated -pedantic-errors
-- Found Boost: /usr/local/lib/cmake/Boost-1.79.0/BoostConfig.cmake (found version "1.79.0") found components: python39 
-- found Boost: 1_79
-- boost-incude dirs are: /usr/local/include
-- boost-python lib is: 
-- boost_LIBRARY_DIRS is: /usr/local/lib
-- Boost_LIBRARIES is: Boost::python
-- area module (for Path Workbench) will be installed to: /Users/bernie/FreeCAD.app/Contents/lib
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Performing Test _flag_found
-- Performing Test _flag_found - Success
-- Note: Doxygen docs will look better with graphviz's dot installed.
-- Checking for module 'icu-uc'
--   Found icu-uc, version 70.1
-- 
==============
Summary report
==============

-- Build type:          Release
-- Compiler:            /usr/local/opt/llvm@11/bin/clang++ (11.1.0)
-- Flags:               -Wall -Wextra -Wpedantic -Wno-write-strings  -Wno-undefined-var-template
-- Standard:            Requires C++17
-- Python:              3.9.13 [/usr/local/Frameworks/Python.framework/Versions/3.9/bin/python3.9] [.cpython-39-darwin]
-- PCL:                 not enabled
-- pybind11:            not enabled
-- Boost:               1.79.0
-- XercesC:             3.2.3 [/usr/local/opt/xerces-c/lib/libxerces-c.dylib] [/usr/local/opt/xerces-c/include]
-- ZLIB:                1.2.11
-- PyCXX:               6.2.8 [/Users/bernie/CLionProjects/FreeCAD/src]
-- OCC:                 7.5.3 [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.3/lib] [/usr/local/opt/opencascade@7.5.3/include/opencascade]
-- SMESH:               build internal
--  MEDFile:            4.1.0 [/usr/local/lib/libmedC.dylib;/usr/local/lib/libmed.dylib] [/usr/local/include]
--  HDF5:               1.12.2
--  VTK:                8.2.0
-- NETGEN:              not enabled
-- SWIG:                4.0.2
-- Eigen3               3.4.0
-- Qt5Core:             5.15.5
-- Qt5Network:          5.15.5
-- Qt5Xml:              5.15.5
-- Qt5XmlPatterns:      5.15.5
-- Qt5Widgets:          5.15.5
-- Qt5PrintSupport:     5.15.5
-- Qt5OpenGL:           5.15.5
-- Qt5Svg:              5.15.5
-- Qt5UiTools:          5.15.5
-- Qt5Concurrent:       5.15.5
-- Qt5WebEngineWidgets: 5.15.10
-- Designer plugin:     not built per user request (BUILD_DESIGNER_PLUGIN)
-- Shiboken2:           5.15.2 [/usr/local/lib/cmake/Shiboken2-5.15.2] [/usr/local/include/shiboken2;/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9]
-- PySide2:             5.15.2 [/usr/local/include/PySide2]
-- PySide2Tools:        [/usr/local/opt/qt@5/bin/uic] [/usr/local/opt/qt@5/bin/rcc]
-- Freetype:            2.12.1
-- OpenGL:              /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework
-- OpenGLU:             [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework][/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/OpenGL.framework]
-- Coin3D:              4.0.0 [/usr/local/opt/coin3d/lib/libCoin.dylib] [/usr/local/opt/coin3d/include]
-- Pivy:                
-- SPNAV:               [/usr/local/lib/libspnav.dylib] [/usr/local/include]
-- Matplotlib:          3.4.3
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             1.9.4
--  Language:           English
--  Coin3D_DOC:         not found
=================================================
Now run 'cmake --build /Users/bernie/CLionProjects/FreeCAD/cmake-build-release' to build FreeCAD
=================================================

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bernie/CLionProjects/FreeCAD/cmake-build-release

[Finished]
User avatar
ipatch
Posts: 112
Joined: Wed Apr 08, 2020 3:40 pm
Location: dfw
Contact:

Re: Mac build and python C API

Post by ipatch »

FreddyFreddy wrote: Sun Jul 10, 2022 3:54 am Did you look at https://forum.freecadweb.org/viewtopic.php?f=4&t=69923
i have. are these errors related to qt?
User avatar
Jolbas
Posts: 327
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Mac build and python C API

Post by Jolbas »

I'm not sure but it seems that reports from those not having the Py_Complex error has [.cpython-39-darwin] in the end of Python description in the cmake summary report and the failing ones has [.abi3]. Is this a correct observation and can it be relevant?
User avatar
ipatch
Posts: 112
Joined: Wed Apr 08, 2020 3:40 pm
Location: dfw
Contact:

Re: Mac build and python C API

Post by ipatch »

Jolbas wrote: Mon Jul 11, 2022 9:55 am I'm not sure but it seems that reports from those not having the Py_Complex error has [.cpython-39-darwin] in the end of Python description in the cmake summary report and the failing ones has [.abi3]. Is this a correct observation and can it be relevant?
interesting i'm using python 3.10 installed via homebrew on macos catalina. are you referring to the below lines?

Code: Select all

-- Shiboken2Config: Using default python: .abi3

...

-- Python:              3.10.5 [/usr/local/Frameworks/Python.framework/Versions/3.10/bin/python3.10] [.abi3]
from the cmake output?
User avatar
Jolbas
Posts: 327
Joined: Sat Mar 26, 2022 7:48 am
Location: Sweden

Re: Mac build and python C API

Post by Jolbas »

ipatch wrote: Mon Jul 11, 2022 9:39 pm are you referring to the below lines?
The second line is the one I was referring to but the first one appears to follow the same pattern.
User avatar
ipatch
Posts: 112
Joined: Wed Apr 08, 2020 3:40 pm
Location: dfw
Contact:

Re: Mac build and python C API

Post by ipatch »

Jolbas wrote: Mon Jul 11, 2022 10:08 pm
ipatch wrote: Mon Jul 11, 2022 9:39 pm are you referring to the below lines?
The second line is the one I was referring to but the first one appears to follow the same pattern.
fwiw

i have the freecad/freecad/shiboken2@5.15.5 formula installed along with the upstream homebrew-core/pyside@2 which uses 5.15.5 of the tarball as well. noticed the upstream package (pyside@2) is the reason why i'm seeing the abi3

so once i get the mojave ci runner job working with the pyside2@5.15.5 completed then these issues won't arise.

fingers crossed of course.

gotta wait for another task to finish on this ci box though so it'll take a minute to get to the mojave pyside2@5.15.5 ci job to finish.

thanks again, for the help and suggestions.
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: Mac build and python C API

Post by FreddyFreddy »

ipatch wrote: Mon Jul 11, 2022 11:54 pm along with the upstream homebrew-core/pyside@2 which uses 5.15.5 of the tarball as well
I'm confused. Arn't we supposed to use the freecad pyside@2 ?
User avatar
doia
Posts: 251
Joined: Sat May 29, 2021 5:47 am
Location: Düsseldorf

Re: Mac build and python C API

Post by doia »

Has anyone success in compiling the latest FC source on arm64 architecture and could share a reproducible build setup? Preferably using Homebrew and Python 3.10. I'm stuck with the Py_complex and Py_UNICODE errors mentioned above. Thanks.
FreddyFreddy
Posts: 176
Joined: Wed Mar 09, 2022 3:15 am
Location: Oz

Re: Mac build and python C API

Post by FreddyFreddy »

@doia Any improvement?
Post Reply