Project

General

Profile

Installing Wt on Mac OS X Lion » History » Version 4

Wim Dumon, 11/28/2013 06:07 PM

1 1 Koen Deforche
h1. Installing Wt on Mac OS X Lion
2
3
{{toc}}
4
5 2 Koen Deforche
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...).
6 1 Koen Deforche
7
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.
8
9
h2. Requirements 
10
11
* Get "Xcode":http://developer.apple.com/tools/xcode/ to get the compilers and basic libraries.
12
* Get "CMake":http://www.cmake.org/cmake/resources/software.html.
13
* Download "Boost 1.54.0":http://www.boost.org/users/download/ (why not, use the latest version).
14
15
h2. Preparation 
16
17
h3. Build Boost
18
19
The following builds and installs Boost in /usr/local:
20
21
<pre>
22
$ echo 'using clang ;' > ~/user-config.jam
23
$ cd boost*
24
$ ./bootstrap.sh
25 4 Wim Dumon
$ sudo ./b2 --toolset=clang cxxflags="-stdlib=libc++ -std=c++11" linkflags="-stdlib=libc++" install
26 1 Koen Deforche
</pre>
27
28
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:
29
30
<pre>
31
$ export DYLD_LIBRARY_PATH=/custom/directory/lib:$DYLD_LIBRARY_PATH
32
</pre>
33
34
35
h2. Building Wt 
36
37
Get the "latest Wt version":http://sourceforge.net/projects/witty/files/wt/. 
38
39
To build Wt, do the following:
40
41
<pre>
42
$ cd wt-3*
43
$ mkdir build
44
$ cd build
45 2 Koen Deforche
$ cmake -DCMAKE_CXX_FLAGS='-stdlib=libc++' \
46
       -DCMAKE_EXE_LINKER_FLAGS='-stdlib=libc++' \
47 3 Koen Deforche
       -DCMAKE_MODULE_LINKER_FLAGS='-stdlib=libc++' \
48 2 Koen Deforche
       -DWT_CPP_11_MODE='-std=c++11' ../
49 1 Koen Deforche
$ make
50
$ make -C examples # to build the examples
51
</pre>
52
53 2 Koen Deforche
_NOTE: If you used the --prefix option when compiling Boost, you must add @ -DBOOST_PREFIX=/custom/directory@ to the cmake command line.
54 1 Koen Deforche
55 2 Koen Deforche
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.
56 1 Koen Deforche
57
To run the examples, please see the "generic installation instructions":http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html#examples.