Project

General

Profile

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

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