Project

General

Profile

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

Fred Morton, 01/31/2011 03:46 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 5 Fred Morton
wget "cv writing services.":http://custom-paper-writing.com/custom-thesis-writing
72 1 Pieter Libin
</pre>
73
74
75
h3. build libs 
76
77
78
h4. zlib 
79
80
<pre>
81
cd $BUILD_DIR
82
gzip -dc zlib-1.2.3.tar.gz | tar xpf -
83
cd zlib-1.2.3
84
gmake all install
85
</pre>
86
87
88
h4. openssl 
89
90
<pre>
91
cd $BUILD_DIR
92
gzip -dc openssl-0.9.8k.tar.gz | tar xpf -
93
cd openssl-0.9.8k
94
./config --prefix=$SSL_ROOT --openssldir=$SSL_ROOT/share/ssl shared threads zlib
95
gmake all install
96
</pre>
97
98
99
h4. bjam 
100
101
<pre>
102
cd $BUILD_DIR
103
gzip -dc boost-jam-3.1.17.tgz | tar xpf -
104
cd boost-jam-3.1.17
105
./build.sh sunpro
106
cp $WT_ROOT/bin
107
</pre>
108
109
110
h4. boost 
111
112
<pre>
113
cd $BUILD_DIR
114
gzip -dc boost_1_39_0.tar.gz | tar xpf -
115
cd boost_1_39_0
116
echo "import toolset : using ;" >tools/build/v2/user-config.jam
117
echo "using sun : : CC : <stdlib>sun-stlport <cxxflags>\"-library=stlport4 \
118
  -xcode=pic32 -erroff=wvarhidemem,hidevf,hidevfinvb -errtags=yes\" <linkflags>\"-library=stlport4 \
119
  -xcode=pic32\" ;" >> tools/build/v2/user-config.jam
120
gpatch boost/thread/detail/thread.hpp <<EOF
121
107c107
122
<     private:
123
---
124
>     public:
125
108a109,110
126
>     private:
127
>         // need to be public: thread(thread&);
128
EOF
129
bjam install -d2 --prefix=$BOOST_ROOT \
130
  toolset=sun stdlib=sun-stlport \
131
  variant=release,debug threading=multi link=shared \
132
  -sNO_COMPRESSION=0 -sNO_BZIP2=1 -sNO_ZLIB=0 \
133
  -sZLIB_INCLUDE=$ZLIB_ROOT/include -sZLIB_LIBPATH=$ZLIB_ROOT/lib -sZLIB_BINARY=z
134
</pre>
135
136
137
h4. fcgi 
138
139
To build fcgi we use sources and patches from debian http://packages.debian.org/stable/libfcgi-dev, which is working well.
140
The orginal source file from http://www.fastcgi.com/dist will not build on solaris.
141
<pre>
142
cd $BUILD_DIR
143
gzip -dc libfcgi_2.4.0.orig.tar.gz | tar xpf -
144
mv libfcgi-2.4.0.orig libfcgi-2.4.0
145
cd libfcgi-2.4.0
146
gzip -dc ../libfcgi_2.4.0-7.diff.gz | gpatch -p1
147
CXXFLAGS=-library=stlport4 ./configure --prefix=$WT_ROOT --disable-static
148
gmake all install
149
</pre>
150
151
152
h4. wt 
153
154
<pre>
155
cd $BUILD_DIR
156
gzip -dc wt-2.2.4.tar.gz | tar xpf -
157
cd wt-2.2.4
158
gpatch -p1 <<EOF
159
diff -Nurp wt-2.2.4.org/src/Wt/WAbstractItemModel.C wt-2.2.4/src/Wt/WAbstractItemModel.C
160
--- wt-2.2.4.org/src/Wt/WAbstractItemModel.C    2009-03-04 12:00:30.000000000 +0100
161
+++ wt-2.2.4/src/Wt/WAbstractItemModel.C        2009-05-03 14:22:46.993329000 +0200
162
@@ -4,6 +4,7 @@
163
  * See the LICENSE file for terms of use.
164
  */
165
 
166
+#include <stdio.h>
167
 #include <boost/lexical_cast.hpp>
168
 #include <boost/algorithm/string/predicate.hpp>
169
 
170
diff -Nurp wt-2.2.4.org/src/Wt/WModelIndex.C wt-2.2.4/src/Wt/WModelIndex.C
171
--- wt-2.2.4.org/src/Wt/WModelIndex.C   2009-03-04 12:00:30.000000000 +0100
172
+++ wt-2.2.4/src/Wt/WModelIndex.C       2009-05-03 14:48:04.304612000 +0200
173
@@ -3,6 +3,7 @@
174
  *
175
  * See the LICENSE file for terms of use.
176
  */
177
+#include <string.h>
178
 #include <iostream>
179
 
180
 #include "Wt/WModelIndex"
181
diff -Nurp wt-2.2.4.org/src/http/WServer.C wt-2.2.4/src/http/WServer.C
182
--- wt-2.2.4.org/src/http/WServer.C     2009-03-04 12:00:30.000000000 +0100
183
+++ wt-2.2.4/src/http/WServer.C 2009-05-03 17:26:09.978681000 +0200
184
@@ -11,6 +11,9 @@
185
 #include <string>
186
 
187
 #if !defined(_WIN32)
188
+#ifdef __SUNPRO_CC
189
+#  define _POSIX_PTHREAD_SEMANTICS
190
+#endif
191
 #include <signal.h>
192
 #include <sys/types.h>
193
 #include <sys/wait.h>
194
EOF
195
mkdir build
196
cd build
197
cmake \
198
  -DCMAKE_CXX_FLAGS:STRING=-library=stlport4 \
199
  -DCMAKE_EXE_LINKER_FLAGS:STRING=-library=stlport4 \
200
  -DCMAKE_MODULE_LINKER_FLAGS:STRING=-library=stlport4 \
201
  -DCMAKE_SHARED_LINKER_FLAGS:STRING=-library=stlport4 \
202
  -DBOOST_COMPILER=$BOOST_COMPILER \
203
  -DBOOST_DIR=$BOOST_ROOT \
204
  -DBOOST_VERSION=$BOOST_VERSION \
205
  -DCMAKE_INSTALL_PREFIX=$WT_ROOT \
206
  -DCMAKE_VERBOSE_MAKEFILE=TRUE \
207
  -DCONFIGDIR=$WT_ROOT/etc \
208
  -DCONFIGURATION=$WT_ROOT/etc/wt_config.xml \
209
  -DCONNECTOR_FCGI=ON \
210
  -DCONNECTOR_HTTP=ON \
211
  -DDEPLOYROOT=$WT_ROOT/deploy \
212
  -DEXAMPLES_CONNECTOR=wtfcgi \
213
  -DFCGIPP_LIB=$FCGI_ROOT/lib/libfcgi++.so \
214
  -DFCGI_INCLUDE_DIR=$FCGI_ROOT/include \
215
  -DFCGI_LIB=$FCGI_ROOT/lib/libfcgi.so \
216
  -DMULTI_THREADED=ON \
217
  -DRUNDIR=$WT_ROOT/run \
218
  -DUSERLIB_ROOT=$WT_ROOT/lib \
219
  -DSSL_INCLUDE_DIRS=$SSL_ROOT/include \
220
  -DSSL_LIB=$SSL_ROOT/lib/libssl.so \
221
  -DZLIB_INCLUDE=$ZLIB_ROOT/include \
222
  -DZLIB_LIB=$ZLIB_ROOT/lib/libz.so \
223
  -DWTHTTP_CONFIGURATION=$WT_ROOT/etc ..
224
gmake
225
gmake -C examples
226
gmake install
227
</pre>
228
229
thanks Koen Deforche for the CMAKE_CXX_FLAGS help: http://sourceforge.net/mailarchive/message.php?msg_name=205a79980904172331u167bd2derc0f56d85954a0165%40mail.gmail.com