2008 Jun 06 - Fri
Wt, Some Build Modifications
Back on
2007/10/03, I wrote about installing Wt (a C++ library and application server for
developing and deploying web applications) on a Debian server. I've revised things a little
bit since thing while building Wt v2.1.3.
In this case, I build with the newly released version of the Boost libraries: 1.35.
ASIO is now included in Boost, so some build steps can be removed.
Prerequisites are little changed but for a different library for gd:
apt-get install gcc
apt-get install zlib1g
apt-get install zlib1g-dev
apt-get install libbz2-dev
apt-get install libgd2-noxpm-dev
apt-get install cmake
apt-get install libfcgi-dev
apt-get install libapache2-mod-fastcgi
apt-get install libssl-dev
The web site and repository for Wt have changed, so CVS commands will be a bit different:
cvs -d :pserver:anonymous@cvs.webtoolkit.eu/opt/cvs login
cvs -z3 -d :pserver:anonymous@cvs.webtoolkit.eu/opt/cvs co wt
I've changed the cmake/build a little bit so the results go into /usr/local/wt/include
and /usr/local/wt/lib:
cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data \
-D BOOST_DIR=/usr/local \
-D BOOST_COMPILER=gcc42 \
-D BOOST_VERSION=1_35 \
-D BOOST_INCLUDE_DIR=/usr/local/include/boost \
-D BOOST_LIB_DIR=/usr/local \
-D BOOST_DT_LIB_MT=/usr/local/lib \
-D BOOST_DT_LIB=/usr/local/lib \
-D BOOST_FS_LIB=/usr/local/lib \
-D BOOST_FS_LIB_MT=/usr/local/lib \
-D BOOST_PO_LIB_MT=/usr/local/lib \
-D BOOST_REGEX_LIB_MT=/usr/local/lib \
-D BOOST_SIGNALS_LIB_MT=/usr/local/lib \
-D BOOST_THREAD_LIB=/usr/local/lib \
-D BOOST_ASIO_INCLUDE_DIR=/usr/local/include/boost \
-D SHARED_LIBS=ON \
-D CONNECTOR_FCGI=OFF \
-D CONNECTOR_HTTP=ON \
-D EXAMPLES_CONNECTOR=wthttp \
-D WTHTTP_CONFIGURATION=/etc/wt/wthttpd \
-D CONFIGURATION=/etc/wt/wt_config.xml \
-D CMAKE_INSTALL_PREFIX=/usr/local/wt \
.
During make install, an error regarding CMakeFiles arises. The secret, that I know, is
to remove the line which includes CmakeFiles in src/Ext/cmake_install.cmake, and restart
'make install'. The install should complete normally.
The library directory /usr/local/wt/lib will need to be added to /etc/ld.so.conf, and
then run ldconfig to update things.
Remember to review the
Ext widgets deployment page as there are some additional files to be downloaded and
installed from Ext JS.
[/OpenSource/Debian/Development]
permanent link
2008 Apr 24 - Thu
Installing Sun Java on Debian Lenny
Back in October last year, I mentioned how to get Sun Java installed in
preparation for Eclipse. The rules have changed a bit.
You still need to put 'non-free' at the end of teh deb and deb-src lines in
/etc/apt/sources.list. The secret to get the new flavour, which happens to be 1.6, is
'apt-get install sun-java6-jre' or 'apt-get install sun-java5-jre'.
Also, by default, Debian installs some other runtimes that seem to not work very well
with eclipse. So to select the proper one, which was installed with the command in the
previous paragraph, use 'update-alternatives --config java'.
On opening Eclipse/CDT, you may get an 'error opening the view', or some similar error
regarding opening a view. The configuration above
will make that error message go away.
[/OpenSource/Debian/Development]
permanent link
2008 Jan 10 - Thu
Additional Configuration Notes for Wt, a C++ Web Toolkit
I need to append some additional notes to my 2007/10/03 Wt Configuration Guide article.
As mentioned in the Wt
Ext Widget deployment notes, the Wt toolkit makes use of libraries from Ext JS. There are notes at the bottom of the Wt page itemizing the files needed from the
JS Ext 1.1 .zip file.
As a side note, all things Ajax can be referenced one way or another starting at the
ajaxian web site. Maybe not quite the truth.
More all things Ajax at AjaxPatterns... if you want to
get under the hood.
[/OpenSource/Debian/Development]
permanent link
2007 Oct 03 - Wed
Installing And Configuring Wt, a C++ Web Toolkit
I mentioned in another article about doing web page development with C++. I came across
Wt: a C++ Web Toolkit. It has been
a bear to configure with the ASIO library. I'll layout what I've done below. I'm stuck
with an SSL initialization problem. I'm probably going to have to move to FastCGI to see
how well that works.
Based upon the forums, there are supposed to be some Debian Packages already available to
make this work. Packages seem to be a bit behind the latest versions of stuff, so in this
case, I wanted to be able to have a build system where I could incorporate the latest of
Boost (which is supposed to have time-series avaliable shortly), and with Wt (which has an
active CVS feed).
Anyway, here is my installation process so far. There are a couple of Kludges due to
platform differences (a prefix of lib is needed on some stuff, which I should do a SED with
at some time) and I can't figure out how the header file include stuff works properly (in
order to keep it in a separate directory).
I started by downloading
asio-0.3.7.tar.gz from asio.sf.net and boost_1_34_1.tar.tz from www.boost.org, and expanding
them out to their directories in /usr/src.
apt-get install gcc
apt-get install zlib1g
apt-get install zlib1g-dev
apt-get install libbz2-dev
apt-get install libgd-dev
apt-get install cmake
apt-get install libfcgi-dev
apt-get install libapache2-mod-fastcgi
apt-get install libssl-dev
cd /usr/src/boost_1_34_1
./configure --without-icu --without-libraries=python,wave,test --libdir=/usr/lib/boost_34_1
make install
ln -s /usr/lib/boost_1_34_1/ /usr/lib/boost
ln -s /usr/include/boost-1_34_1/boost /usr/include/boost
Before proceeding, a patch needs to be applied to one of the ASIO files:
@@ -45,13 +45,13 @@
{
::SSL_library_init();
::SSL_load_error_strings();
+ ::OpenSSL_add_ssl_algorithms();
mutexes_.resize(::CRYPTO_num_locks());
for (size_t i = 0; i < mutexes_.size(); ++i)
mutexes_[i].reset(new asio::detail::mutex);
::CRYPTO_set_locking_callback(&do_init::openssl_locking_func);
- ::OpenSSL_add_ssl_algorithms();
}
}
It basically moves the location of '::OpenSSL_add_ssl_algorithms();'. Without it, an
error such as the following may occur during runtime:
__gnu_cxx::recursive_init'
what(): N9__gnu_cxx14recursive_initE
Aborted
ASIO can then be built:
cd /usr/src/asio-0.3.7
./configure --with-boost=/usr/include/boost --libdir=/usr/lib/ --includedir=/usr/include/
make
make install
After that fixup, Wt can be built.
cd /usr/src
cvs -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty login
cvs -z3 -d:pserver:anonymous@witty.cvs.sourceforge.net:/cvsroot/witty co -P wt
cd wt
nano src/CMakeLists.txt
# prefix boost file entries with lib to get libboost
cmake -D DEPLOYROOT=/var/www/wt -D WEBUSER=www-data -D WEBGROUP=www-data \
-D BOOST_DIR=/usr/include/boost/ \
-D BOOST_COMPILER=gcc41 \
-D BOOST_VERSION=1_34_1 \
-D BOOST_INCLUDE_DIR=/usr/include/boost \
-D BOOST_LIB_DIR=/usr/lib/boost/ \
-D BOOST_DT_LIB_MT=/usr/lib/boost \
-D BOOST_DT_LIB=/usr/lib/boost \
-D BOOST_FS_LIB=/usr/lib/boost \
-D BOOST_FS_LIB_MT=/usr/lib/boost \
-D BOOST_PO_LIB_MT=/usr/lib/boost \
-D BOOST_REGEX_LIB_MT=/usr/lib/boost \
-D BOOST_SIGNALS_LIB_MT=/usr/lib/boost \
-D BOOST_THREAD_LIB=/usr/lib/boost \
-D BOOST_ASIO_INCLUDE_DIR=/usr/include/asio/ \
-D CMAKE_INSTALL_PREFIX=/ \
-D LIB_INSTALL_DIR=/usr/lib/wt/ \
-D LIBRARY_OUTPUT_PATH=/usr/lib/wt \
-D SHARED_LIBS=ON \
-D CONNECTOR_FCGI=ON \
-D CONNECTOR_HTTP=OFF \
.
# FCGI ON for FastCGI (production), HTTP ON for ASIO library (development)
make
# on error:
nano src/Ext/cmake_install.cmake
# comment out cmakefiles line
rm /include/Ext/CMakeFiles
mkdir /include/Ext/CMakeFiles
cp /usr/src/wt/src/Ext/CMakeFiles/* /include/Ext/CMakeFiles
make install
mkdir /usr/include/wt
mv /include/* /usr/include/wt/
rmdir /include
nano /etc/ld.so.conf
# put in:
# /usr/lib/wt
# /usr/lib/boost_1_34_1
# ldconfig needs to be run if the fcgi or http libraries get switched or added
ldconfig
Back in Eclipse, I created C++ ANSI project, and then placed the content from
examples/hello/hello.cpp into the .cpp file of the new project. The directories
'/usr/include/boost-1_34_1' and '/usr/include/wt' need to be entered as 'include' paths.
For GCC C++ Linker, the following are -L library search paths:
- /usr/lib/wt
- /usr/lib/boost_1_34_1
The following are -l libraries:
- boost_signals-gcc41-mt-d
- boost_filesystem-gcc41-mt-d
- boost_program_options-gcc41-mt-d
- boost_thread-gcc41-mt-d
- boost_regex-gcc41-mt-d
- wt
- wthttp or wtfcgi
- wtext
So... with some recompiling, I was able to get the hello sample up and running with
FastCGI and then with the ASIO library.
When using FCGI, I renamed the compiled file to hello.wt, and
placed it into /var/www/wt/, added the line 'FastCgiServer /var/www/wt/hello.wt' into
/etc/apache2/mods-enabled/fastcgi.conf, and restarted Apache. Then by browsing to
localhost/wt/hello.wt, I was able to get the
demonstration.
When using ASIO, set the folloing for run-time command-line arguments in Eclipse to
successfully
start the application: '--doc-root=/var/www/wt --http-address=0.0.0.0 --http-port=8080'.
Browsing to localhost:8080 will get the web page.
[/OpenSource/Debian/Development]
permanent link
2007 Oct 02 - Tue
Installing Eclipse C++ Development Environment
The Eclipse C++ Development
Environment is a Java based Integrated Development Environment (IDE). On Debian, it is
a 'non-free' install. As such, the file /etc/apt/sources.list needs to have the word
'non-free' tacked on to the end of the deb and deb-src lines.
The command 'apt-get update' then needs to be run to update its lists.
The Java runtime environment can then be downloaded with 'apt-get install sun-java-jre'.
The downloaded Eclipse C++ Development Environment can be expanded. Within the expanded
directory is a executable file called 'eclipse'. Start it and the environment is up and
running. Dead easy.
[/OpenSource/Debian/Development]
permanent link
|