Posts Tagged ‘UNIX’

Compiling and Installing NASM on Mac OS X

Posted in Programming on August 19th, 2009 by Simon Connah – 6 Comments

First things first, make sure you have installed the latest version of Xcode from the Apple Developer website (the version that comes on the Mac OS X DVDs is most likely an older version). Once that is installed you need to download the latest source code distribution of NASM from here, it is located under the Download tab.

Once you have the file downloaded (it should be called something like nasm-x-xx.tar.bz2 – if it has RC in the name download the next lowest number that does not have RC in the file name as we want to use a stable version for the purposes of learning) just double click on it to extract its contents into a folder.

Now open up the Terminal application which is located in /Applications/Utilities/ and type “cd” followed by a space. Then drag the folder that was just extracted from the nasm archive and drop it onto the Terminal window. This should place the path to the folder after the cd and space. If it looks something like:

cd ~/Downloads/nasm-2.07

then you have done it correctly. Press return and the terminal should place you inside the nasm distribution folder. Type the following commands exactly as they appear below:

./configure
 
make
 
sudo make install

after you have typed sudo make install it will ask you for your password. This is your administrator account password. It will not show anything as you type as a security measure so make sure you don’t forget how far you have got :) .

Now inside the Terminal window if you type

nasm -v

you should see the following (or something similar) output:

NASM version 2.07 compiled on Aug 13 2009

congratulations, you now have the latest version of NASM installed. If you have any questions please leave a comment and I will try my best to answer them (perhaps in a new blog post).