Showing posts with label MAC OSX. Show all posts
Showing posts with label MAC OSX. Show all posts

Tuesday, October 4, 2011

Installing gcc on MAC OS

Download MacPorts. There are available images for Lion and Snow Leopard.

The you should want to update your MacPorts using the commands:
sudo port selfupdate
sudo port upgrade outdated

NOTE: FOR GRAPHLAB, PLEASE USE gcc45 and not gcc46 as in the below
example.

Then you can install gcc using
sudo port install gcc46      #change this to gcc45 for graphlab
You can view other versions of gcc using the command
port search gcc
After installation you can view installed file by
port contents gcc46        #change this to gcc45 for graphlab

Now if you have several gcc versions installed you may want to choose the right version to use.
This is done using the command:
sudo port select gcc mp-gcc46

Now I got some error:
Selecting 'mp-gcc46' for 'gcc' failed: could not create a new link for "/opt/local/bin/gcj'. It seems it is a known issue discussed here.
I applied a quick and dirty fix (Since I don't need gcc Java:)
sudo touch /opt/local/bin/gcj-mp-4.6
And then I get:
Selecting 'mp-gcc46' for 'gcc' succeeded. 'mp-gcc46' is now active.

Monday, February 28, 2011

The GraphLab large scale machine learning framework - installation on MAC OSX 10.6

GraphLab is an open source large scale parallel machine learning framework.

I was asked by Dan, an avid reader of this blog, to supply installation instructions for MAC OSX Snow Leopard 10.6. Installation is quite simple.

1) Install cmake using the following link: cmake 2.8.4

2) Download graphlab code and install GraphLab where XXX is the latest version you can find in here
wget http://graphlab.org/release/graphlabapi_v1_XXXX.tar.gz
tar xvzf graphlabapi_v1_XXXX.tar.gz
cd graphlabapi
./configure --bootstrap 
cd debug #or equivalently cd release
make -j 4
cd tests
./runtests.sh

Anyone who tries it out - update me if it went smoothly!

NOTE: We now support Eigen linear algebra package. It can be installed using the command:
./configure --bootstrap --eigen
However, on MAC OS, gcc45 is required. See explanation here.

NOTE2: The current GraphLab MAC setup default to gcc-4.2. If you like to use your default compiler, you can comment the first few lines of the file CMakeLists.txt in the root graphlab folder, namely the lines:
if(APPLE)
  set(CMAKE_C_COMPILER "gcc-4.2")
  set(CMAKE_CXX_COMPILER "c++-4.2")
endif(APPLE)