Compiling Dynamips on (Intel) Mac
by David Sudjiman ~ June 12th, 2007. Filed under: Cisco, Mac.For those Apple Mac (Intel) users out there that have been asking how to compile Dynamips on Apple Mac(Intel) or if you want, you can try my Apple-Mac-(Intel)-compiled dynamips-0.2.7-intel-mac.bin.tar.bz2.
I’m not a programmer and don’t have any programming nor even Apple MAC (Intel) experience. Therefore, I can’t really explain what is happening here and why you need to do so.
XCode.
This is the package from Apple for those Apple Mac users who want to start do some programming and compiling. Apparently, It’s a big file (approx. 924MB) to download and you need to create an account with Apple. Installation is pretty straightforward. Download the package Xcode 2.4.1 (DMG) and follow the instructions.
Darwin Ports
get this file from Darwin Ports follow the installation instructions and update your ports using this command.
$ sudo port -d selfupdate Password: <your root password>
What you need is a libpcap.a file and you can get it from Darwin port.
$ sudo port install libpcap Password: <your root password>
Create a symbolic link to this libpcap.a file
$ sudo ln -s /opt/usr/local/libpcap.a /usr/local/lib/libpcap.a Password: <your root password>
Libelf – ELF object file access library.
$ curl 'http://www.mr511.de/software/libelf-0.8.9.tar.gz' -o libelf-0.8.9.tar.gz $ tar -zxvf libelf-0.8.9.tar.gz $ cd libelf-0.8.9 $ ./configure --prefix=/usr/local $ make $ sudo make install
Dynamips
$ curl 'http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz' -o dynamips-0.2.7.tar.gz $ tar -zxvf dynamips-0.2.7.tar.gz $ cd dynamips-0.2.7 $ make $ mv dynamips dynamips-0.2.7.intel-mac.bin
Thanks to dynamips (Cisco 7200 Simulator) on Mac OS X
NOTE: Why the compile output has 4MB file instead of small binary like Linux/Windows?
ANSWER: Check Greg’s comments. The file is now updated with smaller size.
June 12th, 2007 at 1:13 am
Nice writeup. You need to strip the binary to remove the debugging symbols. That’s why the file size is so big. Just do “strip dynamips-0.2.7.intel-mac.bin”
June 12th, 2007 at 9:42 am
Thanks Greg, the dynamips-0.2.7-intel-mac.tar.bz2 is now updated with much smaller size.
December 2nd, 2007 at 9:30 am
Hey David,
Thanks much for the write-up. I was able to compile 0.2.8-RC2 following your instructions. I had a minor variation having to do with file locations (IIRC, I had to change
sudo ln -s /opt/usr/local/libpcap.a /usr/local/lib/libpcap.atosudo ln -s /opt/usr/local/libpcap.a /usr/lib/libpcap.a– the difference being that I had to strip out thelocal), but other than that it went off without a hitch!Regards,
Scott
December 2nd, 2007 at 8:00 pm
Thx Scott, you’re right. It really depends _where_ the libpcap.a is.
January 16th, 2008 at 9:35 am
Hi David,
I have compiled dynamips as stated above. Can you tell me how to start it from the terminal please..i.e what command to use?
cheers,
jeff
January 17th, 2008 at 1:44 pm
I am getting this message when I try to run make. Everything previous worked without error.
$ make
Linking rom2c
i686-apple-darwin9-gcc-4.0.1: /usr/local/lib/libpcap.a: No such file or directory
make: *** [rom2c] Error 1
January 17th, 2008 at 2:10 pm
Jamie, have you install libpcap yet??
April 1st, 2008 at 10:05 pm
I had the same error trying to start the make process.
I had to change the ln into this to fix it
( After first removing the original alias which pointed to a dir that did not exist )
$ sudo ln -s /opt/local/lib/libpcap.a /usr/local/lib/libpcap.a
April 10th, 2008 at 1:22 am
I’m a newbie to Linux, but these instructions seem pretty straight forward. I have the same problem as Jamie and I cannot get around it. After following Barry’s suggestion I get this:
$ sudo ln -s /opt/local/lib/libpcap.a /usr/local/lib/libpcap.a
ln: /usr/local/lib/libpcap.a: File exists
So the libpcap.a file is there. Yet, when I try to start the make process I get the same error as jamie:
$ make
Linking rom2c
i686-apple-darwin8-gcc-4.0.1: /usr/local/lib/libpcap.a: No such file or directory
make: *** [rom2c] Error 1
What am I doing wrong here?
Frustrated,
Zakk
April 30th, 2008 at 12:32 pm
Zakk,
it really depends on where your libpcap.a file is located. once you have determined that and create the symbolic link (it shouldn’t return any output when you correctly assign the link) the make command for the dynamips install will work.
here is the path/command for mine:
sudo ln -s /opt/local/var/macports/software/libpcap/0.9.8_0/opt/local/lib/libpcap.a /usr/local/lib/libpcap.a
oh! and you might need a to install a newer version of dynamips.. i did version 2.8 RC 2.
You can find the latest version here
http://www.ipflow.utc.fr/dynamips/dynamips-0.2.8-RC2.tar.gz
February 5th, 2009 at 2:04 am
Hi,
I was able to do all the steps here using 0.2.8-RC2 and it was smooth. Pardon me for I am not good in programming..
My question now,
How can I run this now? Please give me step by step process
How can I apply the internetwork expert topology here?
Rgds,
CV
July 4th, 2009 at 4:32 pm
[...] Compiling Dynamips on (Intel) Mac [...]
September 22nd, 2009 at 7:51 am
I would like to compile dynamips on my Snow Leopard MacMini.
Is it just to follow your guide? I am not a programmer, I have never before compiled a program.
October 15th, 2009 at 6:30 am
Did you try to compile it using dynamips 2.8RC2.. I need one urgently. I am trying to follow the directions above and am having problems. Please let me know.
Thanks
Nikhil
dvbn844[at]gmail.com
October 15th, 2009 at 6:53 am
I am getting this error when I make 2.8-RC2
Compiling mips64_jit.c
mips64_jit.c:258: warning: ‘insn_jump_find’ defined but not used
/var/folders/g3/g3g2ojmoF2WEeDIAOXDuMk+++TI/-Tmp-//cc491UUf.s:1328:suffix or operands invalid for `mov’
make: *** [mips64_jit.o] Error 1
October 28th, 2009 at 4:22 am
I’m getting this error when introduce make command, I mean, I don’t know who this mean
making all in lib
make[1]: Nothing to be done for `all’.
making all in po
make[1]: Nothing to be done for `all’.
thanks!!
October 28th, 2009 at 8:13 pm
I also found that Snow Leopard won’t compile dynamips as a 64 bit application – looks like the jit is for a 32 bit instruction set, hence the error when compiling as an x86 architecture. I tried changing the DYNAMIPS_ARCH in the makefile to amd_64 and it compiled ok and ran, but seg faulted when it tried to load an IOS image. Then I disabled the jit by setting the DYNAMIPS_ARCH to nojit and it compiled and runs fine. I also screwed around with setting compiler options to -m32, but this threw up wrong architecture type errors with my Port libs (because they are all noewly compiled by 10.6 as 64 bit). Looks like someone needs to rewrite the jit for 64 bit to work with 10.6.
November 17th, 2009 at 7:33 am
If anyone has been able to compile dynamips properly on Snow Leopard could they share it with the rest and upload the file here: http://7200emu.hacki.at/viewtopic.php?t=8113 ?
December 4th, 2009 at 7:55 am
@Phoman – Can you please describe how exactly is it that you change the “DYNAMIPS_ARCH” to nojit ?
I’ve updated xcode, updated macports and run into the issues people have posted here regarding Snow Leopard. I am just curious how to make the necessary changes recommended.
BTW – This issues is documented : http://trac.macports.org/ticket/22285