Home  /  RSS  /  RSS Comments  /  RSS for Framework  /  Enter

Posts in category ‘Framework’.

CppCMS on OpenSolaris...

Saturday, January 10, 2009, by artyom ; Posted in: Progress, Framework; 0 comments

After long fight between Me, Virtual Box and OpenSolaris I was finally be able to build CppCMS under OpenSolaris.

Fighting with OpenSolaris

After I installed OpenSolaris first time, network wasn't recognized, I started to tinker with its interfaces and drivers, and looks like I had ruined something.

At some point I had figured out that I should reboot OS twice in order to make network work. Indeed, it worked, but... after next reboot it stopped. After long period of fighting and googling, I decided to reinstall it.

The next step was even bigger nightmare. I decided to install both Sun Studio and GNU Build system... Total download of 700Mb from very slow OS mirrors.

I let the installation to run at night and at the morning I had found that VirtualBox had crashed my computer... Arrggggggg.

At next step I installed only gnu tool chain, meaning I'll continue to work with GCC and I will not test Sun Studio C++ compiler (anyway most Solaris developers work with gcc). It was done little bit faster.

The next step was building Boost. Unfortunately, OS do not provide package for it. It was very strange, because it comes at core part of any Linux distribution and it is even a part of Cygwin.

So I had taken Boost 1.36 and started build. The build had took forever -- and at the end I had found that only headers where installed! Then I figured out how to build libraries I need. However, there was some build error for shared libraries and I got static libraries only...

After some googling, I had found a patch for boost-jam that fixes linking issues for 1.36 under Solaris. But the patch was unreadable. So at this point I gave up. Static libraries for testing are good enough.

Then I installed most important dependencies: CgiCC, FastCGI. I had build and installed Lighttpd. These steps were very simple and straightforward (Ok... Who still thinks that autotools are bad?)

At the end I checked out latest development version and tried to run autogen.sh. I had figured out that there is no default "automake" and "aclocal". You should specify exact version: automake-1.9 (Have they hear about alternatives?) I did a little fix and configured the system.

Fixing the code

There where 3 build problems:

  1. For some reason gcc didn't like map<> in two headers in code, even with using namespace std. So I need to add std::map explicitly --- I still have no idea why.
  2. I had found a little bug I made it TCP server. I test CppCMS mostly with Boost 1.33.1 and external Asio library.

    Starting from Boost 1.35 Asio is part of it, however in different namespace and with several other little differences. So I had a little bug in using Boost.Asio instead of plain Asio. (Not connected to OpenSolaris at all).

  3. The only real platform specific problem was missing -lsocket and -lnsl libraries. These were easily fixed with 2 lines in confiugre.in script.

Finally I was able to run my simple hello world programs and see that CppCMS becomes truly cross platform --- in addition to Linux and Cygwin, OpenSolaris should be supported as well.

I wonder: "How much time would it take to build CppCMS under FreeBSD?"

CppCMS Wiki In the WWW

Thursday, October 30, 2008, by artyom ; Posted in: Progress, Framework; 0 comments

From this point, all project documentation will be available in the CppCMS Wiki. There still not much documentation there, however, slowly all the framework will be documented.

The wiki itself has multilingual support. Thus if someone wants to translate the documentation to his language, drop me a mail and I'll open and additional language category. Meanwhile, there are two languages: English and Hebrew.

Thoughts about template system

Tuesday, August 5, 2008, by artyom ; Posted in: Templates, Framework; 5 comments

After looking how ASP.Net and J2EE work I thought a lot about current template system.

Today, CppCMS template system is dynamic typed. For example in order to render template:

<% template mycontent %>
<p>You have <% number %> of <% something %></p>
<% end %>

I write something like that (not correct code but idea):

map<boost::any> content; 

content["something"]=string("orange");‎
content["number"]=10;

template.render(content,output); 

The template is compiled to bytecode and than interpreted in rendering engine. If variable title required it checks its type and renders its content.

Another possible approach it to make is statically typed :

So, I create a view interface for template:

struct mycontent: public content {
  string something;
  int number;
};

And then the above template is compiled to following C++ code:

void mycontent::render()
{
  cout<<"<p>You have "<<number<<" of "<<escape(something)<<"</p>\n";
} 

That is compiled to shared object that I can load dynamically. And render template as following:

auto_ptr<my_content> content(template.get("my_content"));
content->number=10;
content->something="orange";

content->render(output); 
more...

API Changes and mod-prefork

Friday, July 4, 2008, by artyom ; Posted in: Progress, FastCGI, Framework, Cache; 0 comments

There have been lot of work in recent weeks in order to make deep internal changes in the framework. Now they include:

  1. Transparent support of 3 web server APIs: fastcgi, cgi and scgi.
  2. Support of new mod prefork that allows safer management of worker processes.
  3. Implementation of a cache that is shared between forked processes.
more...

CppCMS vs WordPress

Monday, June 9, 2008, by artyom ; Posted in: Benchmarks, Framework, Cache; 7 comments

Setup

I had compared two blog systems: this one and WordPress 2.5 with a patched WP-Cache-2 addon. I used following configuration:

  1. Web Server lighttpd 1.4.13
  2. Interface FastCGI
  3. PHP 5.2
  4. Bytecode cacher: XCache 1.2.1
  5. Database MySQL 5.0
  6. Caching for WP: WP-Cache-2 with an additional performance patch
  7. Hardware: AMD Athlon XP 64bit, 1G RAM
  8. OS: Linux, Debian Etch 64bit.

I prepared two blogs that were filled up with 1000 articles each. Each article had 10 comments, all the articles were organized in 10 categories in each blog.

more...

next page

next page

Pages

Categories