Once your Amazon Linux ami is up and running, connect via ssh and let's begin setting up your machine to build with emscripten!
Get emscripten code
Install git with this command:$ sudo yum install git
Get the source code for emscripten:
$ git clone git://github.com/kripken/emscripten.git
Get clang/llvm
Go to the webpage http://llvm.org/releases/download.htmlYou're linux box should be 64 bit so you will want the download for "Clang Binaries for Ubuntu-12.04/x86_64"
Download this file, then rename it to something simpler like llvm.tar.gz
Copy this to your amazon box user folder - I used winscp to copy it to where I wanted.
Now run the command to unzip the file:
$tar -xzvf llvm.tar.gz
Rename the folder it unzipped to "llvm" to make life easier. Again I used winscp to do the rename, use whatever is comfortable for you.
Create the config file for emscripten
Go to your emscripten folder$cd emscripten
Run the command to build the config files
$./emcc
Fix the path to the llvm code you downloaded
$nano ~/.emscripten
In the file change the path to be something like:
LLVM_ROOT='home/ec2-user/llvm/bin'
Upgrade Glib
The image comes with 2.12. Emscripten needs 2.15!
Change directory so you are in your user folder.
To get the installer run:
$wget http://ftp.gnu.org/gnu/glibc/glibc-2.15.tar.gz
Unzip the installer and navigate to the folder:
$tar -xvzf glibc-2.15.tar.gz
$cd glibc-2.15
Make and navigate to a build folder
$mkdir glibc-build
$cd glibc-build
Create the config file, build and install
$../configure --prefix='/usr'
$make
$sudo make install
This process takes a while so get coffee after you run $make!
Install JS Node
Follow these instructions:http://faantasticcoder.blogspot.com/2013/05/installing-nodejs-on-amazon-ec2-linux.html
Run emscripten
At this point emscripten is installed and you should be able to run emscripten.Navigate to the emscripten folder under your user folder (where you ran git).
Run:
$cd emscripten
$./emcc
You should see the following output:
No comments:
Post a Comment