Installing Seagull on Mac OS X

Sunday, November 22, 2009 em 04:29
Ahh... Nothing like a rainy Saturday to get in the mood for some tasks that were delayed for too long!

As I was getting ready to watch the soccer match between FC Porto (my team) and Oliveirense, at Oliveirense's stadium, the referee decided that there were no conditions (really bad pitch, also due to the rain) for the game to happen... well, I had to do something... :-)

Installing Seagull (the network traffic generator, useful for my Diameter tests) in my iMac was one of those tasks that I could never find the time, and today it seemed a good day. I knew it was not going to be a simple task, as I've tried sometime ago to install (ie, build from source) under Ubuntu or some other Linux distro and never made it... but I didn't tried hard either, as there are RHEL/Fedora binaries I just setup a VM with it.

OK.. So, first step was to look for someone who had already done the job... couldn't find any, seems like Mac's are not chosen as dev machines very often. No binaries, no instructions. I'm on my own.

The INSTALL.TXT has some instructions on how to build it... the commands to run. I'll do it as I like to: run until it crashes and see what's wrong after. First instruction is:
Edit build.conf to fit your needs (default should be OK)

If it says it should be OK, it should be OK. Let's move on.
run "./build.ksh -target clean"

Just to make sure everything is clean. Not a problem, no issues here. Next!
run "./build.ksh -target all"

This is where the "fun" began. It simply failed with some  generic failure message:
[Begin Makefile generation phase]
[Creating symbolic link: /Users/ammendonca/Desktop/seagull/bin]
[Making directory: /Users/ammendonca/Desktop/seagull/work-1.8.1]
[Making directory: /Users/ammendonca/Desktop/seagull/build-1.8.1]
make: *** [/Users/ammendonca/Desktop/seagull/work-1.8.1/] Error 1
[Begin compilation phase]
make: *** No rule to make target `all'.  Stop.

Nice, isn't it? Not much clues of what and where it is failing. After running some pieces of the make script by itself, I got to ./work-1.8.1/ file where it said "Compiler variable for OS DARWIN not defined".

For adding this information, it was needed to edit the ./build.conf afterall :-). So I just copied all the (...)_LINUX entries and renamed them to _DARWIN, et voilá. It worked.

Next ran, next failure:
[Compiling protocol-external/C_ProtocolExternal.cpp]
[Compiling protocol-text/C_MessageText.cpp]
cc1plus: warnings being treated as errors
protocol-text/C_MessageText.cpp: In member function 'C_ProtocolFrame::_msg_error_code C_MessageText::EncodeWithContentLength(int)':
protocol-text/C_MessageText.cpp:62: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
make[1]: *** [/Users/ammendonca/Desktop/seagull/work-1.8.1/C_MessageText.o] Error 1
make: *** [all_seagull] Error 2

This was a pretty simple and obvious one. Just learned how size_t should be printed, it's with %Zd instead of the %d that is present. Made that change at line 62 of ./protocol-text/C_MessageText.cpp and that's it!

One step closer... but not there yet:
[Compiling /Users/ammendonca/Desktop/seagull/work-1.8.1/] In function 'int yyparse()': error: 'yylex' was not declared in this scope error: 'yyerror' was not declared in this scope error: 'yyerror' was not declared in this scope
make[1]: *** [/Users/ammendonca/Desktop/seagull/work-1.8.1/] Error 1
make: *** [all_seagull] Error 2

Checking the referred I've checked it declared those methods only if some vars (__linux__ OR __CYGWIN__) were declared. This should be some compiler info as my friend grep didn't found any reference on the seagull sources. Googled a little bit and just found what it was and so I checked it should be __APPLE__ for my system.

A previous message showed that this file was being generated and, so, with the help of grep I managed to find out that it came from ./xml-parser/xml_definition.y, at line 38. Changed
#if defined(__linux__) || defined(__CYGWIN__)
#if defined(__linux__) || defined(__CYGWIN__) || defined(__APPLE__)

It was almost there... got the binary seagull already linked in the ./bin folder! Good news, but still some required lib is failing to link:
[Linking /Users/ammendonca/Desktop/seagull/build-1.8.1/]
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [/Users/ammendonca/Desktop/seagull/build-1.8.1/] Error 1
make: *** [] Error 2

Boooring! Thought this could be it... so much work and now some weird linkage error was going to throw it all away. Well.. can't give up, tried some own ideas... then went googling, nothing much useful, every linkage error seems to have this same output.

Since it referred main, started looking for it.. no sign of it in the files being linked. Hmm.. that makes sense, it's a library, why would it need to have a main anyway? After checking the flags being used for compilation, just found out this one for compiling a library was not present: -dynamiclib

So I added it to BUILD_LIB_LD_FLAGS_DARWIN in ./build.conf which now looked like this:
BUILD_LIB_LD_FLAGS_DARWIN="-shared -fPIC -dynamiclib"

Yeah! Everything worked just fine! The install was completed successfully and all the binaries were in the bin folder. Hurray!

This was a lengthy journey but in the end it was fruitful.. as always, when it works ;-) Seagull v1.8.1 running on Mac OS X 10.5.6 (Leopard)!

  1. Apple Dev Tools are required to be installed prior to any of this being made. They can be found in  the Install DVD;
  2. I had to run the commands with "sudo" as it required permissions for some operations;
  3. Optionally you can run "./install.ksh" to copy Seagull binaries and config files as suggested in INSTALL.TXT and perform the remaining actions, if needed.

Please let me know if this has been useful for you and/or if something is inaccurate. This has been tested against Seagull 1.7.0 and 1.8.1 on Mac OS X 10.5.6 (Leopard).

Mobicents Diameter v1.1.0.GA Released!

Sunday, October 18, 2009 em 01:25
It was on Friday, 16th October 2009 that a shiny new release of Mobicents Diameter happened.

It's v1.1.0.GA and along with the usual enhancements and bug fixes, the main new features are:
  • JBoss AS 5 support
  • Stack configuration at runtime, via JMX
  • Educative Example for Cx/Dx application
  • Preview of the Mobicents Diameter User Guide
It can be downloaded from here: Mobicents Diameter v1.1.0.GA Downloads

Please note that the JBoss 5 version zip contains only the Stack and the Multiplexer, no JAIN SLEE Resource Adaptors or Examples are included. If you want to try the new Mobicents JAIN SLEE 2.x version (which runs on JBoss 5) and it's Diameter Resource Adaptors and Examples, you'll need to build them from source, which can be found in the SVN trunk.

Summing it up, you now get a more stable Diameter in 2 flavors (JBoss 4 & JBoss 5), the ability to configure the stack in realtime (add/remove realms, add/remove peers, manage timeouts, etc...), a new example of how to play with Cx/Dx (which will be the basis for the HSS prototype) plus the user guide to help you play with all of it!

A special thanks to Jared Morgan and Tom Wells for the extra effort on the documentation!

Mobicents Meeting 2009 @ Brno

Monday, September 7, 2009 em 02:23
It was that time of the year again when the Mobicents Team meets face-2-face to discuss the achievements made through the current year, plan the roadmaps for the upcoming year and last but not the least, party a lot!

This time it happened in Brno, the second largest city in Czech Republic, but at least for this week it was the funniest! Only possible thanks to Pavel, who led us through Brno! Thank You!

It had a quite troubled start, with the Portuguese members (me included) ending up by missing the plane due to issues with the airlines company (which suspended their operations since Sept. 1st). We made it anyway, missing the first day.

Regarding Mobicents, the 2009 achievements were quite amazing:

  • Mobicents SIP Servlets, Mobicents Diameter and Mobicents Media Server became GA.
  • Mobicents JAIN SLEE 2.x had it's first version, BETA1, which was certified for JAIN SLEE 1.1 (JSR 240), being the first besides the specs leader, and still the only open source.

Although all this being accomplished, there's still much more to work on, and a lot of new projects to stabilize. One of the hottest topics was the High-Availability across all these servers, which as you can understand is not a trivial subject and had a quite intense discussion.

On my side, I made a presentation regarding Diameter (available here), the main project where I'm involved. For the achievements of 2009, we have highlighted the following:
  • Integration with Mobicents SIP Servlets;
  • Sh-Client/Server Application support (3GPP TS 29.328 & TS 29.329);
  • Credit Control Application support (RFC 4006);
  • Ro/Rf Application support (3GPP TS 32.225 & TS 32.299);
  • Cx/Dx Application support (3GPP TS 29.228 & TS 29.229)
This was a great improvement for an year! But we won't stop and will evolve it even further, with the following features being the most important ones:
  • High-Availability;
  • Management Console (cross-server);
  • NAT (STUN/TURN/ICE) support;
  • WebServices support;
  • IMS Applications prototypes (HSS/x-CSCF)
So it's still a long road ahead of us, and now it's when the fun begins! And we are counting on the Mobicents Community for helping us out improving!
Here's a picture taken at the end of my presentation:
Left to right: Pavel, Bartosz, Amit, Jean, Vladimir, me, Ivelin, Luis and Eduardo.

And the team warming up for dinner (Pavel is missing and I'm taking the picture):

Left to right: Luis, Amit, Eduardo, Bartosz, Vladimir, Ivelin and Jean.

Cheers for Mobicents team and hope for another successful year!

Welcome to a new era!

Saturday, September 5, 2009 em 03:32
That's right! It's a complete new world for me now that I've started my own blog.

First of all, let me introduce myself and the role of this blog:

I'm a Software Engineer working for JBoss R&D on the open source telco framework Mobicents. I've been using and developing services for it for almost 4 years, namely in JAIN SLEE server, and roughly 2 years ago I started to work on the core team, developing JAIN SLEE core and started from scratch along with Bartosz Baranowski the Diameter component for the project.

It's been a wonderful experience so far, I've learned a lot from all the team members, all JBoss community and from work itself!

Regarding the blog, it's been a project that I've always been delaying but I think the time has come and I hope I can keep it up! I expect to write on a regular basis, mainly with new announcements, some hints regarding my work... and whatever comes to my mind! :)

See you soon!