Jump to content

Cura from source, python virtualenv


FPS_Budd_Dwyer

Recommended Posts

Posted · Cura from source, python virtualenv

Abstract

Since the current e-build of Cura for my distro has issues I decided to just get the source from git up and running. Additionally, I wanted this in a virtual python environment so I didn't have to worry about conflicts with my system or python upgrades. (amd64 gentoo 4.19.44)

 

Resources

Please read the following two articles. They are brief and very well done. However neither of these worked for me exactly as written so I wanted to submit my log here in hopes that it may help others.

  1. https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Ubuntu
  2. https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-openSUSE

 

Create the Python virtual environment, activate it, and install the dependencies

cd ~/virtualenvs
virtualenv -p /usr/bin/python3.5 Cura
source ./Cura/bin/activate 
pip3 install pyserial PyQt5==5.10 requests scipy numpy shapely zeroconf

 

Build dependencies under /usr/local/src :

note: use an appropriate distro location, on my system that is /usr/local/src

 

Create a CuraEnv folder to hold everything.

cd /usr/local/src/
mkdir CuraEnv
cd CuraEnv 

note: Always return to this folder before installing the next sub package

 

libCharon

git clone https://github.com/Ultimaker/libCharon
cd libCharon 
python3 setup.py build
python3 setup.py install

note: install will build and install but I like to go slow and read outputs
note: sudo is not needed for install due to the virtualenv

 

sip

wget https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.tar.gz
tar xzvf sip-4.19.13.tar.gz 
cd sip-4.19.13
python3 configure.py
make -jn -ln
sudo make install 

 note: With regards to make -j and -l are completely optional, they are arguments for number of threads and load respectively.

 note: sudo is needed here because ~/virtual/Cura/include is a symbolic to /usr/include which needs elevated permissions for write

 

protobuf

git clone https://github.com/google/protobuf.git
cd protobuf
git checkout 3.5.1.1
mkdir build-dir 
cd build-dir
cmake ../cmake -Dprotobuf_BUILD_TESTS=OFF

Be sure to add the -fPIC flag to CMAKE_CXX_FLAGS to the CMackeCache file as noted in the Ubuntu guide.

Quote

In the newly created CMakeCache.txt file, change the CMAKE_CXX_FLAGS:FLAGS property to -fPIC

 

Build and install

make -jn -ln
sudo make install

 note: With regards to make -j and -l are completely optional, they are arguments for number of threads and load respectively.

 

libArcus

git clone https://github.com/Ultimaker/libArcus.git
cd libArcus
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
make -jn -ln
sudo make install

 note: With regards to make -j and -l are completely optional, they are arguments for number of threads and load respectively.

 

CuraEngine

git clone https://github.com/Ultimaker/CuraEngine.git
cd CuraEngine
mkdir build 
cd build 
cmake ..
make -jn -ln
sudo make install

 note: With regards to make -j and -l are completely optional, they are arguments for number of threads and load respectively.

 

libSavitar

git clone https://github.com/Ultimaker/libSavitar.git
cd libSavitar
mkdir build && cd build
cmake ..
make -jn -ln
sudo make install

 note: With regards to make -j and -l are completely optional, they are arguments for number of threads and load respectively.

 

Uranium

git clone https://github.com/Ultimaker/Uranium.git

 

fdm_materials

git clone https://github.com/Ultimaker/fdm_materials.git

 

Cura

cd Cura
mkdir resources/materials
ln -s /usr/local/bin/CuraEngine .
ln -s /usr/local/src/fdm_materials resources/materials/fdm_materials

 

Set PYTHONPATH start and test

PYTHONPATH=$PWD/../Uranium:$PYTHONPATH python3 cura_app.py

Screenshot_20190529_221338.png.b4dd966cbfa9bde227d536c34758042b.png

 

 

Extra Credit

Hopefully all went well and you are probably sick of a terminal by now.
Let's add a quick launcher script so you can have easy access via your window manager.

cd /usr/local/bin
sudo nano vim /usr/local/bin/cura

paste this block, save and close

#!/bin/bash
#Start up the virtual python env
source ~/virtualenvs/Cura/bin/activate
#Change Directory
cd /usr/local/src/CuraEnv/Cura
#Set env and start...
#send stderr to log and dump stdout
PYTHONPATH=$PWD/../Uranium:$PYTHONPATH python3 cura_app.py 2>/var/log/cura.log >/dev/null &

make it executable

sudo chmod +x /usr/local/bin/cura

Add /usr/local/bin/cura to your launcher of choice and use the icon from the cura/icons folder to make it pretty.

 

Screenshot_20190529_221210.png.fb3fedad3b370f2a5b898f0ff441e3cd.png

 

 

Happy printing.

 

 

 

  • Thanks 1
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Introducing Universal Cura Projects in the UltiMaker Cura 5.7 beta
      Strap in for the first Cura release of 2024! This 5.7 beta release brings new material profiles as well as cloud printing for Method series printers, and introduces a powerful new way of sharing print settings using printer-agnostic project files! Also, if you want to download the cute dinosaur card holder featured below, it was specially designed for this release and can be found on Thingiverse! 
      • 10 replies
    • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
      (Sorry, was out of office when this released)

      This update is for...
      All UltiMaker S series  
      New features
       
      Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
      • 0 replies
×
×
  • Create New...