From: Richard S. <hob...@gm...> - 2018-04-12 15:00:10
|
I'm trying to build FreeCAD with pycxx 7.0.3. I think they bundle 6.2.8 in the source archive but as Fedora strongly discourages bundled projects I'm attempting to build with the version available in Fedora. I'm running into a build error that I'm not able to fix. Usually a undefined reference during linking is due to missing a library, but as pycxx is a copy-lib, there's nothing to link to. The full error is: [ 24%] Linking CXX shared library ../../lib/libFreeCADBase.so cd /builddir/build/BUILD/FreeCAD-0.17/build/src/Base && /usr/bin/cmake -E cmake_link_script CMakeFiles/FreeCADBase.dir/link.txt --verbose=1 /usr/bin/c++ -fPIC -Wall -Wextra -Wno-write-strings -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -std=c++11 -D_OCC64 -Wl,--no-undefined -shared -Wl,-soname,libFreeCADBase.so -o ../../lib/libFreeCADBase.so CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxxextensions.c.o CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_extensions.cxx.o CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxxsupport.cxx.o CMakeFiles/FreeCADBase.dir/usr/src/CXX/IndirectPythonInterface.cxx.o CMakeFiles/FreeCADBase.dir/Axis.cpp.o CMakeFiles/FreeCADBase.dir/AxisPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Base64.cpp.o CMakeFiles/FreeCADBase.dir/BaseClass.cpp.o CMakeFiles/FreeCADBase.dir/BaseClassPyImp.cpp.o CMakeFiles/FreeCADBase.dir/BoundBoxPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Builder3D.cpp.o CMakeFiles/FreeCADBase.dir/Console.cpp.o CMakeFiles/FreeCADBase.dir/CoordinateSystem.cpp.o CMakeFiles/FreeCADBase.dir/CoordinateSystemPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Debugger.cpp.o CMakeFiles/FreeCADBase.dir/Exception.cpp.o CMakeFiles/FreeCADBase.dir/ExceptionFactory.cpp.o CMakeFiles/FreeCADBase.dir/Factory.cpp.o CMakeFiles/FreeCADBase.dir/FileInfo.cpp.o CMakeFiles/FreeCADBase.dir/FileTemplate.cpp.o CMakeFiles/FreeCADBase.dir/FutureWatcherProgress.cpp.o CMakeFiles/FreeCADBase.dir/gzstream.cpp.o CMakeFiles/FreeCADBase.dir/GeometryPyCXX.cpp.o CMakeFiles/FreeCADBase.dir/Handle.cpp.o CMakeFiles/FreeCADBase.dir/InputSource.cpp.o CMakeFiles/FreeCADBase.dir/Interpreter.cpp.o CMakeFiles/FreeCADBase.dir/Matrix.cpp.o CMakeFiles/FreeCADBase.dir/MatrixPyImp.cpp.o CMakeFiles/FreeCADBase.dir/MemDebug.cpp.o CMakeFiles/FreeCADBase.dir/Parameter.cpp.o CMakeFiles/FreeCADBase.dir/ParameterPy.cpp.o CMakeFiles/FreeCADBase.dir/Persistence.cpp.o CMakeFiles/FreeCADBase.dir/PersistencePyImp.cpp.o CMakeFiles/FreeCADBase.dir/Placement.cpp.o CMakeFiles/FreeCADBase.dir/PlacementPyImp.cpp.o CMakeFiles/FreeCADBase.dir/PyExport.cpp.o CMakeFiles/FreeCADBase.dir/PyObjectBase.cpp.o CMakeFiles/FreeCADBase.dir/Reader.cpp.o CMakeFiles/FreeCADBase.dir/Rotation.cpp.o CMakeFiles/FreeCADBase.dir/RotationPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Sequencer.cpp.o CMakeFiles/FreeCADBase.dir/Stream.cpp.o CMakeFiles/FreeCADBase.dir/Swap.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun_1.3.25.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun_1.3.33.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun_1.3.36.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun_1.3.38.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun_1.3.40.cpp.o CMakeFiles/FreeCADBase.dir/swigpyrun.cpp.o CMakeFiles/FreeCADBase.dir/TimeInfo.cpp.o CMakeFiles/FreeCADBase.dir/Tools.cpp.o CMakeFiles/FreeCADBase.dir/Tools2D.cpp.o CMakeFiles/FreeCADBase.dir/Type.cpp.o CMakeFiles/FreeCADBase.dir/Uuid.cpp.o CMakeFiles/FreeCADBase.dir/Vector3D.cpp.o CMakeFiles/FreeCADBase.dir/VectorPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Writer.cpp.o CMakeFiles/FreeCADBase.dir/XMLTools.cpp.o CMakeFiles/FreeCADBase.dir/UnitsApi.cpp.o CMakeFiles/FreeCADBase.dir/UnitsApiPy.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchema.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaInternal.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaMKS.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaImperial1.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaCentimeters.cpp.o CMakeFiles/FreeCADBase.dir/UnitsSchemaMmMin.cpp.o CMakeFiles/FreeCADBase.dir/Quantity.cpp.o CMakeFiles/FreeCADBase.dir/QuantityPyImp.cpp.o CMakeFiles/FreeCADBase.dir/Unit.cpp.o CMakeFiles/FreeCADBase.dir/UnitPyImp.cpp.o CMakeFiles/FreeCADBase.dir/PyTools.c.o CMakeFiles/FreeCADBase.dir/PreCompiled.cpp.o -lpython2.7 -lxerces-c -lboost_filesystem -lboost_program_options -lboost_regex -lboost_signals -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_atomic -lz -lQtCore -lutil -ldl -lzipios BUILDSTDERR: CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_extensions.cxx.o: In function `Py::Object::validate()': BUILDSTDERR: /usr/src/CXX/Python2/cxx_extensions.cxx:122: undefined reference to `Py::ifPyErrorThrowCxxException()' BUILDSTDERR: CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_extensions.cxx.o: In function `Py::PythonExtensionBase::callOnSelf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&, Py::Object const&)': BUILDSTDERR: /usr/include/CXX/Python2/Objects.hxx:2450: undefined reference to `Py::ifPyErrorThrowCxxException()' BUILDSTDERR: /usr/include/CXX/Python2/Objects.hxx:2426: undefined reference to `Py::ifPyErrorThrowCxxException()' BUILDSTDERR: /usr/include/CXX/Python2/Objects.hxx:2426: undefined reference to `Py::ifPyErrorThrowCxxException()' BUILDSTDERR: /usr/include/CXX/Python2/Objects.hxx:2426: undefined reference to `Py::ifPyErrorThrowCxxException()' BUILDSTDERR: CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_extensions.cxx.o:/usr/include/CXX/Python2/Objects.hxx:2426: more undefined references to `Py::ifPyErrorThrowCxxException()' follow BUILDSTDERR: collect2: error: ld returned 1 exit status BUILDSTDERR: make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/build.make:1262: lib/libFreeCADBase.so] Error 1 Thanks, Richard |
From: Barry S. <ba...@ba...> - 2018-04-16 18:52:17
|
> On 12 Apr 2018, at 15:59, Richard Shaw <hob...@gm...> wrote: > > ifPyErrorThrowCxxException You need to compile ./Src/Python2/cxx_exceptions.cxx to get this and other functions. It new in the V7 series. Barry |
From: Richard S. <hob...@gm...> - 2018-04-17 14:17:12
|
On Mon, Apr 16, 2018 at 1:10 PM, Barry Scott <ba...@ba...> wrote: > > > On 12 Apr 2018, at 15:59, Richard Shaw <hob...@gm...> wrote: > > ifPyErrorThrowCxxException > > > You need to compile ./Src/Python2/cxx_exceptions.cxx to get this and > other functions. > It new in the V7 series. > I figured that out after digging into the FreeCAD sources. They bundle 6.2.8. The next problem I ran into is that it looks like the arguments have changed? [ 26%] Building CXX object src/App/CMakeFiles/FreeCADApp.dir/GroupExtensionPyImp.cpp.o cd /builddir/build/BUILD/FreeCAD-0.17/build/src/App && /usr/bin/c++ -DBOOST_106600 -DDOCDIR=\"/usr/share/doc/freecad\" -DFreeCADApp_EXPORTS -DHAVE_CONFIG_H -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKIT_LIB -DQT_XML_LIB -DRESOURCEDIR=\"/usr/share/freecad\" -D_OCC64 -I/builddir/build/BUILD/FreeCAD-0.17/build -I/usr/include/smesh -isystem /usr/include/QtOpenGL -isystem /usr/include/QtSvg -isystem /usr/include/QtUiTools -isystem /usr/include/QtWebKit -isystem /usr/include/QtGui -isystem /usr/include/QtXml -isystem /usr/include/QtNetwork -isystem /usr/include/QtCore -I/builddir/build/BUILD/FreeCAD-0.17/build/src -I/builddir/build/BUILD/FreeCAD-0.17/src -I/builddir/build/BUILD/FreeCAD-0.17/build/src/App -I/usr/include/python2.7 -Wall -Wextra -Wno-write-strings -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -std=c++11 -D_OCC64 -fPIC -o CMakeFiles/FreeCADApp.dir/GroupExtensionPyImp.cpp.o -c /builddir/build/BUILD/FreeCAD-0.17/src/App/GroupExtensionPyImp.cpp BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/App/ExtensionContainerPyImp.cpp: In member function 'PyObject* App::ExtensionContainerPy::hasExtension(PyObject*)': BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/App/ExtensionContainerPyImp.cpp:161:70: error: no matching function for call to 'Py::Exception::Exception(PyObject*&, std::__cxx11::basic_stringstream<char>::__string_type)' BUILDSTDERR: throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); BUILDSTDERR: ^ BUILDSTDERR: In file included from /usr/include/CXX/Exception.hxx:40, BUILDSTDERR: from /usr/include/CXX/Python2/Objects.hxx:44, BUILDSTDERR: from /usr/include/CXX/Objects.hxx:40, BUILDSTDERR: from /builddir/build/BUILD/FreeCAD-0.17/src/Base/PyObjectBase.h:54, BUILDSTDERR: from /builddir/build/BUILD/FreeCAD-0.17/src/App/Application.h:32, BUILDSTDERR: from /builddir/build/BUILD/FreeCAD-0.17/src/App/ExtensionContainerPyImp.cpp:30: BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate: 'Py::Exception::Exception(const string&)' BUILDSTDERR: PYCXX_STANDARD_EXCEPTION( Exception, BaseException ) BUILDSTDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate expects 1 argument, 2 provided BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate: 'Py::Exception::Exception(const char*)' BUILDSTDERR: PYCXX_STANDARD_EXCEPTION( Exception, BaseException ) BUILDSTDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate expects 1 argument, 2 provided BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate: 'Py::Exception::Exception()' BUILDSTDERR: PYCXX_STANDARD_EXCEPTION( Exception, BaseException ) BUILDSTDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate expects 0 arguments, 2 provided BUILDSTDERR: /usr/include/CXX/Python2/cxx_standard_exceptions.hxx:9:1: note: candidate: 'constexpr Py::Exception::Exception(const Py::Exception&)' BUILDSTDERR: PYCXX_STANDARD_EXCEPTION( Exception, BaseException ) BUILDSTDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ Thanks, Richard |
From: Barry S. <ba...@ba...> - 2018-04-17 19:44:29
|
> On 17 Apr 2018, at 14:07, Richard Shaw <hob...@gm...> wrote: > > BUILDSTDERR: throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); You have two ways to proceed. 1) define PYCXX_6_2_COMPATIBILITY and use the old API 2) port to the V7 API - have a look at CXX/Python2/Exception.hxx and the PYCXX_USER_EXCEPTION_xxx macros. Oh and you might find the brief notes in the readme informative. http://cxx.sourceforge.net/README.html <http://cxx.sourceforge.net/> Barry |
From: Richard S. <hob...@gm...> - 2018-04-17 20:19:26
|
On Tue, Apr 17, 2018 at 2:44 PM, Barry Scott <ba...@ba...> wrote: > On 17 Apr 2018, at 14:07, Richard Shaw <hob...@gm...> wrote: > > BUILDSTDERR: throw Py::Exception(Base:: > BaseExceptionFreeCADError,str.str()); > > You have two ways to proceed. > > 1) define PYCXX_6_2_COMPATIBILITY and use the old API > 2) port to the V7 API - have a look at CXX/Python2/Exception.hxx > and the PYCXX_USER_EXCEPTION_xxx macros. > > Oh and you might find the brief notes in the readme informative. > > http://cxx.sourceforge.net/README.html <http://cxx.sourceforge.net/> > I'll take a look, but I'm not a C/C++ programmer, I just package FreeCAD for Fedora Linux. I'll pass this along to upstream and see how they would like to proceed. Thanks, Richard |
From: Barry <ba...@ba...> - 2018-04-17 20:31:43
|
> On 17 Apr 2018, at 21:19, Richard Shaw <hob...@gm...> wrote: > > On Tue, Apr 17, 2018 at 2:44 PM, Barry Scott <ba...@ba...> wrote: >>> On 17 Apr 2018, at 14:07, Richard Shaw <hob...@gm...> wrote: >>> >>> BUILDSTDERR: throw Py::Exception(Base::BaseExceptionFreeCADError,str.str()); >> >> You have two ways to proceed. >> >> 1) define PYCXX_6_2_COMPATIBILITY and use the old API This is the way to get the rpmbuild working until upstram catch up. Barry >> 2) port to the V7 API - have a look at CXX/Python2/Exception.hxx >> and the PYCXX_USER_EXCEPTION_xxx macros. >> >> Oh and you might find the brief notes in the readme informative. >> >> http://cxx.sourceforge.net/README.html > > I'll take a look, but I'm not a C/C++ programmer, I just package FreeCAD for Fedora Linux. I'll pass this along to upstream and see how they would like to proceed. > > Thanks, > Richard > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > CXX-Users mailing list > CXX...@li... > https://lists.sourceforge.net/lists/listinfo/cxx-users |
From: Richard S. <hob...@gm...> - 2018-04-18 13:37:26
|
Getting closer... I have verified that exx_exceptions is getting compiled: [ 18%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_exceptions.cxx.o cd /builddir/build/BUILD/FreeCAD-0.17/build/src/Base && /usr/bin/c++ -DFreeCADBase_EXPORTS -DHAVE_CONFIG_H -DHAVE_SWIG=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKIT_LIB -DQT_XML_LIB -D_OCC64 -I/builddir/build/BUILD/FreeCAD-0.17/build -I/usr/include/smesh -isystem /usr/include/QtOpenGL -isystem /usr/include/QtSvg -isystem /usr/include/QtUiTools -isystem /usr/include/QtWebKit -isystem /usr/include/QtGui -isystem /usr/include/QtXml -isystem /usr/include/QtNetwork -isystem /usr/include/QtCore -I/builddir/build/BUILD/FreeCAD-0.17/build/src -I/builddir/build/BUILD/FreeCAD-0.17/src -I/builddir/build/BUILD/FreeCAD-0.17/build/src/Base -I/builddir/build/BUILD/FreeCAD-0.17/src/Base -I/usr/include/python2.7 -Wall -Wextra -Wno-write-strings -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -DPYCXX_6_2_COMPATIBILITY -std=c++11 -D_OCC64 -fPIC -o CMakeFiles/FreeCADBase.dir/usr/src/CXX/cxx_exceptions.cxx.o -c /usr/src/CXX/cxx_exceptions.cxx But I'm still getting: [ 23%] Building CXX object src/Base/CMakeFiles/FreeCADBase.dir/Sequencer.cpp.o cd /builddir/build/BUILD/FreeCAD-0.17/build/src/Base && /usr/bin/c++ -DFreeCADBase_EXPORTS -DHAVE_CONFIG_H -DHAVE_SWIG=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_UITOOLS_LIB -DQT_WEBKIT_LIB -DQT_XML_LIB -D_OCC64 -I/builddir/build/BUILD/FreeCAD-0.17/build -I/usr/include/smesh -isystem /usr/include/QtOpenGL -isystem /usr/include/QtSvg -isystem /usr/include/QtUiTools -isystem /usr/include/QtWebKit -isystem /usr/include/QtGui -isystem /usr/include/QtXml -isystem /usr/include/QtNetwork -isystem /usr/include/QtCore -I/builddir/build/BUILD/FreeCAD-0.17/build/src -I/builddir/build/BUILD/FreeCAD-0.17/src -I/builddir/build/BUILD/FreeCAD-0.17/build/src/Base -I/builddir/build/BUILD/FreeCAD-0.17/src/Base -I/usr/include/python2.7 -Wall -Wextra -Wno-write-strings -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -DPYCXX_6_2_COMPATIBILITY -std=c++11 -D_OCC64 -fPIC -o CMakeFiles/FreeCADBase.dir/Sequencer.cpp.o -c /builddir/build/BUILD/FreeCAD-0.17/src/Base/Sequencer.cpp BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Base/Sequencer.cpp: In member function 'Py::Object Base::ProgressIndicatorPy::next(const Py::Tuple&)': BUILDSTDERR: /builddir/build/BUILD/FreeCAD-0.17/src/Base/Sequencer.cpp:370:59: error: no matching function for call to 'Py::Exception::Exception(const char [25])' BUILDSTDERR: throw Py::Exception("abort progress indicator"); BUILDSTDERR: ^ And you can see the define added for PYCXX_6_2_COMPATIBILITY... Thanks, Richard |
From: Barry S. <ba...@ba...> - 2018-04-18 18:03:13
|
> On 18 Apr 2018, at 14:37, Richard Shaw <hob...@gm...> wrote: > > BUILDSTDERR: throw Py::Exception("abort progress indicator"); > BUILDSTDERR: ^ > > And you can see the define added for PYCXX_6_2_COMPATIBILITY... Oh. Looks like I missed off a small part of the backward compat. That throws a RuntimeError. I think you can change it to be: throw Py::RuntimeError("about progress indictor"); Barry |
From: Richard S. <hob...@gm...> - 2018-04-20 13:14:12
|
On Wed, Apr 18, 2018 at 1:03 PM, Barry Scott <ba...@ba...> wrote: > > > On 18 Apr 2018, at 14:37, Richard Shaw <hob...@gm...> wrote: > > BUILDSTDERR: throw Py::Exception("abort progress indicator"); > BUILDSTDERR: ^ > > And you can see the define added for PYCXX_6_2_COMPATIBILITY... > > > Oh. Looks like I missed off a small part of the backward compat. > > That throws a RuntimeError. > > I think you can change it to be: > > throw Py::RuntimeError("about progress indictor"); > Thanks, upstream freecad has committed a change and now it builds. Richard |