温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

3D打印控制软件Cura源码如何在UbuntuKylin15.04上编译

发布时间:2021-11-16 09:48:52 来源:亿速云 阅读:303 作者:小新 栏目:互联网科技

这篇文章主要介绍了3D打印控制软件Cura源码如何在UbuntuKylin15.04上编译,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

Cura在Linux上的版本总是下载不了,准备自己从源码进行编译。

下面是从https://github.com/ultimaker上下载的编译脚本。原始的脚本有一些问题,自己做了一些修改,如下:

#!/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

运行了很长时间,但结果不太妙啊。

编译结果出错:

QWidget: Must construct a QApplication before a QWidget
./ubuntu-15.04-build-script.sh: 行 62: 29168 已放弃               (核心已转储) python3 cura_app.py

嗯,这可是最新的开发代码呀!出点错是很正常的。

到https://github.com/ultimaker/Cura上去创建了个issue,提交上去,看谁能解决这个问题。

等了两天,有其他人报同样的错误,但没有解决办法。只好自己再进一步研究。

进python控制台,一步一步运行源码。发现主要是缺少UM这个对象,这是Uranium的支持库,发现被安装到了/usr/local/lib/python3/dist-packages里面。

设置:

export PYTHONPATH=/usr/local/lib/python3/dist-packages

再次运行,出现OpenGL的错误,可能是VirtualBox虚拟机的问题。后面再继续。

更新所有的库,可以用这个脚本:

#!/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就不再报错了。

感谢你能够认真阅读完这篇文章,希望小编分享的“3D打印控制软件Cura源码如何在UbuntuKylin15.04上编译”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI