﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FDoc%2FBuilding_Blender%2FLinux%2FChroot</id>
	<title>Dev:2.4/Doc/Building Blender/Linux/Chroot - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.blender.jp/index.php?action=history&amp;feed=atom&amp;title=Dev%3A2.4%2FDoc%2FBuilding_Blender%2FLinux%2FChroot"/>
	<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/Building_Blender/Linux/Chroot&amp;action=history"/>
	<updated>2026-06-02T10:38:05Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/Building_Blender/Linux/Chroot&amp;diff=58556&amp;oldid=prev</id>
		<title>Yamyam: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/Building_Blender/Linux/Chroot&amp;diff=58556&amp;oldid=prev"/>
		<updated>2018-06-28T17:54:01Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2018年6月28日 (木) 17:54時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Yamyam</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/Building_Blender/Linux/Chroot&amp;diff=58555&amp;oldid=prev</id>
		<title>wiki&gt;Brecht: moved Dev:Doc/Building Blender/Linux/Chroot to Dev:2.4/Doc/Building Blender/Linux/Chroot</title>
		<link rel="alternate" type="text/html" href="https://wiki.blender.jp/index.php?title=Dev:2.4/Doc/Building_Blender/Linux/Chroot&amp;diff=58555&amp;oldid=prev"/>
		<updated>2013-11-13T05:14:21Z</updated>

		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/Dev:Doc/Building_Blender/Linux/Chroot&quot; class=&quot;mw-redirect&quot; title=&quot;Dev:Doc/Building Blender/Linux/Chroot&quot;&gt;Dev:Doc/Building Blender/Linux/Chroot&lt;/a&gt; to &lt;a href=&quot;/Dev:2.4/Doc/Building_Blender/Linux/Chroot&quot; title=&quot;Dev:2.4/Doc/Building Blender/Linux/Chroot&quot;&gt;Dev:2.4/Doc/Building Blender/Linux/Chroot&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is a basic document for setting up a chroot environment so you can build a Blender Release under Linux.  As I get more time I'll try to make it more readable.&lt;br /&gt;
&lt;br /&gt;
D.J. Capelis provided the help initially for me to get a chroot environment for building the 64-bit linux releases.  Most of the information here is derived from that work, so kudos to him for all his help.  His chroots were based on the latest stable Debian releases.  I followed his practice until the 2.46 release, which required gcc 4.2 for OpenMP support.  The testing Debian release does support  gcc 4.2, so for that release I broke the practice.   &lt;br /&gt;
&lt;br /&gt;
== Setting up the Chroot Itself ==&lt;br /&gt;
For now, the script below (on my Ubuntu machine) will create the chroot environment I used to build the 2.46 releases.  If you're not running Ubuntu or some Debian-based distro, you'll need to do a little work at first to get the basic files needed to start the Debian setup.  You need to have '''dchroot''' (or '''schroot''') installed on your system as well in order to access the environment.&lt;br /&gt;
&lt;br /&gt;
In addition to the basic chroot files, you need to add packages required for building Blender.  The following should be saved into a file named '''/tmp/Dev-chroot-packages''' before starting.  If your system has wget installed, you can just uncomment the line in the script to automatically grab it.&lt;br /&gt;
&lt;br /&gt;
[[Media:Dev-chroot-packages]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/tcsh&lt;br /&gt;
# Script to install the basic chroot; set the variables below as needed&lt;br /&gt;
&lt;br /&gt;
#   set the location for the chroot &lt;br /&gt;
set CHROOT='/chroot'&lt;br /&gt;
#   set the architecture type: i386 and amd64 have been tested&lt;br /&gt;
set ARCH='i386'&lt;br /&gt;
#   Pick your favorite mirror from http://www.debian.org/mirror/list&lt;br /&gt;
set SOURCE='http://ftp.debian.org/debian/'&lt;br /&gt;
&lt;br /&gt;
sudo apt-get install dchroot debootstrap&lt;br /&gt;
sudo mkdir $CHROOT&lt;br /&gt;
echo &amp;quot;blenderenv $CHROOT&amp;quot; | sudo tee -a /etc/dchroot.conf&lt;br /&gt;
sudo debootstrap --resolve-deps --arch $ARCH etch $CHROOT $SOURCE&lt;br /&gt;
echo &amp;quot;/tmp $CHROOT/tmp none bind 0 0&amp;quot; |sudo tee -a /etc/fstab&lt;br /&gt;
echo &amp;quot;/dev $CHROOT/dev none bind 0 0&amp;quot;  |sudo tee -a /etc/fstab&lt;br /&gt;
echo &amp;quot;/home $CHROOT/home none bind 0 0&amp;quot;  |sudo tee -a /etc/fstab&lt;br /&gt;
echo &amp;quot;/proc $CHROOT/proc proc defaults 0 0&amp;quot;  |sudo tee -a /etc/fstab&lt;br /&gt;
sudo mount -a&lt;br /&gt;
# (cd /tmp ; wget http://wiki.blender.org/uploads/6/64/Dev-chroot-packages)&lt;br /&gt;
sudo chroot $CHROOT apt-get update&lt;br /&gt;
sudo chroot $CHROOT apt-get install locales&lt;br /&gt;
grep en_US $CHROOT/usr/share/i18n/SUPPORTED | sudo tee -a $CHROOT/etc/locale.gen&lt;br /&gt;
sudo chroot $CHROOT locale-gen&lt;br /&gt;
cat /tmp/Dev-chroot-packages | sudo chroot $CHROOT dpkg --set-selections&lt;br /&gt;
sudo chroot $CHROOT apt-get --yes dselect-upgrade&lt;br /&gt;
sudo cp /etc/passwd /etc/shadow /etc/group /etc/sudoers /etc/hosts $CHROOT/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you should be able to go into the chroot environment using '''dchroot''' or '''schroot''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dchroot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have more than one chroot set up, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dchroot -c blenderenv&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing GCC 4.2 ==&lt;br /&gt;
&lt;br /&gt;
The cloth modifier was added in the 2.46 release and takes advantage of OpenMP, which requires GCC 4.2 or later.  Unfortunately, Debian &amp;quot;Etch&amp;quot; (the stable release) uses GCC 4.1.  Upgrading to Debian &amp;quot;Lenny&amp;quot; (the next release) fixes this but also upgrades '''libc.so''' to a later version than other distros aren't using yet.  The solution in the meantime is to build our own GCC 4.2 for Etch.  After this, we also need to patch one fo the OpenAL include files which breaks with GCC 4.2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/tcsh&lt;br /&gt;
# Script to build and install GCC; set the variable below as needed&lt;br /&gt;
&lt;br /&gt;
#   set the location for the chroot &lt;br /&gt;
set CHROOT='/chroot'&lt;br /&gt;
&lt;br /&gt;
cd /tmp&lt;br /&gt;
wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.2.3/gcc-core-4.2.3.tar.bz2&lt;br /&gt;
wget ftp://mirrors.kernel.org/gnu/gcc/gcc-4.2.3/gcc-g++-4.2.3.tar.bz2&lt;br /&gt;
tar xjf gcc-core-4.2.3.tar.bz2&lt;br /&gt;
tar xjf gcc-g++-4.2.3.tar.bz2&lt;br /&gt;
rm gcc-core-4.2.3.tar.bz2&lt;br /&gt;
rm gcc-g++-4.2.3.tar.bz2&lt;br /&gt;
mkdir build&lt;br /&gt;
sudo chroot $CHROOT /bin/sh -c &amp;quot;cd /tmp/build &amp;amp;&amp;amp; \&lt;br /&gt;
../gcc-4.2.3/configure --enable-shared=libgcc --disable-multilib --program-suffix=-4.2 &amp;amp;&amp;amp; \&lt;br /&gt;
make &amp;amp;&amp;amp; make install&amp;quot;&lt;br /&gt;
sudo rm -rf /tmp/build&lt;br /&gt;
&lt;br /&gt;
# patch the OpenAL include file to work with GCC 4.2&lt;br /&gt;
&lt;br /&gt;
sed &amp;quot;s/ALC\(void *)\)/\1/&amp;quot; $CHROOT/usr/include/AL/alc.h &amp;gt;/tmp/alc.h&lt;br /&gt;
sudo cp /tmp/alc.h $CHROOT/usr/include/AL&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In theory, this will build GCC and the necessary libraries.  We don't want most of the shared libraries (or at least not put where we can accidentally link to them), so the &amp;quot;--enable-shared=libgcc&amp;quot; only builds the minimal libraries.  All these files will be installed in /usr/local.&lt;br /&gt;
&lt;br /&gt;
== Building Blender ==&lt;br /&gt;
&lt;br /&gt;
I build blender using '''scons'''.  You may feel better using '''make'''.  If so, you're on your own.&lt;br /&gt;
&lt;br /&gt;
We build releases which differ in whether OpenGL is statically or dynamically linked, and in which Python version is supported.  Currently Python 2.4 and 2.5 are supported, so there are four builds for each platform.&lt;br /&gt;
&lt;br /&gt;
For all releases, all other special libraries (like '''png''' '''openal''', '''openexr''', etc) are linked statically. This is a bit of a pain since the order that '''scons'''  spits out the libraries is (to my perception) arbitrary and so it's hard to use linker options like '''-Bstatic''' and have them work.  My workaround has been to set up by hand symbolic links to the static libraries in a separate directory and tell '''scons''' to use those.&lt;br /&gt;
&lt;br /&gt;
I'll put more instructions in about this part later, but for now you can download a tarball here:&lt;br /&gt;
&lt;br /&gt;
http://www1.pacific.edu/~khughes/blender/chroot-config.tar.bz2&lt;br /&gt;
&lt;br /&gt;
To install it, cd into the directory ''above'' ''blender/''' and untar it.  When you finish you should see something like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# ls&lt;br /&gt;
build/        chroot-compile.py       install/&lt;br /&gt;
blender/      chroot-config.tar.bz2   staticlibs/&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It would be a good idea to cd into '''staticlibs/''' and run the '''relink.py''' script there.  This will double-check that all the symbolically linked static libraries are valid.&lt;br /&gt;
&lt;br /&gt;
You can now change into '''blender/''' and type '''../chroot-compile.py VERSION=2.46-RC2'''.  This will cause all four releases to be built and placed in '''../install/'''.&lt;br /&gt;
&lt;br /&gt;
In fact, you can do this all at once:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd blender &amp;amp;&amp;amp; dchroot -c blenderenv -d ../chroot-compile.py VERSION=2.46-RC2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Hint''': If you haven't built GCC 4.2 as shown above, you will probably have a copy of libgomp.so installed somewhere.  This isn't good for a static build.  If so, you will need to uncomment the following line at the end of '''user-config.py''' and make sure there is a symbolic link for this in your '''staticlibs''' directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#LLIBS+=' gomp-static'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, just turn off OpenMP in '''user-config.py''' (WITH_BF_OPENMP=False).&lt;br /&gt;
&lt;br /&gt;
[[Category:Script]]&lt;/div&gt;</summary>
		<author><name>wiki&gt;Brecht</name></author>
		
	</entry>
</feed>