#66227 closed defect (fixed)

freecad @0.18.5_1: Undefined symbols: "boost::python::detail::init_module(char const*, void (*)())"

Reported by: petrrr Owned by: mbrethen
Priority: Normal Milestone:
Component: ports Version: 2.8.0
Keywords: Cc:
Port: freecad

Description

The freecad port does not build for me. Seems to fail on linking library. I am on macOS Mojave, v 10.14.6.

[...]

[ 32%] Linking CXX shared library ../../lib/libFreeCADApp.dylib
cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cad_freecad/freecad/work/build/src/App && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/FreeCADApp.dir/link.txt --verbose=ON
/usr/bin/clang++ -Wall -Wextra -Wno-write-strings -pipe -I/opt/local/libexec/boost/1.71/include -Os -DNDEBUG -I/opt/local/libexec/boost/1.71/include -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -std=c++11 -Wno-undefined-var-template -D_OCC64 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.14 -dynamiclib -Wl,-headerpad_max_install_names -L/opt/local/libexec/boost/1.71/lib -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-rpath,/opt/local/lib/libgcc -L/opt/local/lib/gcc12/gcc/x86_64-apple-darwin18/12.2.0/../../.. -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -Wl,-undefined,error -o ../../lib/libFreeCADApp.dylib -install_name /opt/local/libexec/freecad/lib/libFreeCADApp.dylib CMakeFiles/FreeCADApp.dir/Annotation.cpp.o CMakeFiles/FreeCADApp.dir/Document.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObject.cpp.o CMakeFiles/FreeCADApp.dir/Extension.cpp.o CMakeFiles/FreeCADApp.dir/ExtensionPyImp.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectExtension.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectExtensionPyImp.cpp.o CMakeFiles/FreeCADApp.dir/ExtensionContainer.cpp.o CMakeFiles/FreeCADApp.dir/ExtensionContainerPyImp.cpp.o CMakeFiles/FreeCADApp.dir/GroupExtension.cpp.o CMakeFiles/FreeCADApp.dir/GroupExtensionPyImp.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectFileIncluded.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectGroup.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectGroupPyImp.cpp.o CMakeFiles/FreeCADApp.dir/GeoFeaturePyImp.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObjectPyImp.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObserver.cpp.o CMakeFiles/FreeCADApp.dir/DocumentObserverPython.cpp.o CMakeFiles/FreeCADApp.dir/DocumentPyImp.cpp.o CMakeFiles/FreeCADApp.dir/Expression.cpp.o CMakeFiles/FreeCADApp.dir/FeaturePython.cpp.o CMakeFiles/FreeCADApp.dir/FeatureTest.cpp.o CMakeFiles/FreeCADApp.dir/GeoFeature.cpp.o CMakeFiles/FreeCADApp.dir/GeoFeatureGroupExtensionPyImp.cpp.o CMakeFiles/FreeCADApp.dir/GeoFeatureGroupExtension.cpp.o CMakeFiles/FreeCADApp.dir/OriginGroupExtensionPyImp.cpp.o CMakeFiles/FreeCADApp.dir/OriginGroupExtension.cpp.o CMakeFiles/FreeCADApp.dir/PartPyImp.cpp.o CMakeFiles/FreeCADApp.dir/Part.cpp.o CMakeFiles/FreeCADApp.dir/Origin.cpp.o CMakeFiles/FreeCADApp.dir/Path.cpp.o CMakeFiles/FreeCADApp.dir/InventorObject.cpp.o CMakeFiles/FreeCADApp.dir/MeasureDistance.cpp.o CMakeFiles/FreeCADApp.dir/Placement.cpp.o CMakeFiles/FreeCADApp.dir/OriginFeature.cpp.o CMakeFiles/FreeCADApp.dir/Range.cpp.o CMakeFiles/FreeCADApp.dir/Transactions.cpp.o CMakeFiles/FreeCADApp.dir/TransactionalObject.cpp.o CMakeFiles/FreeCADApp.dir/VRMLObject.cpp.o CMakeFiles/FreeCADApp.dir/MaterialObject.cpp.o CMakeFiles/FreeCADApp.dir/MergeDocuments.cpp.o CMakeFiles/FreeCADApp.dir/TextDocument.cpp.o CMakeFiles/FreeCADApp.dir/DynamicProperty.cpp.o CMakeFiles/FreeCADApp.dir/ObjectIdentifier.cpp.o CMakeFiles/FreeCADApp.dir/Property.cpp.o CMakeFiles/FreeCADApp.dir/PropertyContainer.cpp.o CMakeFiles/FreeCADApp.dir/PropertyContainerPyImp.cpp.o CMakeFiles/FreeCADApp.dir/PropertyFile.cpp.o CMakeFiles/FreeCADApp.dir/PropertyGeo.cpp.o CMakeFiles/FreeCADApp.dir/PropertyLinks.cpp.o CMakeFiles/FreeCADApp.dir/PropertyPythonObject.cpp.o CMakeFiles/FreeCADApp.dir/PropertyStandard.cpp.o CMakeFiles/FreeCADApp.dir/PropertyUnits.cpp.o CMakeFiles/FreeCADApp.dir/PropertyExpressionEngine.cpp.o CMakeFiles/FreeCADApp.dir/Application.cpp.o CMakeFiles/FreeCADApp.dir/ApplicationPy.cpp.o CMakeFiles/FreeCADApp.dir/Branding.cpp.o CMakeFiles/FreeCADApp.dir/ColorModel.cpp.o CMakeFiles/FreeCADApp.dir/ComplexGeoData.cpp.o CMakeFiles/FreeCADApp.dir/ComplexGeoDataPyImp.cpp.o CMakeFiles/FreeCADApp.dir/Enumeration.cpp.o CMakeFiles/FreeCADApp.dir/Material.cpp.o CMakeFiles/FreeCADApp.dir/MaterialPyImp.cpp.o CMakeFiles/FreeCADApp.dir/PreCompiled.cpp.o  -Wl,-rpath,/opt/local/libexec/freecad/lib ../../lib/libFreeCADBase.dylib /opt/local/libexec/boost/1.71/lib/libboost_filesystem-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_program_options-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_regex-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_system-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_thread-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_chrono-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_date_time-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_atomic-mt.dylib /opt/local/libexec/qt4/lib/libQtCore.dylib /opt/local/libexec/qt4/lib/libQtXml.dylib /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python /opt/local/lib/libxerces-c.dylib /opt/local/libexec/boost/1.71/lib/libboost_filesystem-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_program_options-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_regex-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_system-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_thread-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_chrono-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_date_time-mt.dylib /opt/local/libexec/boost/1.71/lib/libboost_atomic-mt.dylib /opt/local/lib/libz.dylib /opt/local/libexec/qt4/lib/libQtCore.dylib 
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cad_freecad/freecad/work/build'
[ 33%] Built target FreeCADApp
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cad_freecad/freecad/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cad_freecad/freecad/work/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_cad_freecad/freecad/work/build" && /usr/bin/make -j16 -w all VERBOSE=ON 
Exit code: 2
Error: Failed to build freecad: command execution failed

Attachments (1)

main.log (2.6 MB) - added by petrrr 17 months ago.
sudo port -v install freecad

Change History (4)

Changed 17 months ago by petrrr

Attachment: main.log added

sudo port -v install freecad

comment:1 Changed 17 months ago by ryandesign (Ryan Carsten Schmidt)

Summary: freecad @0.18.5_1: build failurefreecad @0.18.5_1: Undefined symbols: "boost::python::detail::init_module(char const*, void (*)())"

The relevant error in the log is:

:info:build Undefined symbols for architecture x86_64:
:info:build   "boost::python::detail::init_module(char const*, void (*)())", referenced from:
:info:build       _initarea in PythonStuff.cpp.o
:info:build ld: symbol(s) not found for architecture x86_64

I think the problem is freecad wants to use python27 but your boost171 port is installed with the +python310 variant. To work around this issue, reinstall the boost171 port with the +python27 variant. (This will break any other ports you have installed that rely on boost171 having been installed with its +python310 variant.)

Ideally, the freecad port should be changed to use python310 to match boost171's default python variant. Whether or not that's done, the freecad port should use the require_active_variants procedure of the active_variants 1.1 portgroup to ensure that the boost171 port has been installed with whatever python variant is required.

Ideally, the freecad port should be updated to use a newer version of boost.

comment:2 Changed 16 months ago by petrrr

I tried to install boost171 +python27 and then rebuild freecad. But it does not build either.

But I guess the best would indeed be to update and move to Python 3 support.

comment:3 Changed 16 months ago by catap (Kirill A. Korinsky)

Resolution: fixed
Status: assignedclosed

In 8ad869a0ee7843e63bc8926ea63b430dd08f2375/macports-ports (master):

freecad: fix build

Closes: #66227
Closes: #60039

Note: See TracTickets for help on using tickets.