Difference between revisions of "Building third party libraries for the COLLADA DOM"
|Line 62:||Line 62:|
PCRE comes with [http://www.cmake.org/HTML/Index.html CMake] files so you can generate the appropriate build files for Visual Studio. You need to build separate libs for
PCRE comes with [http://www.cmake.org/HTML/Index.html CMake] files so you can generate the appropriate build files for Visual Studio. You need to build separate libs for , as they're not compatible.
Revision as of 20:12, 16 April 2008
The COLLADA DOM uses several third-party libraries. This document explains how to rebuild these libraries for each of the supported platforms. This is intended more for the COLLADA DOM maintainers than DOM users. Because all the third party libraries necessary to build the DOM on a particular platform are provided in the external-libs folder, most users shouldn't need to rebuild these libraries.
Release vs. Debug
It's not expected that you'll debug the third party libs via the DOM, so the DOM only provides release builds of the third party libs. It's expected that you'll link both the release and debug versions of your app against the release version of these libs.
However in some cases Visual Studio has problems linking a debug version of an app against a release version of a library (in some cases it works fine). When Visual Studio doesn't like linking the release version of one of these libs into the debug version of an app, we also provide a debug version of the lib. Currently this is necessary for PCRE and Boost filesystem. When we need to provide a debug lib we strip the debug info from the build to reduce download size.
If you actually need to debug into one of the third party libs for some reason you'll need to provide your own debug build and rebuild the DOM to link against it.
PS3 host system
The instructions for building PS3 libs assumes that you're using Linux as the host system. They should still work properly if you're using Windows as the host system, but that hasn't been tested.
Why do our own build of libxml?
Get the source files
First, download the libxml source. We're currently using version 2.6.29, which was released June 12th 2007. We also build with zlib support, so you'll need to download that too. We don't need the source, just the headers and libs, and Igor Zlatkovic provides the appropriate files for Windows.
Pick a compiler
"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat"
Now navigate to the win32 folder in libxml. Run "cscript configure.js help" to get a listing of all the build options. For our build, we want to disable iconv and enable zlib. Enabling zlib support in libxml allows the DOM to transparently load zlib or gzip compressed files. Execute these commands:
cscript configure.js iconv=no zlib=yes include=c:\misc\zlib-1.2.3\include lib=c:\misc\zlib-1.2.3\lib prefix=c:\misc\libxmlBuildOutput nmake /f Makefile.msvc nmake /f Makefile.msvc install
Linux and Mac
On Linux and Mac, we just use the stock libxml that comes with the system, so we don't need to worry about building it ourselves.
On PS3 we use TinyXml for XML parsing instead of libxml. It's possible to get libxml building on PS3, but we don't need it for now.
The DOM has been tested with TinyXml version 2.5.3, released on May 6th 2007. The only platform that actually requires TinyXml usage is the PS3.
Download TinyXml. It comes with Visual Studio .sln files for building.
Download TinyXml and copy the makefile from <dom-path>/external-libs/tinyxml/build to the TinyXml folder you downloaded. Then open a shell and go to the TinyXml path and run "make". The output lib file is linux/libtinyxml.a.
Same as Linux, except run "make platform=ps3". The output lib file is ps3/libtinyxml.a.
The DOM has been tested against PCRE version 7.4. All platforms require PCRE.
PCRE comes with CMake files so you can generate the appropriate build files for Visual Studio. You need to build separate libs for each supported version of Visual Studio, as they're not compatible. Also, debug builds are needed for PCRE. Don't forget to disable debug info in the debug project settings.
env CXXFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \ CFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \ LDFLAGS="-arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk" \ ./configure --disable-dependency-tracking
The -isysroot specifications seem to only be necessary on Tiger PowerPC systems building universal binaries. This information was taken from here.
Download and extract PCRE. Copy the entire "ps3" directory from <dom-path>/external-libs/pcre/build to the pcre folder you downloaded. Open a shell and go to the pcre/ps3 directory and run "make".
The Boost filesystem library is used in the DOM automated tests, but it currently isn't used by the DOM itself. That might change in the future though. The DOM (or rather, domTest) has been tested with Boost 1.34.1.
Use the Windows installer to install Boost on your system, and pick out the filesystem .lib files. We use the static boost filesystem libs that link against the multi-threaded DLL version of the C++ runtime. We need both VS 2003 and VS 2005 libs, as VS 2005 can't use the 2003 libs.
On Mac we need a universal binary, so the Boost build system has to be tweaked somewhat. Download and extract Boost 1.34.1 on your system. Copy the makefile from <dom-path>/external-libs/boost/build/filesystem to <boost-path>/libs/filesystem/build. Then go to <boost-path>/libs/filesystem/build in a terminal and run "make".
Same as Mac, except you need to copy operations.cpp from <dom-path>external-libs/boost/build/filesystem to <boost-path>/libs/filesystem/src. Then run "make platform=ps3".