Porting to python3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Porting to python3
Some issues will for sure emerge, when it comes to FreeCAD 0.18 Py3 builds. But i don't know if it makes sense to worry about that too much for now.
Re: Porting to python3
Is it really necessary to use a MPI compiler? I usually compile with a normal gcc and it seems to work.kkremitzki wrote: ↑Mon Jun 12, 2017 12:17 amYou need to use mpic++ as your CXX compiler, so e.g. add this flag to cmake:
-DCMAKE_CXX_COMPILER=/usr/bin/mpic++
Would the MPI compiler just add the parallelism?
sorry to excavate the thread here, but I did not wanted to create a new one
Re: Porting to python3
You are reading old information.
This flag is not needed. If you have all requisites you only need this line to configure the build.
Code: Select all
cmake -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 freecad-source
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Porting to python3
okay thanks for the clarification! I was just consolidating old buildscripts and saw that some used mpic++
Re: Porting to python3
I'm trying to build, and was successful when I didn't worry about python3, Now trying with python 3 using the following cmake
I'm getting a lot of errors related to PyString which google says is python2 only.
The errors thus far are in cxx_extensions.cxx
Is there a workaround for this?
*edit*
I just added #error codes and it shows that it is definitely trying to compile for python2, when I asked for python3. So how to I insist on python3?
Code: Select all
cmake .. -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_VERSION=3.6 -DFREECAD_USE_PCL=ON
The errors thus far are in cxx_extensions.cxx
Is there a workaround for this?
*edit*
I just added #error codes and it shows that it is definitely trying to compile for python2, when I asked for python3. So how to I insist on python3?
- Attachments
-
- out.txt
- (23.02 KiB) Downloaded 39 times
Working on...
https://github.com/iplayfast/CycloidGearBox
https://github.com/iplayfast/CycloidGearBox
Re: Porting to python3
What system? Clean directory build? Source repository updated recently? Can you post full cmake output (configuration stage)?
Re: Porting to python3
clean directory build (mkdir build, cd build, cmake .. style) , linux.
I just did a
and it shows the following:
Note -I/usr/include/python2.7 AND -I/usr/include/python3.6m
I think this is where the problem lies. where is the python2.7 coming from?
I just did a
Code: Select all
make VERBOSE=1 >out.txt
Code: Select all
cd /home/chris/github/freecad-source/build/src/Base && /usr/bin/c++ -DFreeCADBase_EXPORTS -DHAVE_CONFIG_H -DHAVE_SWIG=1 -DQT_CORE_LIB -DQT_NO_DEBUG -D_OCC64 -DvtkFiltersFlowPaths_AUTOINIT="1(vtkFiltersParallelFlowPaths)" -DvtkIOExodus_AUTOINIT="1(vtkIOParallelExodus)" -DvtkIOGeometry_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOImage_AUTOINIT="1(vtkIOMPIImage)" -DvtkIOParallel_AUTOINIT="1(vtkIOMPIParallel)" -DvtkIOSQL_AUTOINIT="2(vtkIOMySQL,vtkIOPostgreSQL)" -DvtkRenderingContext2D_AUTOINIT="1(vtkRenderingContextOpenGL)" -DvtkRenderingCore_AUTOINIT="3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)" -DvtkRenderingFreeType_AUTOINIT="2(vtkRenderingFreeTypeFontConfig,vtkRenderingMatplotlib)" -DvtkRenderingLIC_AUTOINIT="1(vtkRenderingParallelLIC)" -DvtkRenderingVolume_AUTOINIT="1(vtkRenderingVolumeOpenGL)" -I/home/chris/github/freecad-source/build -I/usr/include/vtk-6.3 -I/usr/include/freetype2 -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi/opal/mca/event/libevent2022/libevent/include -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/python2.7 -I/usr/include/hdf5/openmpi -I/usr/include/libxml2 -I/usr/include/jsoncpp -I/usr/include/tcl -I/home/chris/github/freecad-source/build/src -I/home/chris/github/freecad-source/src -I/home/chris/github/freecad-source/build/src/Base -I/home/chris/github/freecad-source/src/Base -I/usr/include/python3.6m -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -Wall -Wextra -Wno-write-strings -fPIC -I/usr/include/openmpi -I/usr/include/hdf5/openmpi -pthread -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -fPIC -std=gnu++11 -o CMakeFiles/FreeCADBase.dir/__/CXX/cxx_extensions.cxx.o -c /home/chris/github/freecad-source/src/CXX/cxx_extensions.cxx
src/Base/CMakeFiles/FreeCADBase.dir/build.make:213: recipe for target 'src/Base/CMakeFiles/FreeCADBase.dir/__/CXX/cxx_extensions.cxx.o' failed
I think this is where the problem lies. where is the python2.7 coming from?
Working on...
https://github.com/iplayfast/CycloidGearBox
https://github.com/iplayfast/CycloidGearBox
Re: Porting to python3
cmake output attached
- Attachments
-
- out.txt
- (5.84 KiB) Downloaded 35 times
Working on...
https://github.com/iplayfast/CycloidGearBox
https://github.com/iplayfast/CycloidGearBox
Re: Porting to python3
Looks like it's pulled in by a third party library -- possibly by the vtkPython component. What's the content of vtkPython.cmake (you may find it under /usr/lib/cmake/vtk-6.3/Modules)?
In case you don't need the python2.7-dev package for anything else then it's best to uninstall it.
In case you don't need the python2.7-dev package for anything else then it's best to uninstall it.
Re: Porting to python3
Shiboken2Config: Using default python: -python2.7.x86_64-linux
What shiboken do you have installed?
What shiboken do you have installed?