Thursday 23 April 2015

Flashing Ubilinux (Debian)


Approach 3: Flash the Debian Ubilinux OS which comes with apt-get capability (This worked like a charm!)



Installing numpy and scipy are a piece of cake using apt-get install. However, the Yocto Linox Image does not come with this feature. There is a workaround to this that we have used to get numpy and scipy installed and running. 

Note: Installing Yocto linux allows you make Edison into an end product where you need a fast, stripped-down version of Linux. However, if you need additional features and a full-fledged package manager loading Debian Ubilinux is a better alternative. 

Important: You can potentially brick your Edison by following this tutorial. Be careful not to unplug your Edison for at least 2 minutes where it says so.

1. Install Ubilinux
We need to download the Ubilinux image, which we will install on the Edison, and some software depending on your current operating system.
IMPORTANT: Make sure the Edison is not powered or connected to your host computer at this time.

a) If you haven’t installed Intel’s Edison Drivers for Windows :

1. Click here.
2. Download the Windows Standalone Driver 1.2.1.

b)  Download dfu-util for Windows.

1. Download the Ubilinux image by navigating to http://www.emutexlabs.com/ubilinux      and click on “ubilinux for Edison.”
2. Extract the ubilinux-edison-XXXXXX.tar.gz.
3. Copy the “dfu-util.exe” which was downloaded into the toFlash folder in the  Ubilinux folder.
4. Scroll down the folder and double-click on “flashall.bat”.

c) A command window will open up and ask you to plug in your Edison.

This will begin your installtion. Read the WARNING below.

WARNING: Once the command prompt closes, you need to wait for at least two minutes for the installation to complete. The Edison should reset a couple of times to finalize its installation. Don’t try to disconnect Edison or do anything else for those 2 minutes. Else you risk bricking your Edison.
Your installation is now Complete!

Monday 20 April 2015

Getting Scipy Working on Edison


How to get scipy working on Intel Edison?

Since most Machine Learning algorithms tend to use numpy and scipy, these are some of the main libraries that we need to be able to install on Intel Edison.

Before delving into the solution that worked for us, we will go through all different ways we tried and what problems we encountered at each step.

Approach 1: Try installing scipy using pip


1. We tried installing scipy the same way we installed numpy - 

pip install scipy

However, this failed as it required BLAS(Atlas) and gfortran. 

2. So we tried installing BLAS using the following commands:

2. tar jxvf ./atlas3.10.2.tar.bz2
4. mkdir ./ATLAS/build
5. cd ./ATLAS/build
6. ../configure --prefix=/usr/local --with-netlib-lapack-tarfile=/home/root/lapack-3.5.0.tgz --nof77 -v 2
7. make build
8. make install

However, even after 15 hours the installation didn’t complete. In case it completes for you, you can also try installing gfortran similarly. 

3. To install gfortran:

1. opkg install libgmp-dev libmpfr-dev libmpc-dev
2. wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-4.9.1/gcc-4.9.1.tar.bz2
3. tar jxvf ./gcc-4.9.1.tar.bz2
4. mkdir ./gcc-4.9.1/build
5. cd ./gcc-4.9.1/build
6. ../configure --prefix=/usr/local --enable-languages=c,c++,fortran --with-fpmath=sse
7. make
8. make install
However, many forum posts show that this also may not succeed because, more than 4GB disk space was required to build gfortran.
However, if you are successful in installing both you should now be able to run pip install scipy.

Approach 2: Try installing scipy using Miniconda


You can follow the process as shown in the following link -


However, we were unsucessful in getting scipy installed using this method.

Approach 3: Use a hack with Debian (Ubilinux) image instead of Yocto Linux. (This works!)


Refer to the next few blog posts to get familiarized with Ubilinux. 

Getting Numpy on Intel Edison


How to get Numpy working on Intel Edison ?

Since most Machine Learning algorithms tend to use numpy and scipy, these are some of the main libraries that we need to be able to install on Intel Edison.

Before installing numpy, the following  libraries and paclages need to be installed- 
1. Install setup-tools

1. wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
2. python ez_setup.py --insecure

2. Install pip

sudo easy_install pip

3. Install numpy

pip install numpy

Note: numpy package takes a long time to install. So be patient. 
This works even with the Ubilinux image.