编译环境:
环境:Ubuntu
The C compiler identification is GNU 9.3.0 (低于9.3的需要升级到9.3及以上)
The CXX compiler identification is GNU 9.3.0 (低于9.3的需要升级到9.3及以上)
时间:2020-11-30
代码位置: 当前用户的blender-git 文件夹下
编译过程参考自:https://wiki.blender.org/wiki/Building_Blender/Linux/Ubuntu
1、下载相关系统包
sudo apt-get update
sudo apt-get install build-essential git subversion cmake libx11-dev libxxf86vm-dev libxcursor-dev libxi-dev libxrandr-dev libxinerama-dev libglew-dev
2、 下载源码
mkdir ~/blender-git
cd ~/blender-git
git clone https://git.blender.org/blender.git
3、下载一些相关的blender 预编译好的库
cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
4、 update 和 编译
cd ~/blender-git/blender
make update
make
编译成功截图如下:
image中间可能遇到的报错问题:
GNUmakefile:316: recipe for target 'all' failed
查看错误文件:~/blender-git/build_linux/CMakeFiles/CMakeOutput.log
需要升级gcc版本:
GCC version must be at least 9.3 for precompiled libraries, found 7.4.0
具体升级gcc方法如下:
apt-get install software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install gcc-9
apt-get install g++-9
apt-get install mlocate
updatedb
locate gcc | grep -E "/usr/bin/gcc-[0-9]"
locate g++ | grep -E "/usr/bin/g\+\+-[0-9]"
cd /usr/bin
rm gcc
ln -s gcc-9 gcc
rm g++
ln -s g++-9 g++
升级gcc版本参考自:https://www.jianshu.com/p/a54c882ac513:
网友评论