PyCXX upgrade
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
PyCXX upgrade
I upgraded PyCXX to the most recent version (6.2.5), which can support python3 too. It looks like nothing is broken (very few changes apparently, only adds py3 support), but I'd appreciate if someone else can give it a try and check if all seems to work normally. Thanks!
https://github.com/yorikvanhavre/FreeCAD/tree/pyccc625
https://github.com/yorikvanhavre/FreeCAD/tree/pyccc625
Re: PyCXX upgrade
I had problems with some relative paths.
Code: Select all
diff --git a/src/CXX/cxxextensions.c b/src/CXX/cxxextensions.c
index 28a8e1d..cfab556 100644
--- a/src/CXX/cxxextensions.c
+++ b/src/CXX/cxxextensions.c
@@ -37,7 +37,7 @@
#include "CXX/WrapPython.h"
#if PY_MAJOR_VERSION == 2
-#include "Src/Python2/cxxextensions.c"
+#include "Python2/cxxextensions.c"
#else
-#include "Src/Python3/cxxextensions.c"
+#include "Python3/cxxextensions.c"
#endif
diff --git a/src/CXX/cxxsupport.cxx b/src/CXX/cxxsupport.cxx
index 1f2fb43..946e60d 100644
--- a/src/CXX/cxxsupport.cxx
+++ b/src/CXX/cxxsupport.cxx
@@ -37,7 +37,7 @@
#include "CXX/WrapPython.h"
#if PY_MAJOR_VERSION == 2
-#include "Src/Python2/cxxsupport.cxx"
+#include "Python2/cxxsupport.cxx"
#else
-#include "Src/Python3/cxxsupport.cxx"
+#include "Python3/cxxsupport.cxx"
#endif
Re: PyCXX upgrade
I get a build error code from your repo above...branch "pyccc625"
[ 0%] Building C object src/Base/CMakeFiles/FreeCADBase.dir/__/CXX/cxxextensions.c.o
/home/user/Downloads/cad/FreeCAD/yorik/code/src/CXX/cxxextensions.c:40:39: fatal error: Src/Python2/cxxextensions.c: No such file or directory
#include "Src/Python2/cxxextensions.c"
^
compilation terminated.
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/__/CXX/cxxextensions.c.o] Error 1
make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
OS: Kubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1 compiled from their master
Jim
[ 0%] Building C object src/Base/CMakeFiles/FreeCADBase.dir/__/CXX/cxxextensions.c.o
/home/user/Downloads/cad/FreeCAD/yorik/code/src/CXX/cxxextensions.c:40:39: fatal error: Src/Python2/cxxextensions.c: No such file or directory
#include "Src/Python2/cxxextensions.c"
^
compilation terminated.
make[2]: *** [src/Base/CMakeFiles/FreeCADBase.dir/__/CXX/cxxextensions.c.o] Error 1
make[1]: *** [src/Base/CMakeFiles/FreeCADBase.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
OS: Kubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.1 compiled from their master
Jim
Re: PyCXX upgrade
We have to be careful with upgrading PyCXX. For the Windows platform we had to patch the PyCXX in order to export the class declarations to the library. And recently there were made a couple of changes to build with VS 2012.
Re: PyCXX upgrade
Are these patches appropriate to offer upstream to PyCXX project?wmayer wrote:We have to be careful with upgrading PyCXX. For the Windows platform we had to patch the PyCXX in order to export the class declarations to the library. And recently there were made a couple of changes to build with VS 2012.
Out of curiosity the last update to the code at PyCxx project is February this year. Here is a link to the code history on Sourceforge
http://sourceforge.net/p/cxx/code/295/log/?path=
and 6.2.5 was tagged 18-08-2013, just over a year ago.
http://sourceforge.net/p/cxx/code/HEAD/tree/
Re: PyCXX upgrade
My changes regarding VS 2012 was mostly about unclean usage of int and index_type (which are 64 bit on Win64). It was more house keeping then features or bugs...
Stop whining - start coding!
Re: PyCXX upgrade
Does that mean that it could be worth while offering your changes to the PyCXX project? Sorry if this is a silly question.jriegel wrote:My changes regarding VS 2012 was mostly about unclean usage of int and index_type (which are 64 bit on Win64). It was more house keeping then features or bugs...
Re: PyCXX upgrade
Hm Sebastan's and Jim's problems seem to be the same... Indeed the paths were different in the PyCXX source package. I fixed that now.
Jürgen/Werner, what would you think is the best way to isolate those changes you did? A diff with a specific verison of PyCXX?
Jürgen/Werner, what would you think is the best way to isolate those changes you did? A diff with a specific verison of PyCXX?
Re: PyCXX upgrade
If you do a diff to the official PyCXX version we use and the sources in master you should get the changes we made.Jürgen/Werner, what would you think is the best way to isolate those changes you did? A diff with a specific verison of PyCXX?
Re: PyCXX upgrade
Ok! I'll try to port those changes to the new version. It shouldn't be much work, the Python2 version apparently didn't change much...