curaengine linux编译,Cura源码在Ubuntu15.04上编译脚本(成功)

Cura是著名的3D打印切片和控制软件。新的版本采用Qt和Python进行了重构,界面变化也非常大,目前还在开发中,运行问题还有不少。这里介绍如何从源代码进行Cura的编译,可以抢先体验新版的界面设计和根据需要进行订制。

这个把相关的脚本都集成到一起了。做了几个重要的改进,基本可以成功运行了。

主要的改进包括:

1、可以自动判断目录,如没有自动创建,如有则进行源码更新。原脚本安装后更新需要手工一步步进行,很麻烦。

2、改变gtest的安装源到github,原来的是从google下载,由于国内访问不到会导致编译出错。

3、合并 plugins目录,将Uranium\plugins复制到Cura\plugins下,避免找不到插件的错误。

注意:

1、进libArcus将Cmakelists.txt里的add_subdirectory(examples)这一行注释掉,要不编译不过去。

2、目前CuraEngine编译还有些问题,无法执行切片操作。

把下面的内容保存到cura.sh,然后sudo chmod +x cura.sh添加执行权限,然后./cura.sh就Ok了。需要的软件会自动下,时间较长,需要耐心等待。

#!/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 "dev" ]; then

mkdir dev

fi

cd dev

sudo apt-get install -y git cmake cmake-gui autoconf libtool python3-setuptools curl python3-pyqt5.* python3-numpy qml-module-qtquick-controls

#protobuf.

#https://github.com/google/protobuf.git

echo "================================="

echo "Install Protobuf."

if [ ! -d "protobuf" ]; then

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

cd protobuf

else

cd protobuf

git pull

fi

echo "================================="

echo "get gtest."

if [ ! -d "gtest" ]; then

git clone https://github.com/kgcd/gtest.git

else

git pull

fi

echo "================================="

echo "get gmock."

if [ ! -d "gmock" ]; then

git clone https://github.com/krzysztof-jusiak/gmock.git

else

git pull

fi

echo "Build Protobuf."

./autogen.sh

./configure --prefix=/usr

make -j4

sudo make install

sudo ldconfig

cd python

python3 setup.py build

sudo python3 setup.py install

cd ../..

echo "================================="

echo "Install libArcus."

if [ ! -d "libArcus" ]; then

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

cd libArcus

else

cd libArcus

git pull

fi

if [ ! -d "build" ]; then

mkdir build

fi

cd build

#cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages

cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages

make -j4

sudo make install

cd ../../

echo "================================="

echo "Install CuraEngine."

if [ ! -d "CuraEngine" ]; then

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

cd CuraEngine

else

cd CuraEngine

git pull

fi

if [ ! -d "build" ]; then

mkdir build

fi

cd build

#cmake .. -DCMAKE_INSTALL_PREFIX=/usr

cmake ..

make -j4

sudo make install

cd ../../

echo "================================="

echo "Install Uranium."

if [ ! -d "Uranium" ]; then

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

cd Uranium

else

cd Uranium

git pull

fi

if [ ! -d "build" ]; then

mkdir build

fi

cd build

#cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages -DURANIUM_PLUGINS_DIR=/usr/lib/python3.4/dist-packages

cmake .. -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python3.4/dist-packages -DURANIUM_PLUGINS_DIR=/usr/lib/python3.4/dist-packages

sudo make install

cd ../..

echo "================================="

echo "Install Cura."

if [ ! -d "Cura" ]; then

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

cd Cura

else

cd Cura

git pull

fi

cd ..

echo "Build finished."

echo "============================================================================"

echo "Merge Resource into Cura/resources/"

cp -rv Uranium/resources/* Cura/resources/

echo "Merge Plugins into Cura/plugins/"

cp -rv Uranium/plugins/* Cura/plugins/

echo "Link:"$PWD"/CuraEngine/build/CuraEngine"

sudo ln -s $PWD/CuraEngine/build/CuraEngine /usr/bin/CuraEngine

echo "Starting Cura......"

cd Cura

python3 cura_app.py

echo "You need add to /etc/profile:export PYTHONPATH=/usr/lib/python3/dist-packages"

echo "============================================================================="

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值