Sans Pareil Technologies, Inc.

Key To Your Business

Building Wt on Solaris



Building Wt on Solaris is fairly straightforward, however it does require a few modifications since cmake does not seem to be able to determine the proper compiler and linker flags to build Wt.

Prerequisites



Use the default package manager to install cmake. make/gmake should already be installed, if not use the package manager to install these as well.

We use a few CSW (from blastwave) packages to build Wt.

  • pfexec /opt/csw/bin/pkgutil -i gcc4
  • pfexec /opt/csw/bin/pkgutil -i graphicsmagick
  • pfexec /opt/csw/bin/pkgutil -i icu
  • pfexec /opt/csw/bin/pkgutil -i fastcgi
  • Ensure that gcc4 is first in path (export PATH=/opt/csw/gcc4/bin:$PATH)

Download the libharu sources and build using gcc4.
  • cd ~/Downloads
  • tar xfj libharu-2.2.1.tar.bz2
  • cd libharu-2.2.1
  • CFLAGS=‘-I/opt/csw/include’ LDFLAGS=‘-L/opt/csw/lib’ ./configure --prefix=/opt/local
  • make; pfexec make install

Download Boost 1.46.1 and build using gcc4
  • cd ~/Downloads
  • tar xfj boost_1_46_1.tar.bz2
  • cd boost_1_46_1
  • ./bootstrap.sh --prefix=/opt/local --with-icu=/opt/csw
  • pfexec ./bjam install

Use crle to include CSW lib directories in the default library search paths
  • crle -c /var/ld/ld.config -l /lib:/usr/lib:/opt/csw/lib
  • crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/opt/csw/gcc4/lib/amd64:/opt/csw/lib/64

Build Wt



Download the latest version (these instructions are based on 3.1.8). Use cmake to generate the makefiles and then edit the CMakeCache.txt file to make the required modifications to build successfully on OpenIndiana.
  • cd ~/Downloads
  • tar xfz wt-3.1.8.tar.gz
  • cd wt-3.1.8
  • vi src/Wt/WPdfImage.C - modify line 224 as noted in forum post.
  • mkdir build; cd build
  • cmake ../ -DBOOST_DIR=/opt/local -DCMAKE_INSTALL_PREFIX=/opt/local
  • vi CMakeCache.txt
  1. Change BUILD_TESTS:BOOL=ON to OFF (line 33) - We were not able to successfully resolve linker dependency on libicu, hence turn off tests
  2. CMAKE_CXX_FLAGS:STRING=-pthreads (line 125)
  3. CMAKE_EXE_LINKER_FLAGS:STRING=-pthreads -L/opt/csw/lib -licuuc -licudata -licui18n -lsocket -lnsl (line 162). Even with these linker options, linking Wt test module fails, hence the decision to turn off
  4. CMAKE_MODULE_LINKER_FLAGS:STRING=-pthreads -L/opt/csw/lib -licuuc -licudata -licui18n -lsocket -lnsl (line 186).
  • make; pfexec make install
  • The install step did not create anything under /opt/local in our case, but placed all installables under a sfw_stage subdirectory of the current build directory. We just move the files from this directory to /opt/local
  1. mv sfw_stage/include/Wt /opt/local/include
  2. mv sfw_stage/lib/* /opt/local/lib