Main  /  Edit version 5  /  Edit version 6  /   /  Users Area

Difference "CppCMS For embedded systems" ver. 5 versus ver. 6

Content:

**Note:** _Scheduled for CppCMS 0.0.4_
## General
Generally CppCMS can be used as-is for embedded systems. However there are additional options that make this library optimized for embedded system:
Generally CppCMS can be used as-is for embedded systems. However there are many features that are heavy and targeted
for high performance web servers. These options
are rather useless for embedded system.
- Caching and compression are removed -- reduces memory footprint and removes dependency on `boost::iostreams`, zlib and bzip2 libraries.
- Removed mod-prefork
- Optional compilation in CGI mode -- removal of FastCGI and SCGI API and worker models.
- Removed dynamic templates loading.
Thus additional build options that make this library optimized for embedded system provided.
This compilation allows building CppCMS using only following libraries:
They are reduce number of dependencies and make executable
significantly smaller.
## Changes in Embedded Build
### Normal Embedded Build
- Caching is completely removed. Small memory footprint
is very important for embedded system thus, caching
stuff in memory is quite useless.
- Zlib compression are removed -- it removes dependency on `boost::iostreams`, zlib and bzip2 libraries.
- Removed mod-prefork.
- Removed dynamic templates loading --- this feature requires export of symbols to binary and increases its size in order to make RTTI work. Thus, all templates should be
statically compiled into the binary.
### CGI Mode
- FastCGI and SCGI APIs are removed
- Mod-thread and mod process are removed including
all thread pool facilities
- Changes in files based session backend to work
properly with CGI mode including garbage collection
(sessions that had time-out).
### Minimal Dependencies
Embedded compilation allows building CppCMS using only following libraries:
- libcgicc
- libboost\_signals
- libboost\_regex.
## Compilation
## Cross Compilation of CppCMS
Build Flags:
### General
For cross compilation you should use `--host` configuration switch according to your platform, for example:
./configure --host=arm-linux-eabi ...
./configure --host=mips-linux-gnu
Do not forget to build boost and cgicc as well. Refer to
your platform documentation for cross-compilation instructions.
### Build Flags:
- `--enable-embedded` -- Create embedded version of cppcms.
- `--enable-cgi` -- implement CGI API only.
_Additional flags:_
- `CXXFLAGS=-Os` -- optimize for size when you build
for embedded system
- `--prefix=/...` -- always specify installation prefix... You do not want to install to `/usr/local/lib`, `;-)`
For example:
./configure --host=arm-linux-gnu --prefix=/usr/arm-linux-gnu CXXFLAGS=-Os --enable-embedded --enable-cgi
Would configure cross compilation make files for ARM platfor,
Would configure cross compilation make files for ARM platform,
_Notes:_
- Remember that you should build cgicc and boost as well
- It is recommended to build `boost::regex` without ICU support in order to reduce executable size.
## Static Linking
You can link your application statically as following:
In some cases you want to build your application
without dependencies on many shared objects.
Thus you can link your application "almost" statically.
Only system libraries like libc, libstdc++, pthreads, rt would be linked dynamically
### CGI Only
You can build "almost" static build as following:
g++ hello.o /path/to/libcppcms.a /path/to/libcppcmstranstext.a /path/to/libboost_signals.a /path/to/libboost_regex.a /path/to/libcgicc.a
### With worker threads
### With Worker Threads
You can build "almost" static build as following:
g++ hello.o /path/to/libcppcms.a /path/to/libcppcmstranstext.a /path/to/libboost_signals.a /path/to/libboost_regex.a /path/to/libcgicc.a -lrt -lpthread

About

CppCMS is a web development framework for performance demanding applications.

Support This Project

SourceForge.net Logo

Поддержать проект

CppCMS needs You


Navigation

Main Page


Valid CSS | Valid XHTML 1.0