Project

General

Profile

Actions

Installing Wt on Mac OS X Lion » History » Revision 2

« Previous | Revision 2/4 (diff) | Next »
Koen Deforche, 08/12/2013 02:17 PM


h1. Installing Wt on Mac OS X Lion

{{toc}}

The following are generic installation instructions for installing Wt (from source) on OS X 10.7 "Lion" and above. The installation instructions below use CLang + libc++. This toolchain is recommended as it is clearly the way forward on Mac OS X and it is supported best by the other XCode tools (Instruments, lldb Debugger, etc...).

Note that building with CLang (/usr/bin/c++) defaults (at the time of writing) to using the GNU stdlibc++. You need to pass @stdlib=libc++@ to select the new libc++, also in your own projects since these two standard library options are not binary compatible.

h2. Requirements

h2. Preparation

h3. Build Boost

The following builds and installs Boost in /usr/local:

$ echo 'using clang ;' > ~/user-config.jam
$ cd boost*
$ ./bootstrap.sh
$ sudo ./b2 --toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" install

If you would like to install in a different directory, you should add @--prefix=/custom/directory@ to the b2 command line options, and you will need to modify your dynamic library path:

$ export DYLD_LIBRARY_PATH=/custom/directory/lib:$DYLD_LIBRARY_PATH

h2. Building Wt

Get the "latest Wt version":http://sourceforge.net/projects/witty/files/wt/.

To build Wt, do the following:

$ cd wt-3*
$ mkdir build
$ cd build
$ cmake -DCMAKE_CXX_FLAGS='-stdlib=libc++' \
-DCMAKE_EXE_LINKER_FLAGS='-stdlib=libc++' \
-DCMAKE_MODULE_LINKER_FLAGS='-stdlib=libc++'
-DWT_CPP_11_MODE='-std=c++11' ../
$ make
$ make -C examples # to build the examples

_NOTE: If you used the --prefix option when compiling Boost, you must add @ -DBOOST_PREFIX=/custom/directory@ to the cmake command line.

You may receive warnings that not all features will be built, but Wt doesn't require those. You can of course install the other dependencies too, e.g. using portage. It doesn't matter that these other dependencies are built using gcc since these dependencies are C libraries and thus the libc++ issue does not exist.

To run the examples, please see the "generic installation instructions":http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html#examples.

Updated by Koen Deforche over 11 years ago · 2 revisions