[Bf-committers] External libs builder for Windows [v2013.01.18]

Chad Fraleigh chadf at triularity.org
Thu Jan 24 03:51:16 CET 2013


On Sat, Jan 19, 2013 at 9:59 AM, Brecht Van Lommel
<brechtvanlommel at pandora.be> wrote:
> Great work! So have you been able to build Blender with these
> libraries, does it need build system changes too or do things get
> installed in the same directory structure as before?

I was able to build blender (VS2008/32-bit) with the following libs
replaced with ones I built by script:

boost
freetype
jpeg
lapack
lcms
llvm
openal
opencollada
opencolorio
openexr
openimageio
png
pthreads
python
samplerate
sdl
tiff
zlib


I had to do some more tweaks with the scripts to fix the include names
in some cases and copying some libs to legacy names, and roll boost
back to 1.49 (while updating libs one-by-one since old boost name
implib's existed -- but now I can try 1.52 again). I'll try to upload
an updated lib-builder zip soon. I also had to make a few temp mods to
the cmake files since I split out some of the bundled libs into their
own package:

 -<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-

Index: blender/source/creator/CMakeLists.txt
===================================================================
--- blender/source/creator/CMakeLists.txt       (revision 54059)
+++ blender/source/creator/CMakeLists.txt       (working copy)
@@ -599,7 +599,7 @@
                install(
                        FILES
                                ${LIBDIR}/openal/lib/OpenAL32.dll
-                               ${LIBDIR}/openal/lib/wrap_oal.dll
+#                              ${LIBDIR}/openal/lib/wrap_oal.dll
                        DESTINATION ${TARGETDIR}
                )
        endif()
Index: blender/CMakeLists.txt
===================================================================
--- blender/CMakeLists.txt      (revision 54059)
+++ blender/CMakeLists.txt      (working copy)
@@ -903,6 +903,7 @@
                set(OPENAL ${LIBDIR}/openal)
                set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
                set(OPENAL_LIBRARY wrap_oal)
+set(OPENAL_LIBRARY OpenAL32)
                set(OPENAL_LIBPATH ${OPENAL}/lib)
        endif()

@@ -1070,7 +1071,9 @@
                if(WITH_IMAGE_OPENEXR)
                        set_lib_path(OPENEXR "openexr")
                        set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
+set(OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR} ${LIBDIR}/ilmbase/include)
                        set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
+set(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIRS}
${LIBDIR}/ilmbase/include/OpenEXR)
                        set(OPENEXR_LIBPATH ${OPENEXR}/lib)
                        set(OPENEXR_LIBRARIES
                                ${OPENEXR_LIBPATH}/Iex.lib
@@ -1079,6 +1082,13 @@
                                ${OPENEXR_LIBPATH}/Imath.lib
                                ${OPENEXR_LIBPATH}/IlmThread.lib
                        )
+set(OPENEXR_LIBRARIES
+       ${LIBDIR}/ilmbase/lib/Iex.lib
+       ${LIBDIR}/ilmbase/lib/Half.lib
+       ${OPENEXR_LIBPATH}/IlmImf.lib
+       ${LIBDIR}/ilmbase/lib/Imath.lib
+       ${LIBDIR}/ilmbase/lib/IlmThread.lib
+)
                endif()

                if(WITH_IMAGE_TIFF)
@@ -1164,6 +1174,9 @@
                        set(OPENCOLORIO_LIBRARIES OpenColorIO)
                        set(OPENCOLORIO_LIBPATH ${LIBDIR}/opencolorio/lib)
                        set(OPENCOLORIO_DEFINITIONS)
+set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES} optimized tinyxml
debug tinyxml_d)
+set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES} optimized
libyaml-cppmt debug libyaml-cppmtd)
+set(OPENCOLORIO_LIBPATH ${OPENCOLORIO_LIBPATH} ${LIBDIR}/tinyxml/lib
${LIBDIR}/yaml/lib)
                endif()

 -<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-

Those changes could be done with something more permanent by adding
WITH_TINYXML, WITH_YAML, WITH_ILMBASE, and maybe WITH_OPENAL_SOFT (the
soft version doesn't need/have wrap_oal anymore) which would allow old
or new libs to be used during a [good 'old known libs vs iffy new
sparkly libs] transition phase.

I can build/link and start blender fine, but I didn't do any real
testing to exercise each lib. Also, since I built the soft version of
openal, it comes up with this message on start:

AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead

I saw some other references to this online (with linux where I guess
openal-soft is the system version). I'm not sure if it is a serious
error. I also saw mention of another openal problem where someone's
code worked fine until they switched to the soft version and had to
correct their code -- this might imply the soft lib is less forgiving
of API usage errors than the old one, if there are also such broken
usages in the blender code.

But on the plus side, some of the 32-bit vs 64-bit lib names would be
simplified as these scripts always build the same names (no more
special case for libz on win64). I also build a debug version of each
lib (which only exist for some svn ones now), so debugging of errors
that happen while calling these libs might be easier to trace.


-Chad


More information about the Bf-committers mailing list