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.

10 Responses to Compiling Dynamips on (Intel) Mac

  1. Greg

    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”

  2. David Sudjiman

    Thanks Greg, the dynamips-0.2.7-intel-mac.tar.bz2 is now updated with much smaller size.

  3. Scott Vermillion

    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.a to sudo ln -s /opt/usr/local/libpcap.a /usr/lib/libpcap.a - the difference being that I had to strip out the local), but other than that it went off without a hitch!

    Regards,

    Scott

  4. David Sudjiman

    Thx Scott, you’re right. It really depends _where_ the libpcap.a is.

  5. jeff

    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

  6. jamie

    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

  7. David Sudjiman

    Jamie, have you install libpcap yet??

  8. Barry

    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

  9. Zakk

    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

  10. roaminajeep

    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

Leave a Reply