jdksboost

This is J.D. Koftinoff Software, Ltd's modifications of the indispensable, freshly released boost version 1.39.0 c++ library from http://www.boost.org/

This version only changes minimal source code from the boost trunk. The objective of the changes to boost is purely to re-arrange the source files so that a simpler build system can be used.

Boost is very easy to use if you only need libraries that are header only - But for any non-trivial libraries like boost.thread or boost.asio, you must build library files.

Each boost sublibrary must be made into it's own archive because of file naming conflicts between cpp files in each library.

The current standard for building the library files for boost involves a build tool called bjam which is powerful but not easily integrated into the other build environments that I needed.

I decided that for some tools, like Microsoft Visual Studio and iphone and Mac OS X leopard, I really needed all of boost to be compiled by the same IDE project management tool so that I could make sure that all the various compile and linker options were applied correctly between the libraries and my main project. The boost libraries typically wanted to generated DLL's or .so files for dynamic linking even though these libraries are quite small and just fine to include as a static library. I also wanted to be able to easily have full access to the IDE based debugging tools of my main applications which may require compiler options that are not so straightforward to put into bjam

Getting Started

You can always get the latest version via svn via the command line:

svn co http://opensource.jdkoftinoff.com/jdksboost/svn/trunk jdksboost
cd jdksboost
ls scripts
./scripts/configure-linux-release.sh
make

In the svn repository is a bash script, create_jdksboost.sh, which is what generated the original jdksboost release directly from an original untouched boost release.

The original, untouched version of boost is available as a branch:

svn co http://opensource.jdkoftinoff.com/jdksboost/svn/branches/boost_1_39_0

The project utilizes my MagicMake system ( see http://opensource.jdkoftinoff.com/project/wiki/magicmake/Index ) to compile the project on posix/unix/macosx/linux based systems with g++.

The purpose of this is not 'just another build system' but a convention based project layout which makes it easy to compile from the command line and easy to create a project file for any IDE. Basically, in the 'src' directory are .cpp files to be compiled and in the include directory are .hpp files for the include path. Because some boost libraries have special considerations like win32 specific or posix specific or python specific, these .cpp files are placed in subdirectories in the src directory.

For instance if you wanted to compile all the normal boost libraries and the posix platform specific libraries as well, you could get by with just a single command line like:

g++ -I include src/*.cpp src/posix/*.cpp

There are also project files for Visual Studio 2005, Visual Studio 2008, Mac OS X Leopard four-way universal, Apple iPhone, and a .pro file for TrollTech's QMake/QtCreator.

All build systems and project files build a static library. On posix systems, the library is called libjdksboost.a and on windows it is jdksboost.lib.

Changes from boost v1.39.0

Other minor changes were added to boost:

  • All documentation, examples, and tests have been removed.
  • Patches from the boost trunk (1.39.0) up to and including the bugfixes in revision 54914 are integrated.
  • Win32 platforms default to _WIN32_WINNT aka WINVER set to 0x501 which means windows XP minimum target.
  • All boost libraries are statically linked.
  • long doubles are not properly supported on PPC targets, so all math functions suffixed by 'l' are disabled by default unless JDKSBOOST_HAS_LONG_DOUBLE is defined.
  • Apple iPhone targets are supported with an XCode 3.1.3 static library target.
  • Endian and long double changes to boost to allow compilation for iPhone hardware as well as the iPhone simulator target.

All of this code and my minor changes are released under the boost software license, for more information on the license see:

For a list of all the changesets I applied to boost, see:

iPhone usage

Using jdksboost in your iphone apps is easy:

First, grab a copy of jdksboost into your source directory

cd src
svn export http://opensource.jdkoftinoff.com/jdksboost/svn/trunk jdksboost

Now, open or create your iphone project in xcode.

In the "Groups and Files" panel, right click on your project and select "Add... -> Existing File...".

Navigate to the jdksboost/build/iphone/jdksboost directory and select the jdksboost.xcodeproj file.

Now in your project window you can open up the disclosure icon for jdksboost.xcodeproj. In there you will see "libjdksboost.a" - Drag and drop that to your Target's "Link Binary With Libraries" section.

Now you need to set your compiler include path to the jdksboost/include directory. Press CMD-I on your project and go to the build settings. In the "Search Path" section set the "Header Search Paths". This should be a relative path; for me I needed to enter "../../jdksboost/include" - Remember that if you want to use boost::tr1 read up on your options at http://www.boost.org/doc/libs/1_39_0/doc/html/boost_tr1/usage.html#boost_tr1.usage.native

That's it, you should be able to build and run your programs on the iphone even with boost::threads, boost::asio, and boost::whatever.

Final notes

As the official boost svn trunk gets updated, I will strive to merge important changes into jdksboost.

For more information, contact Jeff Koftinoff <>