Author Topic: Installing libpinproc, pypinproc, and pyprocgame on Mac OS X 10.9 Mavericks  (Read 6022 times)

Brian Madden

  • Wizard
  • *****
  • Posts: 498
  • Mission Pinball
    • View Profile
    • Mission Pinball
I just got libpinproc, pypinproc, and pyprocgame installed onto my Mac OS X running Mavericks 10.9.3. I'm posting my complete step-by-step procedure here since this required a lot of trial-and-error. I know there is a page in the wiki and several forum posts on this, and they were all helpful but not complete. I'm posting here for anyone who might need it. I'm curious as to others' feedback on this, and if it looks ok then I'll update the wiki.

Note this uses the built-in python 2.7 version that comes with the Mac. Everything I've done so far has been on Python 2.6, but from what I can tell it works fine with 2.7?

Also I removed all references to the i386 architecture when I installed it which I think means I'm running 64-bit.

  • Install XCode from the Mac App Store
  • Download libusb-1.0.18 http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.18/
  • Unzip to my working folder called "proc" which is in the root of my home folder on the Mac. (I'll call this "/proc" from here on out.)
  • Open a terminal window and change to that /proc folder and run ./configure
  • sudo make
  • sudo make install
  • Download libusb-compat http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/libusb-compat-0.1.5/
  • Unzip to /proc and change to that folder
  • ./configure LIBUSB_1_0_CFLAGS=-I/usr/local/include/libusb-1.0 LIBUSB_1_0_LIBS="-L/usr/local/lib -lusb-1.0"
  • make
  • sudo make install
  • download cmake 2.8.12.2 universal dmg from http://www.cmake.org/cmake/resources/software.html
  • install the cmake package by double clicking the pkg file
  • Choose the default /usr/bin location and choose to install the command line tools
  • Download libftdi1-1.1 http://www.intra2net.com/en/developer/libftdi/download.php
  • unzip into /proc folder
  • change to that folder
  • mkdir bin
  • cd bin
  • cmake .. <-- needs the “..” at the end to specify the parent folder (got a boost error, but that doesn't seem to matter)
  • make
  • sudo make install
  • download yaml-cpp 0.2.6 https://code.google.com/p/yaml-cpp/downloads/detail?name=yaml-cpp-0.2.6.tar.gz&can=2&q=
  • unzip and copy to /proc
  • change to that folder
  • mkdir bin
  • cd bin
  • cmake .. <-- note the dots
  • make
  • sudo make install
  • download libpinproc and pypinproc
  • extract and remove the “-dev” or "-master" extensions, copy them to the /proc folder
  • change to libpinproc folder
  • mkdir bin
  • cd bin
  • cmake -DBUILD_SHARED_LIBS=ON .. <-- again note the two dots at the end
  • edit CMakeLists.txt.
  • Change the include line to this: include_directories(${PINPROC_SOURCE_DIR}/include ${EXTRA_INC} /usr/local/include ${FTDI_INC} /usr/local/include/libftdi1 /usr/local/include/libusb-1.0)
  • Add the following line with the others below it: set(lib_ftdi_usb usb-1.0 ftdi1)
  • Save the file
  • make
  • sudo make install
  • change to pypinproc folder
  • python setup.py build
  • sudo python setup.py install
  • download pyYAML 3.11 from http://pyyaml.org/wiki/PyYAML
  • unzip and copy that folder to /proc
  • change to that folder
  • sudo python setup.py install
  • Download pygame. Pick the “Lion apple supplied python” pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip from http://www.pygame.org/download.shtml
  • Install the package
  • Download & install xquartz for mac http://xquartz.macosforge.org/landing/
  • Download PIL 1.1.7 source kit from http://www.pythonware.com/products/pil/
  • unzip and copy to /proc
  • change to that folder
  • edit setup.py (from the PIL imaging source folder)
  • add the following line after line 148: add_directory(include_dirs, "/opt/X11/include")
    <-- I had to do a search for Xlib.h to get the path right
  • sudo python setup.py install

If you want pyglet: (Which I do in order to get the prettier on-screen DMD

Simple! :)
Brian
The Mission Pinball Framework (MPF) Project*
Twitter
* Disclaimer: MPF is a work-in-progress!

TurqMage

  • Newbie
  • *
  • Posts: 17
    • View Profile
37. edit CMakeLists.txt.
At this point you are in the bin/ folder. There is a bin\CMakeCache.txt  CMakeList.txt is up a level.

44. python setup.py build
Ran into an issue with...
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

Need to run:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
(http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa)


I am up to step 50.  But making more progress than I did before I saw this post.  Thanks :)

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
Quote
Download pygame. Pick the “Lion apple supplied python” pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip from

Recently had an issue with this version, more so around missing dependencies for one of the pygame modules (movie) that I was experimenting with (converting mp4 files to DMD files).  I ended up using macports to install it and that handled it cleanly as far as getting all the other dependencies.  Ended up not using movie to do the converting of the files, using opencv instead, but MOcean does not like that since it is an additional package that few would have already installed.  So, I pointed him at a different possible method that he may be trying out.  I'm already planning to use openCV for something else on my next project, so I already had it installed.  I guess I should do a post on the mp4 thing and debate it with MOcean there  :-)

TurqMage

  • Newbie
  • *
  • Posts: 17
    • View Profile
After following these steps I ran into a bit of a wall trying to get pyprocgame up and running.  I posted about it over in the L2 software forum here:
http://www.pinballcontrollers.com/forum/index.php?board=9.0

MOcean

  • P3 Developers
  • *
  • Posts: 822
  • Michael Ocean
    • View Profile
This guide works perfectly on 10.10. I reformatted it ever so slightly, and made a directory that contains all the required files (with the changes applied) and these notes.  If anyone needs it, PM me and I will send a Dropbox link. 

Brian, I owe you a beer at expo.

Here's the reformatted install notes; same number of steps, but broke them up to be easier to read, hopefully.

0. Head into System Preferences->Security & Privacy->Unlock and select: 'Allow apps from: Anywhere';  When you're done with this process you can set that back to its previous setting.

1. Install XCode from the Mac App Store
2. Download libusb-1.0.18 http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.18/
   Unzip to my working folder called "proc" which is in the root of my home folder on the Mac. (I'll call this "/proc" from here on out.)
   Open a terminal window and change to that /proc folder and run:
      
Code: [Select]
./configure
sudo make
sudo make install
3. Download libusb-compat http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/libusb-compat-0.1.5/
   Unzip to /proc and change to that folder
      
Code: [Select]
./configure LIBUSB_1_0_CFLAGS=-I/usr/local/include/libusb-1.0 LIBUSB_1_0_LIBS="-L/usr/local/lib -lusb-1.0"
make
sudo make install
4. download cmake 2.8.12.2 universal dmg from http://www.cmake.org/cmake/resources/software.html
   install the cmake package by double clicking the pkg file
   Choose the default /usr/bin location and choose to install the command line tools
5. Download libftdi1-1.1 http://www.intra2net.com/en/developer/libftdi/download.php
   unzip into /proc folder
   change to that folder
      
Code: [Select]
mkdir bin
cd bin
cmake .. <-- needs the “..” at the end to specify the parent folder (got a boost error, but that doesn't seem to matter)
make
sudo make install
6. download yaml-cpp 0.2.6 https://code.google.com/p/yaml-cpp/downloads/detail?name=yaml-cpp-0.2.6.tar.gz&can=2&q=
   unzip and copy to /proc
   change to that folder
      
Code: [Select]
mkdir bin
cd bin
cmake .. <-- note the dots
make
sudo make install
7. download libpinproc via git clone, as described below
   in /proc
      
Code: [Select]
mkdir libpinproc
git clone [url]https://github.com/preble/libpinproc[/url] libpinproc
cd libpinproc
mkdir bin
cd bin
cmake -DBUILD_SHARED_LIBS=ON .. <-- again note the two dots at the end
   edit proc/libpinproc/CMakeLists.txt.
   Change the include line to this: include_directories(${PINPROC_SOURCE_DIR}/include ${EXTRA_INC} /usr/local/include ${FTDI_INC} /usr/local/include/libftdi1 /usr/local/include/libusb-1.0)
   Add the following line with the others below it: set(lib_ftdi_usb usb-1.0 ftdi1)
   Save the file
      
Code: [Select]
make
sudo make install
8. download pypinproc via git clone, as described below
   in /proc
      
Code: [Select]
mkdir pypinproc
git clone [url]https://github.com/preble/pypinproc[/url] pypinproc
cd pypinproc
python setup.py build
sudo python setup.py install
9. download pyYAML 3.11 from http://pyyaml.org/wiki/PyYAML
   unzip and copy that folder to /proc
   change to that folder
      
Code: [Select]
sudo python setup.py install
10. Download pygame. Pick the “Lion apple supplied python” pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip from http://www.pygame.org/download.shtml
    Install the package
11. Download & install xquartz for mac http://xquartz.macosforge.org/landing/
12. Download PIL 1.1.7 source kit from http://www.pythonware.com/products/pil/
    unzip and copy to /proc
    change to that folder
    edit setup.py (from the PIL imaging source folder)
    add the following line after line 148: add_directory(include_dirs, "/opt/X11/include") <-- I had to do a search for Xlib.h to get the path right
      
Code: [Select]
sudo python setup.py install
13. PyProcGame ...
    in /proc
      
Code: [Select]
mkdir pyprocgame
git clone [url]https://github.com/preble/pyprocgame[/url] pyprocgame
cd pyprocgame
sudo python setup.py install

DONE -- TEST:
   in terminal:
      
Code: [Select]
python
   in python run:
      
Code: [Select]
import pinproc
import procgame
import pygame
print pinproc.EventTypeBurstSwitchOpen

   The first three lines should return the prompt with no feedback. The last should print 6.

   
« Last Edit: May 19, 2015, 01:55:11 PM by MOcean »

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile

Brian, I owe you a beer at expo.


he can get in line   ;)

Brian Madden

  • Wizard
  • *****
  • Posts: 498
  • Mission Pinball
    • View Profile
    • Mission Pinball
Oh fantastic, because my Mac is getting really slow and I think I'm due for a rebuild! :)
Brian
The Mission Pinball Framework (MPF) Project*
Twitter
* Disclaimer: MPF is a work-in-progress!

uncivil engineer

  • Wizard
  • *****
  • Posts: 118
  • Alan
    • View Profile
As I am getting ready to start a new P-roc project in the next few weeks, this is timely for me.  It will enable me to move off of windows 7 and develop natively on my Mac. 

What IDE do you use with the Mac?  I have kinda been spoiled by Wing 101, as it was free, and could step and trace variables.

Curbfeeler

  • Wizard
  • *****
  • Posts: 239
  • Dan - Des Moines, IA
    • View Profile
Might be a good time to try LiClipse.  I've been using it and find it's every bit as powerful as WingIDE but free.

http://www.liclipse.com/download.html

Dan

Gabe Knuth

  • Wizard
  • *****
  • Posts: 134
  • Mission Pinball
    • View Profile
    • Mission Pinball
Sorry to make this post resurface, I just wanted to add that every time I've done this, I also need to run this command to actually talk to the P-ROC:
Code: [Select]
sudo kextunload -bundle-id com.apple.driver.AppleUSBFTDI
It's documented elsewhere on the site, but I wanted it to all be in one place.

Also, I've been doing this on El Capitan (10.11) so we know it works that far along. I did have trouble installing CMAKE, but using homebrew to get the latest version was fine.

Last, I can't find any YAML-CPP bits from the 2.x version anymore. If anyone needs it, let me know. I had it downloaded already from past installs, so I used it, but it might be worth checking to see if the 3.x versions work. I can try to do that some other time.
« Last Edit: February 11, 2016, 12:07:50 AM by Gabe Knuth »
San Francisco Pinball: http://www.pinballcontrollers.com/forum/index.php?board=32.0
1974 Gottlieb Big Shot Conversion: http://www.pinballcontrollers.com/forum/index.php?topic=1176.0;topicseen
Pictures / Video: http://flickr.com/missionpinball

Remember when we used to just play pinball??

Rosh

  • P3 Developers
  • *
  • Posts: 667
  • Josh Kugler
    • View Profile
Re: Installing libpinproc, pypinproc, and pyprocgame on Mac OS X 10.9 Mavericks
« Reply #10 on: February 11, 2016, 11:18:14 AM »
It may be you have to do the

Code: [Select]
sudo kextunload -bundle-id com.apple.driver.AppleUSBFTDI
command after each reboot.  Pretty sure that is the case with Mavericks, but possibly the newer releases now remember the unload between re-boots.