Start scientific computing on a new OS X

You got your new MacBook/Mac, and (of course) you are excited. Now you want to use it for scientific computing, let me get you started. First of all, the programming environment on an OS X system is based on an App that is distributed in the App Store. Yes, in the App Store. You need to download the newest version to enable the newest features. Its name is XCode. Download it from App Store. You need to sign in with your Apple ID. Now you are ready to install the next important tool called macports. Macports integrated almost all the essential and fancy packages for you to do scientific computing. Here is its official website:

https://www.macports.org/

Download it and install. After it’s installed, open a Terminal window (which is found in Launchpad-Other), type the following command

xcode-select --install

This installs all the command line tools

macports needs. Then, accept the XCode license by

xcodebuild -license

Now you are ready to install ports from macports. You may go through the available list for all the ports you can install. From my own perspective, I found the following ones particularly useful:

  • python27, py27-numpy, py27-matplotlib, py27-ipython, py27-notebook
  • inkscape
  • cmake
  • openmpi

If you would like to check whether a command exists in your OSX, you may do

which command_name
e.g. for me my ssh exists in /usr/bin/.

<frankliuao~|592$> which ssh
/usr/bin/ssh

If it does not exist, the return will be empty. Most of the commonly used programs are probably already included in the Macports, in order to search for one with a keyword, do

port search keyword

e.g. if I search for a very useful program for vector diagram drawings, called inkscape, the return will be

Then you can start installing the port with admin privilege: