Jump to content

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

    • UltiMaker Cura 5.9 stable released!
      Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
        • Like
      • 5 replies
    • Introducing the UltiMaker Factor 4
      We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
        • Heart
        • Thanks
        • Like
      • 4 replies
×
×
  • Create New...