RobynsVeil opened this issue on Nov 02, 2012 · 6 posts
RobynsVeil posted Fri, 02 November 2012 at 8:00 PM
Much to my chagrin, I'll admit to having posted parts of this elsewhere on the 'net. The lukewarm response (on BA, for example) indicates something: not sure if it's too-hard basket, most people are essentially consumers, most are content with the already-fairly-frequent releases of Blender by Blender.org... or some other reason I haven't devined as yet.
The desire to build my own copy of Blender initially grew out of a misconception, really: I thought that in order to solve my CUDA-activation problem in Blender, I had to build it myself, setting specific flags... or something (grey area). Come to find out that for NVidia and Linux Mint 13 (and Ubuntu 12.04 as well, I suspect, as Mint is based on Ubuntu) to play happily together, you actually had to install something called a CUDA Toolkit. Installed this (after I did the exercise of actually building my own Blender from svn) and all builds suddenly saw and used CUDA, which was critical if you wanted to take advantage of GPU-rendering in Cycles.
The steps were reasonably straight-forward, and I'd be happy to outline IF there is an interest and/or need, defined by someone actually having a read of this thread and responding with a request.
So, I managed to build my own. YAY. Still, saying that, I'm finding myself being sucked deeper and deeper into the arcane Linux "build-yer-own" world only because I want more! So, here's the deal:
I actually have my main version of Blender build refreshing almost every week via ppa from irie (shinsuke)... one of the advantages of Linux over Windows is this concept of software updates via Update Manager and ppa, where software versions are updated along with the operating system. This is currently on revision 51462. To Windows users, having the latest-greatest bleeding-edge version may seem a bit over-the-top, but there is a rationale for having that extremely-recent build: bug fixes. There were at 211 reported bugs when 2.64 was released, which count is now down to 107! So, the builds are cleaner, thus worthwhile getting.
But, whilst this latest-greatest from ppa included support of jpgs and tiffs, the libraries I was using to build my own from source (the svn) did not. So, my flavours could only see pngs in Cycles preview and render. The easy solution would be to simply convert the jpgs to pngs and wait for the Boost and OiiO libraries on svn to be updated, but one would miss an opportunity to learn something, wouldn't one?
I mentioned Boost and OiiO: Blender uses these external (open-source) libraries to manage colour and rendering and textures and all that: so I downloaded the source files for Boost and OpenImageIO from their respective sites and very briefly examined the instructions (when i should have been reading them carefully).
Compiling Boost was no dramas at all, simply following these instructions, downloading the most recent version of Boost - currently at 1.51) and copying and pasting (and running) this in Terminal:
sudo apt-get install git-core
mkdir blender-cycles
cd blender-cycles
mkdir boost
cd boost
... then moving your Boost file into the /blender-cycles/boost/ folder and:
tar xzf boost_1_51_0.tar.gz
cd boost_1_51_0/
./bootstrap.sh
./bjam -j4 variant=release link=static threading=multi --with-filesystem --with-thread --with-regex --with-system --with-date_time stage install --prefix=../
cd ../..
All this happened without a hitch. The came OiiO:
git clone git://github.com/OpenImageIO/oiio.git
cd oiio
git checkout RB-0.10
mkdir -p build/linux
cd build/linux
cmake ../../src/ -DBUILDSTATIC=1 -DBOOST_CUSTOM=1 -DBoost_INCLUDE_DIRS=pwd
/../../../boost/include/ -DBoost_LIBRARY_DIRS=pwd
/../../../boost/lib -DBoost_LIBRARIES="boost_date_time;boost_filesystem;boost_thread;boost_regex;boost_system" -DCMAKE_INSTALL_PREFIX=pwd
/../../dist/linux
...all THIS ran fine without errors, but then:
make -j4 install
...generated HEAPS of errors:
<pre class="de1">
<em>Scanning dependencies of target OpenImageIO</em><br></br><em>[ 1%] [ 2%] [ 2%] [ 3%] </em><br></br><em>Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebuf.cpp.o</em><br></br><em>Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo_orient.cpp.o</em><br></br><em>Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/formatspec.cpp.o</em><br></br><em>Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebufalgo.cpp.o</em><br></br><em>/home/robyn/oiio/src/libOpenImageIO/imagebuf.cpp:40:32: fatal error: boost/scoped_ptr.hpp: </em><br></br><em>No such file or directory compilation terminated.</em><br></br><em>/home/robyn/oiio/src/libOpenImageIO/formatspec.cpp:37:31: fatal error: boost/tokenizer.hpp: </em><br></br><em>No such file or directory compilation terminated.</em><br></br><em>make[2]: *** [libOpenImageIO/CMakeFiles/OpenImageIO.dir/imagebuf.cpp.o] Error 1</em><br></br><em>make[2]: *** Waiting for unfinished jobs....</em><br></br><em>make[2]: *** [libOpenImageIO/CMakeFiles/OpenImageIO.dir/formatspec.cpp.o] Error 1</em><br></br><em>make[1]: *** [libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error 2</em><br></br><em>make: *** [all] Error 2</em>
... which snag I finally figured out was caused by this:
Remember that you need to set the environment variable
IMAGEIO_LIBRARY_PATH to point to the 'lib' directory where OpenImageIO
is installed, or else it will not be able to find the plugins.
This was in the README. And in the INSTALL:
After you build OpenImageIO, if you compiled with the EMBEDPLUGINS=0 flag
you will need to set the environment variable OIIO_LIBRARY_PATH to point
to the 'lib' directory where OpenImageIO is installed, or else it will
not be able to find the plugins.
...but on the OiiO wiki:
You will need to set the environment variable THIRD_PARTY_TOOLS_HOME to the dist area of the external tools, in order for the OIIO build to recognize it.
All well and good, but:
-- which env var is it?
-- which folder is it actually after?
-- how does one set an environment variable in Linux, anyway?
For the last question, I'm suspecting that this is done in Terminal just prior to running that final make -j4 install and that the syntax is along the lines of:
export THIRD_PARTY_TOOLS_HOME=/path/to/external/dist/ARCH
...but questions remain. On my system this would boil down to:
export THIRD_PARTY_TOOLS_HOME=~/oiio/build/linux
but what about the OIIO_LIBRARY_PATH environment variable?
Any clues?
Anyone still awake? :lol:
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]