Cura在Linux上的版本老是下載不了,準備本身從源碼進行編譯。python
下面是從https://github.com/ultimaker上下載的編譯腳本。原始的腳本有一些問題,本身作了一些修改,以下:
git
#!/bin/bash # This is a script which get the latest git repo and build them. # # Tested under ubuntu 15.04, lower versions don't have PyQT 5.2.1 which is required by cura cd ~ if [ ! -d "cura_dev" ]; then mkdir cura_dev fi cd cura_dev sudo apt-get install -y git cmake cmake-gui autoconf libtool python3-setuptools curl python3-pyqt5.* python3-numpy qml-module-qtquick-controls git clone https://github.com/Ultimaker/Cura.git git clone https://github.com/Ultimaker/Uranium.git git clone https://github.com/Ultimaker/CuraEngine.git git clone https://github.com/Ultimaker/libArcus git clone https://github.com/Ultimaker/protobuf.git cd protobuf ./autogen.sh ./configure make -j4 sudo make install sudo ldconfig cd python python3 setup.py build sudo python3 setup.py install cd ../.. cd libArcus if [ ! -d "build" ]; then mkdir build fi cd build cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages make -j4 sudo make install cd ../../ cd CuraEngine if [ ! -d "build" ]; then mkdir build fi cd build cmake .. make -j4 cd ../../ cd Uranium if [ ! -d "build" ]; then mkdir build fi cd build cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages -DURANIUM_PLUGINS_DIR=/usr/lib/python3.4/dist-packages sudo make install cd ../.. cp -rv Uranium/resources/* Cura/resources/ sudo ln -s $PWD/CuraEngine/build/CuraEngine /usr/bin/CuraEngine cd Cura python3 cura_app.py #export PYTHONPATH=/usr/lib/python3/dist-packages
運行了很長時間,但結果不太妙啊。github
編譯結果出錯:shell
QWidget: Must construct a QApplication before a QWidget ./ubuntu-15.04-build-script.sh: 行 62: 29168 已放棄 (核心已轉儲) python3 cura_app.py
嗯,這但是最新的開發代碼呀!出點錯是很正常的。ubuntu
到https://github.com/ultimaker/Cura上去建立了個issue,提交上去,看誰能解決這個問題。bash
等了兩天,有其餘人報一樣的錯誤,但沒有解決辦法。只好本身再進一步研究。app
進python控制檯,一步一步運行源碼。發現主要是缺乏UM這個對象,這是Uranium的支持庫,發現被安裝到了/usr/local/lib/python3/dist-packages裏面。curl
設置:ui
export PYTHONPATH=/usr/local/lib/python3/dist-packages
再次運行,出現OpenGL的錯誤,多是VirtualBox虛擬機的問題。後面再繼續。url
更新全部的庫,能夠用這個腳本:
#!/bin/bash # This is a script which get the latest git repo and build them. # # Tested under ubuntu 15.04, lower versions don't have PyQT 5.2.1 which is required by cura cd ~ cd cura_dev cd protobuf git pull ./autogen.sh ./configure make -j4 sudo make install sudo ldconfig cd python python3 setup.py build sudo python3 setup.py install cd ../.. cd libArcus git pull cd build cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages make -j4 sudo make install cd ../../ cd CuraEngine git pull cd build cmake .. make -j4 cd ../../ cd Uranium git pull cd build cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages -DURANIUM_PLUGINS_DIR=/usr/lib/python3.4/dist-packages sudo make install cd ../.. cp -rv Uranium/resources/* Cura/resources/ sudo ln -s $PWD/CuraEngine/build/CuraEngine /usr/bin/CuraEngine cd Cura python3 cura_app.py
libgl出錯,多是虛擬機的問題,下次用物理機試試。
將Virtualbox的「顯示-三維加速」去掉,libgl就再也不報錯了。