Learning by doing.
How to Compile STREAMER on Mac OSX?
In case my domain changes, below is the long-term URL for this post:
Step 1. Check if the “Xcode command line tools” is installed.
Open the terminal and type in:
If we haven’t installed the tools, a prompt will poped out and just click “install”.
We don’t have to install the whole package of “Xcode”, we just need the “command line tools”.
The root authority is needed.
To verify the installation:
If the terminal returns as below, then we have installed successfully.
Step 2. Get the latest version of GCC.
Mac OS X should be installed with GCC as default, I haven’t checked if that is OK for our compiling task (should be OK).
I compiled with the latest versioin of
gfortran, which is bundled in the GCC package.
I recommend you guys a lovely package manager called “Homebrew”. We can conveniently install the latest version of GCC by it.
To install “Homebrew”:
NOTE: The admin authority is needed by default. Alternatively, we can install it under our home directory.
Then install the latest version of GCC by:
~/.bash_profile (for Bash users) or
~/.zshrc (for Zsh users), add the PATH for GCC, for example:
Then make soft links as
4.9.2_1 is the version I used, and it may not be the one you are
using, so please check the version number and make sure the paths you typed in do exist.
source the file you just editted:
To verify the installation of GCC, in the terminal we type in:
we can get the return and know the version number.
Also, we can verify the
gfortran is what we need to compile the STREAMER program.
Step 3. Edit the
Makefile under the STREAMER
progs directory and compile.
Once we have installed
gfortran, we are ready to compile the STREAMER program on OS X.
First download the tarball of STREAMER,
wget is a command line download tool.
If it has not been installed yet, we can install it by:
Then we untar the tarball,
We will see a directory called
progs, cd into it
and we will see some makefiles.
Then modify the value of the variable
Now compile the program by typing in the below command in the terminal
If the compiling is successful, we will get an executable file named as
streamer under the
What questions do you have?
If you have any questions, feel free to contact me (email@example.com). ; )