-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathsetup.txt
74 lines (66 loc) · 2.43 KB
/
setup.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Title: 'Install steps for OpenCV NaCl development on Ubuntu 14.04'
# Date: 20151104
# Author: Matt McDonnell ([email protected])
# Description: Steps for setting up a development environment for OpenCV
# using Google Native Client (NaCl) on a bare Ubuntu 14.04 instance.
# Tested on Amazon EC2 using a t2.micro instance running Ubuntu Server
# 14.04 LTS.
#
# Install packages needed for NaCl SDK and naclports
# Note that the NaCl SDK uses 32 bit versions of some libraries so these
# need to be installed as well as the 64 bit versions. If a particular
# naclport fails to build check for missing 32 bit library first.
sudo apt-get update
sudo apt-get install unzip
sudo apt-get install libc6-i386
sudo apt-get install git
sudo apt-get install build-essential
sudo apt-get install lib32stdc++6
sudo apt-get install cmake
sudo apt-get install curl
# Install python
# My preference is to use the Anaconda distribution
# but apt-get will also work.
# Create directory structure for external code files (NaCl SDK, etc)
# This directory structure is a personal preference so feel free to modify
# (and change the paths in the rest of this script)
mkdir Work
mkdir Work/ExternCode
cd Work/ExternCode/
# Install NaCl SDK
curl -O https://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip
unzip nacl_sdk.zip
cd nacl_sdk/
./naclsdk list
./naclsdk update
# Install depo-tools needed to install naclports
cd ~/Work/ExternCode
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# Add depot_tools to path and set NACL_SDK_ROOT
vim ~/.bashrc
# Add lines below (without #) to .bashrc, modifying for location and SDK version if necessary
# export PATH="/home/ubuntu/Work/ExternCode/depot_tools":"$PATH"
# export NACL_SDK_ROOT="/home/ubuntu/Work/ExternCode/nacl_sdk/pepper_46/"
exit # Logout and login again to pick up new environment settings
# Install NaCl ports
cd Work/ExternCode/
mkdir naclports
cd naclports/
gclient config --name=src https://chromium.googlesource.com/webports
gclient clean
gclient sync
cd src/
# Set up git config with your name and email
git config --global user.email "[email protected]"
git config --global user.name "User Name"
# Make opencv and dependencies (takes about 20 minutes)
NACL_ARCH=pnacl make opencv
# (optional) Clone my NaCl demos
cd
cd Work/
mkdir Projects
cd Projects/
git clone https://github.com/mattmcd/NaCl.git
cd NaCl/ImageProc/
make
make serve # Expose port 8000 and try it out