Showing posts with label install. Show all posts
Showing posts with label install. Show all posts

June 29, 2017

Compiling RetroArch (avdmame + FBA + PSX + N64) with attract mode on Raspberry Pi 3

1. raspbian
  1.1 Download raspbian jessie lite image file
  1.2 diskutil list
  1.3 diskutil unmountDisk /dev/disk4
  1.4 sudo dd bs=1m if=raspbian-jessie.img of=/dev/rdisk4
https://www.raspberrypi.org/downloads/raspbian/
https://www.raspberrypi.org/documentation/installation/installing-images/mac.md

2. setup
id: pi
pw: raspberry
  2.1 [option] set static ip
    2.1.1 sudo vi /etc/network/interfaces
#auto lo
#iface lo inet loopback
#iface eth0 inet manual
auto eth0
iface eth0 inet static
address IP
netmask MASK
gateway GATEWAY
dns-nameservers DNS
    2.1.2 sudo /etc/init.d/networking restart
  2.2 [option] wifi setup
  2.3 config
    2.3.1 sudo raspi-config
1 Change User Password
4 Localization Options -> I3 Change Keyboard Layout -> Generic 101-key PC -> Other -> English (US)
5 Interfacing Options -> P2 SSH
7 Advanced Options -> A1 Expand Filesystem
7 Advanced Options -> A3 Memory Split -> 128
7 Advanced Options -> A4 Audio -> Force HDMI
  2.4 hdmi force output
    2.4.1 sudo vi /boot/config.txt
hdmi_force_hotplug=1
  2.5 update
    2.5.1 sudo apt-get update
    2.5.2 sudo apt-get dist-upgrade
  2.6 prepare
    2.6.2 cd ~
    2.6.2 mkdir build
http://elinux.org/Configuring_a_Static_IP_address_on_your_Raspberry_Pi
https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

3. avdmame
  3.1 cd ~/build
  3.2 sudo apt-get install git autoconf automake libasound2-dev libfreetype6-dev zlib1g-dev libexpat1-dev libslang2-dev libncurses5-dev
  3.3 git clone https://github.com/amadvance/advancemame.git
  3.4 cd advancemame
  3.5 sh autogen.sh
  3.6 ./configure
  3.7 make -j4
  3.8 sudo make install
http://www.advancemame.it/doc-build

4. sfml
  4.1 cd ~/build
  4.2 sudo apt-get install cmake libflac-dev libogg-dev libvorbis-dev libopenal-dev libjpeg8-dev libfreetype6-dev libudev-dev libraspberrypi-dev
  4.3 git clone --depth 1 https://github.com/mickelson/sfml-pi.git
  4.4 cd sfml-pi
  4.5 mkdir build
  4.6 cd build
  4.7 cmake .. -DSFML_RPI=1 -DEGL_INCLUDE_DIR=/opt/vc/include -DEGL_LIBRARY=/opt/vc/lib/libEGL.so -DGLES_INCLUDE_DIR=/opt/vc/include -DGLES_LIBRARY=/opt/vc/lib/libGLESv1_CM.so
  4.8 sudo make install
  4.9 sudo ldconfig
https://github.com/mickelson/sfml-pi

5. ffmpeg
  5.1 cd ~/build
  5.2 sudo apt-get install libomxil-bellagio-dev libmp3lame-dev
  5.3 git clone --depth 1 git://source.ffmpeg.org/ffmpeg.git
  5.4 cd ffmpeg
  5.5 ./configure --arch=armhf --target-os=linux --enable-gpl --enable-mmal --enable-omx --enable-omx-rpi --enable-nonfree --enable-libfreetype --extra-libs=-lasound --enable-libmp3lame --disable-debug --enable-shared
  5.6 make -j4
  5.7 sudo make install
  5.8 sudo ldconfig
https://github.com/FFmpeg/FFmpeg
https://trac.ffmpeg.org/wiki/CompilationGuide/RaspberryPi

6. retroarch
  6.1 sudo vi /usr/local/lib/pkgconfig/bcm_host.pc
prefix=/opt/vc
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: bcm_host
Description: Broadcom VideoCore host API library
Version: 1
Libs: -L${libdir} -lbcm_host -lvcos -lvchiq_arm -pthread
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads -DUSE_VCHIQ_ARM
  6.2 sudo vi /usr/local/lib/pkgconfig/egl.pc
prefix=/opt/vc
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: EGL
Description: Fake EGL package for RPi
Version: 10
Requires: bcm_host
Libs: -L${libdir} -lEGL -lGLESv2 -lbcm_host -lvchostif
Cflags: -I${includedir} -I${includedir}/interface/vmcs_host/linux -I${includedir}/interface/vcos/pthreads
  6.3 sudo vi /usr/local/lib/pkgconfig/glesv2.pc
prefix=/opt/vc
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: GLESv2
Description: Fake GL ES 2 package for RPi
Version: 10
Requires: bcm_host
Libs: -L${libdir} -lGLESv2
Cflags: -I${includedir}
  6.4 cd ~/build
  6.5 sudo apt-get install libusb-1.0-0-dev libavresample-dev libdrm-dev libgbm-dev libxml2-dev libv4l-dev libxkbcommon-dev libdbus-1-dev
  6.6 git clone --depth 1 https://github.com/libretro/RetroArch.git
  6.7 cd RetroArch
  6.8 ./configure --enable-neon --enable-floathard --enable-alsa --enable-udev --enable-opengl --enable-opengles --enable-egl --enable-fbo --enable-dispmanx --enable-ffmpeg --disable-sdl --disable-sdl2 --disable-opengles3 --disable-vg --disable-cg --disable-x11 --disable-wayland --disable-pulse
  6.9 vi qb/config.libs.sh
line 47 HAVE_OPENGLES='auto' -> HAVE_OPENGLES='yes'
  6.10 vi config.mk
CFLAGS = -mfpu=neon-fp-armv8 -mfloat-abi=hard -march=armv8-a+crc -mtune=cortex-a53
ASFLAGS = -mfpu=neon-fp-armv8 -mfloat-abi=hard -march=armv8-a+crc -mtune=cortex-a53
  6.11 make -j4
  6.12 launch and quit retroarch once
  6.13 cd /home/pi/.config/retroarch
  6.14 rm -rd assets
  6.15 wget https://github.com/libretro/retroarch-assets/archive/master.zip
  6.16 unzip master.zip
  6.17 mv ./retroarch-assets-master/ ./assets/
  6.18 rm ./master.zip
https://github.com/libretro/RetroArch
https://www.raspberrypi.org/forums/viewtopic.php?t=56070
http://alexmax2742.blogspot.kr/2016/07/retroarch-on-raspberry-pi.html
https://github.com/raspberrypi/userland/issues/245

7. fb alpha
  7.1 cd ~/build
  7.2 git clone https://github.com/libretro/fbalpha.git
  7.3 cd fbalpha
  7.4 make -j4 -f makefile.libretro platform=rpi3
https://github.com/libretro/fbalpha

8. PSX
  8.1 cd ~/build
  8.2 git clone https://github.com/libretro/pcsx_rearmed.git
  8.3 cd pcsx_rearmed
  8.4 make -j4 -f Makefile.libretro platform=rpi3
https://github.com/libretro/pcsx_rearmed

9. N64
  9.1 cd ~/build
  9.2 git clone --depth=1 https://github.com/libretro/mupen64plus-libretro.git
  9.3 cd mupen64plus-libretro
  9.4 platform=rpi3 make -j4
https://github.com/libretro/mupen64plus-libretro

10. attract
  10.1 cd ~/build
  10.2 git clone --depth 1 https://github.com/mickelson/attract.git
  10.3 cd attract
  10.4 make -j4 USE_GLES=1
  10.5 sudo make install
Configure-->General-->Window Mode = FullScreen Mode
Configure-->General-->Video Decoder = mmal
https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-%28Raspbian-Jessie%29

11. [option] bluetooth
  11.1 sudo bluetoothctl
  11.2 agent on
  11.3 default-agent
  11.4 scan on
  11.5 pair xx:xx
  11.6 trust xx:xx
  11.7 connect xx:xx
https://www.cnet.com/how-to/how-to-setup-bluetooth-on-a-raspberry-pi-3/

12. [option] GPIO
https://github.com/recalbox/mk_arcade_joystick_rpi

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