Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Build on ubuntu 16.04. worked. #63

Closed
kenjo opened this issue May 20, 2016 · 34 comments
Closed

Build on ubuntu 16.04. worked. #63

kenjo opened this issue May 20, 2016 · 34 comments

Comments

@kenjo
Copy link

kenjo commented May 20, 2016

here is the changes I needed to do to make it build on ubuntu 16.04

it starts have not tried using it much yet.

patch.txt

@Ghostkeeper
Copy link
Contributor

To summarise:

  • Using a different version of Numpy (downloaded from Github instead of Sourceforge).
  • Using a different version of libstdc++ (6.0.21 instead of 6.0.20).
  • Added cython3 to dependencies in readme.
  • Called cmake with environment variable CURA_MAJOR_VERSION=2.
  • Used Python 3.5 in launch script. This is one I'm not sure about. We are using some stuff that was changed in 3.5 in Cura, namely the plug-in loading stuff. And I'm thinking that this might break Cura on older versions of Ubuntu.

It's common practice to make a pull request out of changes such as this. That way we can include your changes directly and Git will also track that it was you who made the change, so your name will be included in the list of collaborators and so on 😃

At the very least we should test slicing and layer view first, on multiple systems. Especially libArcus can be very OS-dependent (and compiler-dependent) at times so if slicing works that'll give good confidence that everything is still in order.

@kenjo
Copy link
Author

kenjo commented May 20, 2016

yes this is only to make it compile and run on ubuntu 16.04.
It will break on older version and if you compile on older it will break on new version. I did not intend this to be merged at this point as it will break build on older versions and the resulting binary will only run on ubuntu 16.04.

I'm thinking about trying appimage http://appimage.org/ to make a version that works on basically any linux distro. But then you need to build everything including python so its going to be a big image. But it might be good to have one baseline that works everywhere then others can make a "native" package.

@Ghostkeeper
Copy link
Contributor

We could have if-clauses in the CMake to check for version, but that means we'd have to release two Linux-versions instead of one, and also that we'd have to make sure our Python code is compatible with two Python versions.

@joinalahmed
Copy link

after successful compilation the .deb file generates but its not installing

@Ghostkeeper
Copy link
Contributor

See #69

@probonopd
Copy link
Contributor

@kenjo

I'm thinking about trying appimage http://appimage.org/ to make a version that works on basically any linux distro.

Actually I have done this a couple of weeks ago:
https://bintray.com/probono/AppImages/Cura/view#files

Here is the Recipe that was used to produce the AppImage:
https://github.com/probonopd/AppImages/blob/master/recipes/cura/Recipe

This AppImage needs some more testing though, and it would be cool if someone from the Cura project could actually produce official, upstream-generated AppImages.

@awhiemstra
Copy link
Contributor

I actually want to start creating AppImages as it makes it much easier to do cross-distribution publishing and flatpak is not yet production ready. Unfortunately I so far have not yet had the time to do it.

@probonopd Those are for 15.04 though, so the recipe probably needs a lot of work to work with 2.1.

@probonopd
Copy link
Contributor

@awhiemstra for maximum compatibility, we should use binaries that were compiled on the oldest build system possible (e.g., debian oldstable, CentOS 6 or the like) - this maximizes binary compatibility with not-so-recent "enterprise stable" distributions.

@awhiemstra
Copy link
Contributor

Yeah, I know. I am probably going to look at building a CentOS 6 VM for it.

@cn-toven
Copy link

@kenjo ,did you build cura in 64bit ubuntu or 32bit ubuntu?

@cn-toven
Copy link

cn-toven commented Dec 18, 2016

What i met when starting cura built in 64bit Ubuntu 1604, is as follows:

File "/opt/cura/lib/python3/dist-packages/scipy/spatial/init.py", line 91, in
from .ckdtree import *
File "init.pxd", line 155, in init ckdtree (scipy/spatial/ckdtree/ckdtree.cxx:22466)
ValueError: numpy.dtype has the wrong size, try recompiling

Using http://downloads.sourceforge.net/project/numpy/NumPy/1.9.2/numpy-1.9.2.tar.gz

@Ghostkeeper
Copy link
Contributor

Your NumPy and your SciPy are not compatible with each other. I think it's good to try compiling both from versions that were released around the same time.

@cn-toven
Copy link

@Ghostkeeper, thank you for reminding. After replacing the Numpy with https://github.com/numpy/numpy/archive/v1.11.0.tar.gz, provided by the patch file of this thread. I rebuilt cura, and run it, it encounters into a new issue:

cura.CrashHandler.show [32]: An uncaught exception has occurred!
cura.CrashHandler.show [35]: Traceback (most recent call last):
cura.CrashHandler.show [35]: File "/opt/cura/bin/cura", line 49, in
cura.CrashHandler.show [35]: import cura.CuraApplication
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/cura/CuraApplication.py", line 4, in
cura.CrashHandler.show [35]: from UM.Qt.QtApplication import QtApplication
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/UM/Qt/QtApplication.py", line 16, in
cura.CrashHandler.show [35]: from UM.Qt.QtRenderer import QtRenderer
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/UM/Qt/QtRenderer.py", line 4, in
cura.CrashHandler.show [35]: from PyQt5.QtGui import QColor, QOpenGLBuffer, QOpenGLContext, QOpenGLFramebufferObject, QOpenGLFramebufferObjectFormat, QSurfaceFormat, QOpenGLVersionProfile, QImage
cura.CrashHandler.show [35]: ImportError: cannot import name 'QOpenGLBuffer'

@Ghostkeeper
Copy link
Contributor

New error. Always a good sign ;)

Did you install this dependency?

sudo apt install python3-pyqt5.qtopengl

If so, what version of OpenGL are you running? We require at least version 2.0. On some virtual machines it doesn't have that.

@cn-toven
Copy link

Before i get your response, I run into "blue screen" , after installing the below packages:
#apt-get install libqt4-opengl
#apt-get install python-qt4-gl
But i can't recover the system even doing the removal actions. I might have to re-create the VM of ubuntu.

@Ghostkeeper
Copy link
Contributor

Ghostkeeper commented Dec 20, 2016

Whoa... Sounds serious.

Note that we use Qt5, not 4.

@cn-toven
Copy link

cn-toven commented Dec 20, 2016

I recreate the VM with ubuntu 1604. Install cura (didn't rebuild it), still the same errors:

apt install python3-pyqt5.qtopengl

Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pyqt5.qtopengl is already the newest version (5.5.1+dfsg-3ubuntu4).
0 upgraded, 0 newly installed, 0 to remove and 258 not upgraded.

glxinfo | grep "OpenGL version"

OpenGL version string: 3.0 Mesa 11.2.0

cura

cura.CrashHandler.show [32]: An uncaught exception has occurred!
cura.CrashHandler.show [35]: Traceback (most recent call last):
cura.CrashHandler.show [35]: File "/opt/cura/bin/cura", line 49, in
cura.CrashHandler.show [35]: import cura.CuraApplication
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/cura/CuraApplication.py", line 4, in
cura.CrashHandler.show [35]: from UM.Qt.QtApplication import QtApplication
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/UM/Qt/QtApplication.py", line 16, in
cura.CrashHandler.show [35]: from UM.Qt.QtRenderer import QtRenderer
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/UM/Qt/QtRenderer.py", line 4, in
cura.CrashHandler.show [35]: from PyQt5.QtGui import QColor, QOpenGLBuffer, QOpenGLContext, QOpenGLFramebufferObject, QOpenGLFramebufferObjectFormat, QSurfaceFormat, QOpenGLVersionProfile, QImage
cura.CrashHandler.show [35]: ImportError: cannot import name 'QOpenGLBuffer'

@cn-toven
Copy link

cn-toven commented Dec 20, 2016

One more thing is the python version, it was pointing to python2.7, but i changed it to python3.5, by modifying /usr/bin/python link:
lrwxrwxrwx 1 root root 9 12月 20 21:39 /usr/bin/python -> python2.7
==>
lrwxrwxrwx 1 root root 18 12月 21 07:17 /usr/bin/python -> /usr/bin/python3.5

Does this work? is there a better way to enable python3.5?

@cn-toven
Copy link

Could anyone share a working version of cura built in 64bit ubuntu1604? If so, i can test if it's caused by my VM or mistakes in building cura. Thanks.

@Ghostkeeper
Copy link
Contributor

glxinfo | grep "OpenGL version"
OpenGL version string: 3.0 Mesa 11.2.0

@awhiemstra had some trouble yesterday with version 3.3 because for some reason only OpenGL versions 2 and 4 are supported by Qt. Any word on your findings, awhiemstra?

@Ghostkeeper
Copy link
Contributor

About modifying /usr/bin/python, be careful with that. Some parts of your operating system may depend on Python 2 and would crash when it suddenly turns out to be version 3.5 instead of 2.7.

In our installation we have to call the Python 3.5 executable explicitly. For Cura we deliver a shell script that calls something along the line of python3 cura_app.py.

@Ghostkeeper
Copy link
Contributor

We'll have a Linux version for the 2.4 beta. It was built on CentOS though, but it is known to work on Ubuntu 16.04. The version is currently at our system testers for some more integration testing.

@peteruithoven
Copy link
Contributor

@cn-toven could be that you really want to compile it yourself for some reason, but Cura runs great on Elementary OS (which is based on Ubuntu 16.04) using thopiekar's ppa: https://launchpad.net/~thopiekar/+archive/ubuntu/cura

@cn-toven
Copy link

cn-toven commented Dec 22, 2016

@Ghostkeeper OK, i will change back the symbol link of /usr/bin/python, and looking forward to the coming 2.4 beta.
@peteruithoven i will try the ppa builds.
thank you all.

@cn-toven
Copy link

Good news and bad news:
Good news:
I install cura in ubutu1604 with the ppa source, the cura window shows up. This says my VM system is OK for running cura.

Bad news:
I remove cura and install with the deb file built by myself, the issue still there:

cura.CrashHandler.show [35]: from UM.Qt.QtRenderer import QtRenderer
cura.CrashHandler.show [35]: File "/opt/cura/lib/python3/dist-packages/UM/Qt/QtRenderer.py", line 4, in
cura.CrashHandler.show [35]: from PyQt5.QtGui import QColor, QOpenGLBuffer, QOpenGLContext, QOpenGLFramebufferObject, QOpenGLFramebufferObjectFormat, QSurfaceFormat, QOpenGLVersionProfile, QImage
cura.CrashHandler.show [35]: ImportError: cannot import name 'QOpenGLBuffer'

@Ghostkeeper
Copy link
Contributor

So something is different in the way that Cura is built for the PPA from how you built it. Did you have to do anything special to get Qt to work with OpenGL on your server, @thopiekar?

@thopiekar
Copy link
Contributor

By deb file I guess he means the Deb file he built with cura-build.
The packages in the PPA are not built with cura-build (which bundles everything in one package) but with my own packaging files, which provides separate packages.

In short: You can't mix the PPA with the deb built from cura-build.
Why do you build cura by cura-build at all?

@Ghostkeeper
Copy link
Contributor

Why do you build cura by cura-build at all?

Well it's our recommended tool to build Cura with...

@thopiekar
Copy link
Contributor

@Ghostkeeper I meant the others with that ^^
It is absolutely great to have cura-build, but I only wonder why there is such a big interest by different people in building Cura instead of contributing to it, eg. by adding definitions or whatever.
That's why I'm asking this 😉

@cn-toven
Copy link

@thopiekar I understand your concern. I will try to...
I had attempted to build CuraEngine, Cura and other dependent packages separately, but met a lot of trouble. After that i turn to cura-build, and with slight changes, i can build it through on ubuntu1604, but still can not run it as the QOpenGL problem.

@cn-toven
Copy link

patch_tv.txt my patch file.

@thopiekar
Copy link
Contributor

thopiekar commented Dec 25, 2016

@cn-toven So my PPA is working for you, but your deb isn't?
Why are you not using my PPA then? Additionally Ultimaker is now mainly working on the AppImages. So don't expect too much feedback on baking deb files.
If you've got problems with my PPA feel free to join the conversation at: Ultimaker/Cura#718 (comment) 😉

@cn-toven
Copy link

@thopiekar I'm still attempting to build a version via cura-build script. I have no ultimaker printer for now, so i can't use cura to print a model. Though I'm glad to comment Cura#718 if having any valuable idea on it. Thanks for your work.

@LipuFei
Copy link
Contributor

LipuFei commented Aug 13, 2019

Closing this issue due to inactivity.

@LipuFei LipuFei closed this as completed Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants