Project

General

Profile

Installing Wt on Solaris with Sun CC Compiler and stlport4 » History » Version 1

Pieter Libin, 10/29/2009 02:08 PM

1 1 Pieter Libin
h1. Installing Wt on Solaris with Sun CC Compiler and stlport4
2
3
{{toc}}
4
5
6
h3. Overview 
7
8
Installing Wt on Solaris with Sun CC Compiler compiled and linked with stlport4.
9
10
successful builded on Solaris 10 sparc with Sun C++ compiler 5.9
11
12
13
h3. Dependencies 
14
15
* SUN Studio 12 (C++ Compiler 5.9): http://developers.sun.com/sunstudio/index.jsp
16
* SUN Studio 12 the latest patches: http://developers.sun.com/sunstudio/downloads/patches/ss12_patches.jsp
17
* GNU make (named as gmake in this document): http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.gz
18
* GNU patch (named as gpatch in this document): ftp://ftp.gnu.org/gnu/patch/patch-2.5.9.tar.gz
19
* cmake: http://www.cmake.org/files/v2.6/cmake-2.6.3.tar.gz
20
21
install this programs for example into the $WT_ROOT path (see below).
22
23
24
h3. prepare the install directory 
25
26
We don't need to build and install the libraries as root.
27
28
You need only run this two commands as root (or ask your system admin to do that):
29
<pre>
30
mkdir /opt/WT
31
chown <user>:<group> /opt/WT
32
chmod 755 /opt/WT
33
</pre>
34
<user> and <group> have to be a valid system user and group
35
36
Now you can build and install the libs as <user>. Loggin as <user>
37
38
39
h3. set environment 
40
41
<pre>
42
WT_ROOT=/opt/WT
43
BUILD_DIR=$WT_ROOT/build
44
ZLIB_ROOT=$WT_ROOT
45
SSL_ROOT=$WT_ROOT
46
BOOST_CFG=sw-mt
47
BOOST_COMPILER=sw
48
BOOST_ROOT=$WT_ROOT
49
BOOST_VERSION=1_39
50
FCGI_ROOT=$WT_ROOT
51
PATH=$WT_ROOT/bin:$PATH
52
LD_LIBRARY_PATH=$WT_ROOT/lib:$LD_LIBRARY_PATH
53
mkdir $BUILD_DIR
54
mkdir $WT_ROOT/bin
55
mkdir $WT_ROOT/lib
56
export WT_ROOT BUILD_DIR ZLIB_ROOT SSL_ROOT BOOST_CFG BOOST_COMPILER BOOST_ROOT BOOST_VERSION FCGI_ROOT PATH LD_LIBRARY_PATH
57
</pre>
58
59
60
h3. download sources to $BUILD_DIR as example with wget 
61
62
<pre>
63
cd $BUILD_DIR
64
wget http://www.zlib.net/zlib-1.2.3.tar.gz
65
wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
66
wget http://switch.dl.sourceforge.net/sourceforge/boost/boost-jam-3.1.17.tgz
67
wget http://switch.dl.sourceforge.net/sourceforge/boost/boost_1_39_0.tar.gz
68
wget http://ftp.de.debian.org/debian/pool/main/libf/libfcgi/libfcgi_2.4.0.orig.tar.gz
69
wget http://ftp.de.debian.org/debian/pool/main/libf/libfcgi/libfcgi_2.4.0-7.diff.gz
70
wget http://switch.dl.sourceforge.net/sourceforge/witty/wt-2.2.4.tar.gz
71
</pre>
72
73
74
h3. build libs 
75
76
77
h4. zlib 
78
79
<pre>
80
cd $BUILD_DIR
81
gzip -dc zlib-1.2.3.tar.gz | tar xpf -
82
cd zlib-1.2.3
83
gmake all install
84
</pre>
85
86
87
h4. openssl 
88
89
<pre>
90
cd $BUILD_DIR
91
gzip -dc openssl-0.9.8k.tar.gz | tar xpf -
92
cd openssl-0.9.8k
93
./config --prefix=$SSL_ROOT --openssldir=$SSL_ROOT/share/ssl shared threads zlib
94
gmake all install
95
</pre>
96
97
98
h4. bjam 
99
100
<pre>
101
cd $BUILD_DIR
102
gzip -dc boost-jam-3.1.17.tgz | tar xpf -
103
cd boost-jam-3.1.17
104
./build.sh sunpro
105
cp $WT_ROOT/bin
106
</pre>
107
108
109
h4. boost 
110
111
<pre>
112
cd $BUILD_DIR
113
gzip -dc boost_1_39_0.tar.gz | tar xpf -
114
cd boost_1_39_0
115
echo "import toolset : using ;" >tools/build/v2/user-config.jam
116
echo "using sun : : CC : <stdlib>sun-stlport <cxxflags>\"-library=stlport4 \
117
<pre>
118
  -xcode=pic32 -erroff=wvarhidemem,hidevf,hidevfinvb -errtags=yes\" <linkflags>\"-library=stlport4 \
119
  -xcode=pic32\" ;" >> tools/build/v2/user-config.jam
120
</pre>
121
gpatch boost/thread/detail/thread.hpp <<EOF
122
107c107
123
<     private:
124
---
125
>     public:
126
108a109,110
127
>     private:
128
>         // need to be public: thread(thread&);
129
EOF
130
bjam install -d2 --prefix=$BOOST_ROOT \
131
<pre>
132
  toolset=sun stdlib=sun-stlport \
133
  variant=release,debug threading=multi link=shared \
134
  -sNO_COMPRESSION=0 -sNO_BZIP2=1 -sNO_ZLIB=0 \
135
  -sZLIB_INCLUDE=$ZLIB_ROOT/include -sZLIB_LIBPATH=$ZLIB_ROOT/lib -sZLIB_BINARY=z
136
</pre>
137
138
</pre>
139
140
141
h4. fcgi 
142
143
To build fcgi we use sources and patches from debian http://packages.debian.org/stable/libfcgi-dev, which is working well.
144
The orginal source file from http://www.fastcgi.com/dist will not build on solaris.
145
<pre>
146
cd $BUILD_DIR
147
gzip -dc libfcgi_2.4.0.orig.tar.gz | tar xpf -
148
mv libfcgi-2.4.0.orig libfcgi-2.4.0
149
cd libfcgi-2.4.0
150
gzip -dc ../libfcgi_2.4.0-7.diff.gz | gpatch -p1
151
CXXFLAGS=-library=stlport4 ./configure --prefix=$WT_ROOT --disable-static
152
gmake all install
153
</pre>
154
155
156
h4. wt 
157
158
<pre>
159
cd $BUILD_DIR
160
gzip -dc wt-2.2.4.tar.gz | tar xpf -
161
cd wt-2.2.4
162
gpatch -p1 <<EOF
163
diff -Nurp wt-2.2.4.org/src/Wt/WAbstractItemModel.C wt-2.2.4/src/Wt/WAbstractItemModel.C
164
--- wt-2.2.4.org/src/Wt/WAbstractItemModel.C    2009-03-04 12:00:30.000000000 +0100
165
+++ wt-2.2.4/src/Wt/WAbstractItemModel.C        2009-05-03 14:22:46.993329000 +0200
166
@@ -4,6 +4,7 @@
167
<pre>
168
  * See the LICENSE file for terms of use.
169
  */
170
 
171
</pre>
172
+#include <stdio.h>
173
<pre>
174
 #include <boost/lexical_cast.hpp>
175
 #include <boost/algorithm/string/predicate.hpp>
176
 
177
</pre>
178
diff -Nurp wt-2.2.4.org/src/Wt/WModelIndex.C wt-2.2.4/src/Wt/WModelIndex.C
179
--- wt-2.2.4.org/src/Wt/WModelIndex.C   2009-03-04 12:00:30.000000000 +0100
180
+++ wt-2.2.4/src/Wt/WModelIndex.C       2009-05-03 14:48:04.304612000 +0200
181
@@ -3,6 +3,7 @@
182
<pre>
183
  *
184
  * See the LICENSE file for terms of use.
185
  */
186
</pre>
187
+#include <string.h>
188
<pre>
189
 #include <iostream>
190
 
191
 #include "Wt/WModelIndex"
192
</pre>
193
diff -Nurp wt-2.2.4.org/src/http/WServer.C wt-2.2.4/src/http/WServer.C
194
--- wt-2.2.4.org/src/http/WServer.C     2009-03-04 12:00:30.000000000 +0100
195
+++ wt-2.2.4/src/http/WServer.C 2009-05-03 17:26:09.978681000 +0200
196
@@ -11,6 +11,9 @@
197
<pre>
198
 #include <string>
199
 
200
 #if !defined(_WIN32)
201
</pre>
202
+#ifdef __SUNPRO_CC
203
+#  define _POSIX_PTHREAD_SEMANTICS
204
+#endif
205
<pre>
206
 #include <signal.h>
207
 #include <sys/types.h>
208
 #include <sys/wait.h>
209
</pre>
210
EOF
211
mkdir build
212
cd build
213
cmake \
214
<pre>
215
  -DCMAKE_CXX_FLAGS:STRING=-library=stlport4 \
216
  -DCMAKE_EXE_LINKER_FLAGS:STRING=-library=stlport4 \
217
  -DCMAKE_MODULE_LINKER_FLAGS:STRING=-library=stlport4 \
218
  -DCMAKE_SHARED_LINKER_FLAGS:STRING=-library=stlport4 \
219
  -DBOOST_COMPILER=$BOOST_COMPILER \
220
  -DBOOST_DIR=$BOOST_ROOT \
221
  -DBOOST_VERSION=$BOOST_VERSION \
222
  -DCMAKE_INSTALL_PREFIX=$WT_ROOT \
223
  -DCMAKE_VERBOSE_MAKEFILE=TRUE \
224
  -DCONFIGDIR=$WT_ROOT/etc \
225
  -DCONFIGURATION=$WT_ROOT/etc/wt_config.xml \
226
  -DCONNECTOR_FCGI=ON \
227
  -DCONNECTOR_HTTP=ON \
228
  -DDEPLOYROOT=$WT_ROOT/deploy \
229
  -DEXAMPLES_CONNECTOR=wtfcgi \
230
  -DFCGIPP_LIB=$FCGI_ROOT/lib/libfcgi++.so \
231
  -DFCGI_INCLUDE_DIR=$FCGI_ROOT/include \
232
  -DFCGI_LIB=$FCGI_ROOT/lib/libfcgi.so \
233
  -DMULTI_THREADED=ON \
234
  -DRUNDIR=$WT_ROOT/run \
235
  -DUSERLIB_ROOT=$WT_ROOT/lib \
236
  -DSSL_INCLUDE_DIRS=$SSL_ROOT/include \
237
  -DSSL_LIB=$SSL_ROOT/lib/libssl.so \
238
  -DZLIB_INCLUDE=$ZLIB_ROOT/include \
239
  -DZLIB_LIB=$ZLIB_ROOT/lib/libz.so \
240
  -DWTHTTP_CONFIGURATION=$WT_ROOT/etc ..
241
</pre>
242
gmake
243
gmake -C examples
244
gmake install
245
</pre>
246
247
thanks Koen Deforche for the CMAKE_CXX_FLAGS help: http://sourceforge.net/mailarchive/message.php?msg_name=205a79980904172331u167bd2derc0f56d85954a0165%40mail.gmail.com