【quote] Alexandre Mendonça [ Original post ]
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/project.mk] 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 compiler.mk file (inside work folder) where it said "Compiler variable for OS DARWIN not defined" .
[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!
[Compiling /Users/ammendonca/Desktop/seagull/work-1.8.1/y.tab.c]
y.tab.c: In function 'int yyparse()':
y.tab.c:1349: error: 'yylex' was not declared in this scope
y.tab.c:1587: error: 'yyerror' was not declared in this scope
y.tab.c:1733: error: 'yyerror' was not declared in this scope
make[1]: *** [/Users/ammendonca/Desktop/seagull/work-1.8.1/y.tab.o] Error 1
make: *** [all_seagull] Error 2
Checking the referred y.tab.c 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.
#if defined(__linux__) || defined(__CYGWIN__)to
#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/libtrans_ip.so]
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/libtrans_ip.so] Error 1
make: *** [all_libtrans_ip.so] 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!
- Apple Dev Tools are required to be installed prior to any of this being made. They can be found in the Install DVD;
- I had to run the commands with "sudo" as it required permissions for some operations;
- 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).
发表评论
-
【译】策略和计费控制架构 (发布号11)
2012-03-12 22:22 04 高层次的需求 4.1 总 ... -
Ethernet Frame
2012-01-03 16:02 15241. The term "Frames" ... -
GNU Coding Standards
2011-06-13 11:20 885Standard Targets all ins ... -
Notes for Java NIO
2011-02-06 19:31 82Buffer What is buffer? inter ... -
Happens-before in Java
2010-12-20 07:05 215the result of a write by one th ... -
What should a developer know before building a public web site?
2010-11-30 09:54 962The idea here is that most ... -
4 General Core Scalability Patterns
2010-09-10 09:19 712Jesper Söderlund put together ...
相关推荐
进行中,请勿使用Seagull.js 轻量级零配置Typesafe同构云框架。 一个现代的Web框架,将无服务器后端与多页React前端结合在一起,以打字稿形式编写/为打字稿编写。入门快速介绍启动和运行所需的最小设置。 $ npm run ...
HoRNDIS (pronounce: “horrendous”) is a driver for Mac OS X that allows you to use your Android phone's native USB tethering mode to get Internet access. It is known to work with Mac OS X versions ...
在 OS X Yosemite 上安装 Intel ICPC 以使用 OpenMP 下载适用于 C++ OS X 的英特尔:registered: Parallel Studio XE Composer 版。它对大学生免费。 我是学生,所以我申请了学生许可证。 我收到了一封包含序列号和...
6. Installing the Software in Interactive Mode 7. Installing the Software in Silent Mode 8. Installing the INF Files Prior to OS Installation 8A. Installing the Windows* 2000 INF Files Prior to OS ...
2.4.2. Installing MySQL on Mac OS X Using Native Packages 2.4.3. Installing the MySQL Startup Item 2.4.4. Installing and Using the MySQL Preference Pane 2.4.5. Using the Bundled MySQL on Mac OS X ...
Currently (at mono version 4.2.4) this store remains empty after installing Mono on Mac OS X. Fiddler uses the certificates in this store to validate the certificates of the websites visited. So you ...
安装 Mumax 3.9.1 和 Gnuplot 5.2 在 Windows 10 中的步骤指南 在这篇文章中,我们将一步步指导用户安装 Mumax 3.9.1 和 Gnuplot 5.2 在 Windows 10 操作系统中。这篇文章将为用户提供详细的安装步骤和相关知识点,...
这是一个bash命令保存什么命令,在MP3文件说,因此它适用于仅适用于Mac OS X。 您必须安装了。 如果您不知道如何安装la脚,请按照以下说明操作: $ curl -L -O ...
If you've only used Windows or Mac OS X, you may be daunted by the Linux operating system. And yet learning Linux doesn't have to be hard, and the payoff is great. Linux is secure, flexible, and free....
### 安装Xenomai 3.x:深入解析与步骤指南 #### 一、简介 Xenomai 3.x是Xenomai实时框架的新架构,它可以在不干扰Linux的情况下作为协同内核系统运行,或者直接在主线Linux内核上原生运行。在后者情况下,主线内核...
you'll appreciate how this book concentrates on the tasks you need to know how to do in 23 easy lessons.About the TechnologyIf you've only used Windows or Mac OS X, you may be daunted by the Linux ...
When installing wxWidgets on Windows or OS X, we always recommend building the library from source yourself, and only provide the source package for most platforms. On some platforms, we have provided...
Mikrotik RouterOS is the mainstream microprocessor of the Linux operating system, which, by installing on the company’s dedicated hardware or on standard x86-based computers, converts hardware into a...
STK-Disk913x-Installing and Maintaining a 9137 OPENstorage Disk
STK-Disk913x-Installing and Maintaining a 9133 OPENstorage Disk
STK-Disk913x-Installing and Maintaining a 9131 OPENstorage Disk
STK-Disk913x-Installing and Maintaining a 9135 OPENstorage Disk