2021-07-29 Ubantu18.04下Cura编译
Ubantu18.04下Cura編譯
版權聲明:本文為CSDN博主「微笑的云ryl」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/randyran/article/details/86522914
1.按照這個步驟走到 ln -s /usr/local/lib/python3/dist-packages/Arcus.so .會出現沒有Arcus.so文件,問題解決:在build在cmke 和 make一下就會出現Arcus.so
2.會缺少pyqt5-sip,問題解決:pip3 install pyqt5-sip
3. 再次過程中出現的問題都是pyqt5與sip不匹配的問題,解決辦法:下載 https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/
4. 最后運行./cura_app.py的時候會遇到:
File “/home/workstation/CuraEngine/Cura/cura/OAuth2/KeyringAttribute.py”, line 7, in
from keyring.errors import NoKeyringError, PasswordSetError, KeyringLocked
ImportError: cannot import name 'NoKeyringError,
解決辦法:暫未找到,在此記錄一下,希望路過的各路大神能給小白支支招
#準備工作,安裝好Ubuntu后,修改源設置,見 https://blog.csdn.net/randyran/article/details/86564754 中的第1步,以加快apt-get install X的速度。
CuraEngine編譯
編譯安裝protobuf
(1)安裝必要工具
sudo apt-get install autoconf automake libtool curl make g++ git
(2)下載 protobuf 庫
git clone https://github.com/protocolbuffers/protobuf
(3) cd protobuf
(4) git submodule update --init --recursive
(5) ./autogen.sh
(6) ./configure
(7) make -j4
(8) make check
(9) sudo make install
(10) sudo ldconfig #refresh shared library cache
安裝CMake
(1) sudo apt-get install build-essential
(2) wget http://www.cmake.org/files/v3.13/cmake-3.13.3.tar.gz
(3) tar xvf cmake-3.13.3.tar.gz
(4) cd cmake-3.13.3
(5) ./configure
(6) make -j4
(7) sudo apt-get install checkinstall
(8) sudo checkinstall
(9) sudo make install
安裝python3.6及python3.6-dev(Ubuntu18.04自帶Python3.6)
(1) sudo add-apt-repository ppa:jonathonf/python-3.6,隨后按Enter確認
(3) sudo apt-get update
(4) sudo apt-get install python3.6
(5) sudo apt-get install python3.6-dev
安裝python3-sip-dev
sudo apt-get install python3-sip-dev
編譯libArcus庫
git clone https://github.com/Ultimaker/libArcus.git
cd libArcus
mkdir build && cd build
cmake …
make
sudo make install
升級至C++11(如果是Ubuntu16及以上的用戶可以略過此步驟)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 gcc-4.9-multilib g+±4.9 g+±4.9-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g+±4.9 90
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
1
2
3
4
5
6
7
編譯安裝CuraEngine
git clone https://github.com/Ultimaker/CuraEngine.git
cd CuraEngine
mkdir build && cd build
cmake …
make
1
2
3
4
5
(參考 https://blog.csdn.net/phmatthaus/article/details/84143704 )
Cura編譯
本調試環境為Ubuntu 18.04 + Python 3.6 + Pycharm,環境配置見 https://blog.csdn.net/randyran/article/details/86564754
安裝依賴庫(git cmake已經在編譯CuraEngine時安裝了)
sudo apt-get install zlib1g-dev
sudo apt-get install python3-scipy python3-pip
sudo pip3 install Shapely -i https://pypi.tuna.tsinghua.edu.cn/simple
sudo pip3 install pyserial PyQt5==5.10 -i https://pypi.tuna.tsinghua.edu.cn/simple
安裝SIP
(1) 下載SIP 4.19.2+
https://www.riverbankcomputing.com/software/sip/download
(2) 解壓
tar xvf sip-4.19.13.tar.gz
(3) In the Terminal, navigate to the extracted folder:
$ cd [SIP PATH]
(4) Next, we will install SIP by running the following commands:
$ python3 configure.py
$ make
$ sudo make install
Savitar(目前使用的3.6 branch,master 4.0未測試)
(1) clone the libSavitar repository to a directory of your choosing (replace [LIBSAVITAR PATH]):
$ git clone https://github.com/Ultimaker/libSavitar.git [LIBSAVITAR PATH]
(2) Go to the repository directory, and create a build directory and switch to it:
$ cd [LIBSAVITAR PATH]
$ mkdir build && cd build
(3) Configure and build libSavitar using the following commands:
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=VIRTUALENV?DCMAKEPREFIXPATH=VIRTUAL_ENV -DCMAKE_PREFIX_PATH=VIRTUALE?NV?DCMAKEP?REFIXP?ATH=VIRTUAL_ENV -DBUILD_STATIC=ON -DBUILD_PYTHON=ON -DBUILD_EXAMPLES=OFF …
$ make -j4
$ sudo make install
Charon
clone the libCharon repository to a directory of your choosing (replace [LIBCHARON PATH]):
$ git clone https://github.com/Ultimaker/libCharon.git
[LIBCHARON PATH]
Go to the repository directory, and create a build directory and switch to it:
$ cd [LIBCHARON PATH]
$ mkdir build && cd build
Configure and build libCharon using the following commands:
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=VIRTUALENV?DCMAKEPREFIXPATH=VIRTUAL_ENV -DCMAKE_PREFIX_PATH=VIRTUALE?NV?DCMAKEP?REFIXP?ATH=VIRTUAL_ENV …
$ make -j4
$ sudo make install
CuraEngine
Clone the CuraEngine repository to a directory of your choosing (replace [CURAENGINE PATH]):
$ git clone https://github.com/Ultimaker/CuraEngine.git [CURAENGINE PATH]
Go to the repository directory, and create a build directory and switch to it:
$ cd [CURAENGINE PATH]
$ mkdir build && cd build
Configure and build CuraEngine using the following commands:
$ cmake …
$ make -j4
$ sudo make install
Cura & Uranium
Clone the Cura, Uranium, and fdm_materials repositories to directories of your choosing (replace [CURA PATH], [URANIUM PATH], and [FDM_MATERIALS PATH]):
$ git clone https://github.com/Ultimaker/Cura.git [CURA PATH]
$ git clone https://github.com/Ultimaker/Uranium.git [URANIUM PATH]
$ git clone https://github.com/Ultimaker/fdm_materials.git [FDM_MATERIALS PATH]
鏈接模塊及庫
在Cura目錄下執行“Open in Terminal”,依次執行步驟將模塊和庫軟鏈接至Cura目錄下
(1)Charon
ln -s /lib/python3/dist-packages/Charon .
(2)Uranium目錄下的UM
ln -s /home/[你的用戶名]/Uranium/UM .
(3)Arcus
ln -s /usr/local/lib/python3/dist-packages/Arcus.so .
(4)Savitar
ln -s /lib/python3/dist-packages/Savitar.so .
(5)CuraEngine
ln -s /home/ryl/CuraEngine/build/CuraEngine .
mkdir resources/materials
ln -s [FDM_MATERIALS PATH] resources/materials/fdm_materials
至此,就可以在Pycharm中run cura_app.py了。
Happy enjoy!
總結
以上是生活随笔為你收集整理的2021-07-29 Ubantu18.04下Cura编译的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机毕业设计Java家电售后管理系统演
- 下一篇: OpenCV 高级形态学函数cv2.mo