Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

January 25, 2017

Build Caffe on OS X using MacPorts and Anaconda

URLs:
Caffe
MacPorts
Anaconda

1. MacPorts
  1.1 Install MacPorts
  1.2 Open Terminal
  1.3 sudo port selfupdate
  1.4 sudo port upgrade outdated
  1.5 sudo port install gflags
  1.6 sudo port install google-glog
  1.8 sudo port install leveldb
  1.7 sudo port install opencv +python27

2. Anaconda
  2.1 Install Anaconda
  2.2 Open Terminal
  2.3 sudo conda update conda
  2.4 sudo conda install -c conda-forge boost=1.63.0
  2.5 sudo conda install -c conda-forge openblas=0.2.19
  2.6 sudo conda install -c conda-forge protobuf=3.0.0
  2.7 sudo conda install -c conda-forge hdf5=1.8.17
  2.8 sudo conda install -c conda-forge lmdb=0.9.18
  2.9 sudo conda install -c conda-forge snappy=1.1.3
  2.10 sudo conda install -c conda-forge numpy=1.11.3
  2.11 sudo conda install -c conda-forge python-leveldb=0.193

3. Caffe
  3.1 Download Caffe source code
  3.2 Extract zip file and move to Caffe folder
  3.3 Open Terminal
  3.4 cp Makefile.config.example Makefile.config
  3.5 Modify Makefile.config file
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1

# Uncomment if you're using OpenCV 3
OPENCV_VERSION := 3

# BLAS choice:
BLAS := open

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := /Users/maninara/anaconda2
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
                  $(ANACONDA_HOME)/include/python2.7 \
                  $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := $(ANACONDA_HOME)/lib

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /opt/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /opt/local/lib

# N.B. both build and distribute dirs are cleared on `make clean`
BUILD_DIR := build
DISTRIBUTE_DIR := distribute

# enable pretty build (comment to see full commands)
Q ?= @
  3.6 sudo make all
  3.7 sudo make pycaffe

May 19, 2016

Dual boot OS X and Ubuntu on Mac Pro (Late 2013)

1. Make bootable Ubuntu USB disk
  1.1 Download Ubuntu
  1.2 Open Terminal
  1.3 hdiutil convert -format UDRW -o /Users/username/Downloads/ubuntu.img /Users/username/Downloads/ubuntu.iso
  1.4 Change ubuntu.img.dmg to ubuntu.img
  1.5 diskutil unmountDisk /dev/disk1
  1.6 sudo dd if=/Users/username/Downloads/ubuntu.img of=/dev/rdisk1 bs=1m
  1.7 diskutil eject /dev/disk1

2. partition
  2.1 Open Disk Utility
  2.2 Select APPLE SSD SM1024F Media
  2.3 Click Partition
  2.4 Change the size of Macintosh HD and apply

3. Install rEFInd
  3.1 Download rEFInd
  3.2 Extract downloaded zip file
  3.3 Reboot and hold Command+R
  3.4 Utilities -> Terminal
  3.5 cd /Volumes/Macintosh\ HD/Users/username/Downloads/refined
  3.6 ./refind-install

4. Launch rEFInd
  4.1 Shut down
  4.2 Insert Ubuntu USB
  4.3 Restart

5. Launch Ubuntu Live
  5.1 Select penguin icon in rEFInd
  5.2 Move highlight to "Try Ubuntu without install"
  5.3 Press "e"
  5.4 Insert "nomodeset radeon.audio=1" between "splash" and "--"
  5.5 Press "F10"

6. Install Ubuntu
  6.1 Click install icon
  6.2

References
http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
http://www.howtogeek.com/187410/how-to-install-and-dual-boot-linux-on-a-mac/
http://www.rodsbooks.com/refind/sip.html
http://samiux.blogspot.com/2015/02/howto-ubuntu-1404-lts-desktop-on-mac.html

August 21, 2015

Setting a static IP address in OS X recovery mode

References:
https://support.apple.com/en-us/HT200168
https://medium.com/@park9eon/맥-복구모드-고정아이피-설정-b62d4611e486

After High Sierra
1. Utilities -> Terminal

2. Check the interface name
ifconfig

3. Set the IP and subnet
ifconfig InterfaceName IP netmask subnet
ifconfig en0 192.168.0.100 netmask 255.255.255.0

4. Set the gateway
route -n delete default
route -n add default gateway -ifscope InterfaceName
route -n add default 192.168.0.1 -ifscope en0

5. Set the DNS
scutil
open
get State:/Network/Global/IPv4
d.show (check the PrimaryService key)
quit
scutil
open
d.init
d.add ServerAddresses * DNS
d.add ServerAddresses * 192.168.0.1
set State:/Network/Service/PrimaryService/DNS
set State:/Network/Service/AAAAAAA-AAAAAA-AAAAAA/DNS
quit

Before High Sierra
1. Utilities -> Terminal

2. Check the interface name
networksetup -listnetworkserviceorder

3. Set the IP, subnet, and gateway
networksetup -setmanual "Interface Name" IP subnet gateway
networksetup -setmanual "Ethernet 1" 192.168.0.100 255.255.255.0 192.168.0.1

4. Set the DNS
networksetup -setdnsservers "Interface Name" DNS
networksetup -setdnsservers "Ethernet 1" 192.168.0.1

5. Quit Terminal