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